指定版本: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