指定版本:6.7.1 (建議使用同一的版本、屏蔽三個軟件間的不兼容性)node
這裏es集羣用了3個節點,配置文件放在 /root/es/config/ 目錄下,docker
注意:es是不容許使用root用戶啓動的,/root/es/config/ 目錄最好改爲 777權限,json
es1.yml配置文件內容:vim
cluster.name: elasticsearch-cluster
node.name: es-node1
network.bind_host: 0.0.0.0
network.publish_host: 10.90.101.48
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["10.90.101.48:9300","10.90.101.48:9301","10.90.101.48:9302"]
discovery.zen.minimum_master_nodes: 2
xpack.ml.enabled: false
xpack.monitoring.enabled: false
xpack.security.enabled: false
xpack.watcher.enabled: false
啓動當前配置文件的es命令:瀏覽器
cluster.name: elasticsearch-cluster
node.name: es-node2
network.bind_host: 0.0.0.0
network.publish_host: 10.90.101.48
http.port: 9201
transport.tcp.port: 9301
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["10.90.101.48:9300","10.90.101.48:9301","10.90.101.48:9302"]
discovery.zen.minimum_master_nodes: 2
xpack.ml.enabled: false
xpack.monitoring.enabled: false
xpack.security.enabled: false
xpack.watcher.enabled: false
啓動當前配置文件的es命令:服務器
cluster.name: elasticsearch-cluster
node.name: es-node3
network.bind_host: 0.0.0.0
network.publish_host: 10.90.101.48
http.port: 9202
transport.tcp.port: 9302
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["10.90.101.48:9300","10.90.101.48:9301","10.90.101.48:9302"]
discovery.zen.minimum_master_nodes: 2
xpack.ml.enabled: false
xpack.monitoring.enabled: false
xpack.security.enabled: false
xpack.watcher.enabled: false
啓動當前配置文件的es命令:app
server.name: kibana
server.host: "0"
elasticsearch.url: http://10.90.101.48:9300
xpack.monitoring.ui.container.elasticsearch.enabled: false
xpack.security.enabled: false
xpack.ml.enabled: false
xpack.monitoring.enabled: false
啓動kibanacors
pipeline/logstash.confjvm
input{
http{
host => "0.0.0.0"
port => 5050
additional_codecs => {"application/json"=>"json"}
codec => "plain"
threads => 4
ssl => false
}
}
output {
elasticsearch {
hosts => ["http://10.90.101.48:9200","http://10.90.101.51:9201","http://10.90.101.51:9202"]
index => "log_%{logtype}_%{+YYYY.MM.dd}"
}
}
設置日誌輸入輸出方式elasticsearch
config/logstash.yml
http.host: "0.0.0.0"
xpack.monitoring.enabled: false
啓動logstash
docker pull lmenezes/cerebro
啓動cerebro