一,搭建环境 在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; } }