ELK部署安装
一、去https://www.elastic.co/downloads/ 下載
????????ElasticSearch: 6.0.1
????????Logstash: 6.0.1
????????Kibana: 6.0.1
????????Java: openjdk version "1.8.0_65"
1.ElasticSearch
????????配置ElasticSearch:
????????tar -zxvf elasticsearch-6.0.1.tar.gz
????????cd elasticsearch-6.0.1
????????安裝Head插件(Optional):
????????./bin/plugin install mobz/elasticsearch-head
????????然后編輯ES的配置文件:
????????cluster.name=es_cluster
????????node.name=node0
????????path.data=/tmp/elasticsearch/data
????????path.logs=/tmp/elasticsearch/logs
????????#當前hostname或IP,我這里是centos2
????????network.host=centos2
????????network.port=9200
????????啟動ElasticSearch:
????????./bin/elasticsearch -Des.insecure.allow.root=true &
????????報 failed; error='Cannot allocate memory' (errno=12)
????????./bin/elasticsearch -d -Xms512m -Xmx512m
????????關閉防火墻:
????????systemctl stop firewalld.service
????????客戶端訪問elasticsearch:
????????192.168.240.15:9200
????????head插件遠程訪問ip需要開啟:
????????vim /etc/elasticsearch/elasticsearch.yml
????????http.cors.enabled: true # elasticsearch中啟用CORS
????????http.cors.allow-origin: "*" # 允許訪問的IP地址段,* 為所有IP都可以訪問
????????取消ES只讀控制:curl -XPUT -H "Content-Type: application/json" ????????http://192.168.240.15:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
????????查看集群狀態是否健康:curl http://192.168.240.15:9200/_cluster/health?pretty
????????查看集群個索引狀態:curl http://192.168.240.15:9200/_cat/indices
2.Logstash
????????配置logstash-6.0.1.tar.gz
????????創建config/logstash.conf
????????配置老logstash.conf
????????啟動logstash:./bin/logstash -f ./config/monitor/nginx.conf &
????????nginx.conf 已經可以啟動多個索引
????????解決權限啟動問題:chmod -R 775 xxx(改為需要權限的腳本)
3.Kibana
????????解壓kibana-6.0.1-linux-x64.tar.gz
????????修改config/kibana.yml
????????server.port: 5601
????????server.host: “監聽的IP”
????????elasticsearch.url: http://監聽的IP:9200
????????kibana.index: “.kibana”
????????啟動Kibana:./bin/kibana &
????????關閉Kibana: fuser -n tcp 5601 -> kill -9 端口
NODE_HOME=/root/elasticsearch/node-v6.9.2
PATH=$PATH:$NODE_HOME/bin
NODE_PATH=$NODE_HOME/lib/node_modules
export NODE_HOME PATH NODE_PATH
總結
- 上一篇: Linux下安装RabbitMQ
- 下一篇: Linux下安装Solr