ELK安装部署监控nginx

一,搭建环境 在192.168.153.222操作
修改 vim /etc/hosts

拷贝 scp /etc/hosts 192.168.153.135:/etc

修改 vim /etc/systemd/system.conf

修改 vim /etc/systemd/user.conf

查看时间同步 systemctl status chronyd

查看端口netstat -antup

修改时间同步配置文件 vim /etc/chrony.conf
设置自己为同步点

设置本机网段可以同步

设置共享

重新启动 systemctl restart chronyd

在 另外一台 192.168.153.135上操作
安装依赖 yum -y install ntpdate
同步时间 ntpdate 192.168.153.222

查看全路径 which ntpdate

编写计划任务 crontab –e

查看是否成功 systemctl status crond

查看是否成功 tail -f /var/log/cron

(一): 在192.168.153.222操作
安装java 环境 yum -y install java-1.8.0-openjdk

上传 elasticsearch-6.6.0.rpm 包

解压 elasticsearch-6.6.0.rpm 包

修改 vim /etc/elasticsearch/elasticsearch.yml 配置文件

重新启动 elasticsearch

设置开机自启 elasticsearch

查看 netstat -antup
访问页面是否成功:http:// http://192.168.153.222:9200/

(二): 在192.168.153.135上操作
安装java yum -y install java-1.8.0-openjdk.x86_64

上传 logstash-6.6.0.rpm 安装包
解压安装 logstash-6.6.0.rpm 安装包

更改权限

编写子配置文件 vim /etc/logstash/conf.d/syslog.conf

启动并设置开机自启 systemctl restart logstash

查看是否成功运行 curl -XGET 'localhost:9600/?pretty'

(一) 在192.168.153.222操作
安装 kibana-6.6.0-x86_64.rpm

修改kibana.yml完文件 vim /etc/kibana/kibana.yml

启动设置为开机自启 systemctl restart kibana

查看是否启动 netstat -antup

访问页面 http://192.168.153.222:5601

4、nginx+kibana
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/.conf;
server {
listen 80;
server_name kibana.stu.com;
auth_basic "kibana auth password";
auth_basic_user_file /etc/nginx/kibana.auth;
#root /usr/share/nginx/html;
include /etc/nginx/default.d/
.conf;
location / {
proxy_pass http://kibana;
}
}
upstream kibana {
server 192.168.100.1:5601 weight=1 max_fails=2 fail_timeout=2;
}
}

转载于:https://blog.51cto.com/14241151/2363177

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值