中文社区下载地址:es中文社区下载中心
可以参考我另一篇博客: centos7 elasticsearch 安装系统默认配置修改
目标服务器分别是192.168.50.15/16/17
# ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: my-es-cluster # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: node-16 # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # path.data: data/data # # Path to log files: # path.logs: data/logs # # ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # network.host: 0.0.0.0 # # Set a custom port for HTTP: # http.port: 9200 # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when this node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # discovery.seed_hosts: ["192.168.50.15", "192.168.50.16","192.168.50.17"] # # Bootstrap the cluster using an initial set of master-eligible nodes: # cluster.initial_master_nodes: ["node-15", "node-16","node-17"] # # For more information, consult the discovery and cluster formation module documentation. # # ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # gateway.recover_after_nodes: 2 # # For more information, consult the gateway module documentation. # # ---------------------------------- cors----------------------------------- http.cors.enabled: true http.cors.allow-origin: "*"注意事项:
集群名称必须一致 cluster.name节点名称不同然后使用非root账户启动即可 ./bin/elasticsearch -d
参考配置
# Kibana is served by a back end server. This setting specifies the port to use. server.port: 5601 # Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values. # The default is 'localhost', which usually means remote machines will not be able to connect. # To allow connections from remote users, set this parameter to a non-loopback address. server.host: "192.168.50.17" # The URLs of the Elasticsearch instances to use for all your queries. elasticsearch.hosts: ["http://192.168.50.15:9200","http://192.168.50.16:9200","http://192.168.50.17:9200"] # Supported languages are the following: English - en , by default , Chinese - zh-CN . i18n.locale: "zh-CN"其它配置根据具体情况进行选择
同样使用非root账户启动即可 ./bin/kibana &
Logstash主要根据使用场景进行不同的配置
例如控制台输入
input { #控制台输入 stdin{ } } output { #es导入 elasticsearch { hosts => ["http://192.168.50.17:9200"] index => "test-%{+YYYY.MM.dd}" #user => "elastic" #password => "changeme" } #控制台输出 stdout { codec => rubydebug } }启动logstash ./bin/logstash -f 配置文件/文件夹
这样就吧elk搭建起来了,下篇文章讲介绍项目中的实际使用