我正在关注这篇文章:
http://eric-price.net/blog/centralized-logging-docker-aws-elasticsearch
这是我的docker-compose.yml的样子:
version: "2"
services:
fluentd:
image: fluent/fluentd:latest
ports:
- "24224:24224"
command: start.sh
networks:
- lognet
nginx:
image: nginx-pixel
ports:
- "80:80"
logging:
driver: fluentd
networks:
- lognet
networks:
lognet:
driver: bridge
Run Code Online (Sandbox Code Playgroud)
my start.sh与yml文件位于同一目录中。当我运行时docker-compose up -d,我得到的是:
ERROR: for fluentd Cannot start service fluentd: oci runtime error: exec: "start.sh": executable file not found in $PATH
ERROR: Encountered errors while bringing up the project.
我的码头工人组成信息:
docker-compose version 1.8.0, build f3628c7
docker-py version: 1.9.0
CPython version: 2.7.9
OpenSSL version: …Run Code Online (Sandbox Code Playgroud) 我正在尝试根据这个项目设置石墨与docker中的grafana一起工作:https://github.com/kamon-io/docker-grafana-graphite
当我运行我的dockerfile时,我得到了nginx的403 Forbidden错误.
我对nginx的配置几乎与项目的配置相同.我在服务器上运行dockerfiles并在我的Windows机器上测试它们.所以配置并不完全相同......例如我有:
server {
listen 80 default_server;
server_name _;
location / {
root /src/grafana/dist;
index index.html;
}
location /graphite/ {
proxy_pass http:/myserver:8000/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, OPTIONS";
add_header Access-Control-Allow-Headers "origin, authorization, accept";
}
Run Code Online (Sandbox Code Playgroud)
但我仍然继续禁止403.检查nginx的错误日志说:
directory index …Run Code Online (Sandbox Code Playgroud) 可以在docker容器中登录...说位于/ var/log/syslog中的日志是否运送到logstash而不使用任何其他组件,如伐木工人和logspout?
只是想知道,因为我设置了一个环境,并试图使它与syslog一起工作(所以syslog将日志从docker容器发送到logstash)但是现在它不起作用..只是想知道我的逻辑是否有问题.
我正在尝试将所有访问我的页面的请求重定向到图像。在我的 default.conf 里面,我有这个:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
try_files $uri $uri/ /usr/share/nginx/html/10343632.jpeg;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# …Run Code Online (Sandbox Code Playgroud) 我正在使用以下方法将字符串与字符串数组进行比较:
arry.include? (mystring)
Run Code Online (Sandbox Code Playgroud)
它返回一个布尔值.如何打印出该数组中有多少字符串等于mystring?