匿名
未登录
登录
Linux78|wiki
搜索
查看“Elasticsearch集群配置”的源代码
来自Linux78|wiki
名字空间
页面
讨论
更多
更多
页面选项
查看
查看源代码
历史
←
Elasticsearch集群配置
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
wiki:用户|用户
您可以查看与复制此页面的源代码。
=== 机器环境 === 主机IP 组件 192.168.1.3 node1 192.168.1.4 node2 192.168.1.5 node3 === 安装配置 === ==== 配置yum源 ==== cat > /etc/yum.repos.d/elk.repo << EOF [elasticsearch-6.x] name=Elasticsearch repository for 6.x packages baseurl=https://artifacts.elastic.co/packages/6.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md EOF rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch ==== 安装elasticsearch ==== 在四台主机安装elasticsearch。 yum -y install elasticsearch 接下来进行配置: ==== node1配置 ==== mkdir -pv /es/{logs,data" chown -R elasticsearch,elasticsearch /es egrep -v "^#|^$" /etc/elasticsearch/elasticsearch.yml cluster.name: elk node.name: elk-node1 path.data: /es/data/ path.logs: /es/logs/ network.host: 0.0.0.0 http.port: 9200 discovery.zen.ping.unicast.hosts: ["192.168.1.3:9300","192.168.1.4:9300","192.168.1.5:9300","192.168.1.6:9300"] discovery.zen.minimum_master_nodes: 2 xpack.security.enabled: false 说明: cluster.name:自定义集群名称 node.name:自定义节点名,不同主机名称不能一致。 path.data:data存储路径,这里更改成自定义以应对日志的big。 path.logs:log存储路径,是为es自己的日志。 network.host:es监听地址,采用"0.0.0.0",表示允许所有设备访问。 http.port:es监听端口,可不取消注释,默认即此端口。 discovery.zen.ping.unicast.hosts:集群节点发现列表 discovery.zen.minimum_master_nodes:定义可成为master的节点数量。为避免脑裂的情况,建议设置成2。参考 xpack.security.enabled:添加这条,这条是配置kibana的安全机制,暂时关闭。 ==== 分发其他三台配置 ==== 接着将配置分发给其他几台主机。 scp /etc/elasticsearch/elasticsearch.yml 192.168.1.4:/etc/elasticsearch/elasticsearch.yml scp /etc/elasticsearch/elasticsearch.yml 192.168.1.5:/etc/elasticsearch/elasticsearch.yml scp /etc/elasticsearch/elasticsearch.yml 192.168.1.6:/etc/elasticsearch/elasticsearch.yml 然后更改对应三台的配置,只需更改node-name即可。 ==== 启动es服务 ==== systemctl daemon-reload systemctl enable elasticsearch.service systemctl start elasticsearch.service systemctl status elasticsearch.service ==== 查看集群信息 ==== 查看es是否正常启动 curl -X GET "127.0.0.1:9200/" curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty' 查看集群状态 curl -XGET 'http://127.0.0.1:9200/_cat/nodes' url -XGET 'http://127.0.0.1:9200/_cat/nodes?v' url -XGET 'http://127.0.0.1:9200/_cluster/state/nodes?pretty' 查询master curl -XGET 'http://127.0.0.1:9200/_cluster/state/master_node?pretty' curl -XGET 'http://127.0.0.1:9200/_cat/master?v' 查询集群健康状态 curl -XGET 'http://127.0.0.1:9200/_cat/health?v'
返回至
Elasticsearch集群配置
。
导航
导航
首页
最近更改
随机页面
栏目
Nginx
Kubernetes
Spring Cloud
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志