环境:
主机1: 10.0.0.3 172.168.2.6 (查看ELK文章1,请安装java和elasticsearch)
主机2: 10.0.0.4 172.168.2.10 (查看ELK文章1,请安装java和elasticsearch)
主机3: 10.0.0.2 (查看ELK文章1,请安装java和elasticsearch)
一、最终配置情况
主机1配置文件详细:
[root@web01 elasticsearch-head]# grep "^[a-z]" /etc/elasticsearch/elasticsearch.yml
cluster.name: linux666
node.name: node-1
path.data: /data/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 10.0.0.3,127.0.0.1
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.0.0.3", "10.0.0.4"]
discovery.zen.minimum_master_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"
主机2配置文件详情:
[root@web02 opt]# grep "^[a-z]" /etc/elasticsearch/elasticsearch.yml
cluster.name: linux666
node.name: node-2
path.data: /data/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 10.0.0.4,127.0.0.1
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.0.0.3", "10.0.0.4"]
discovery.zen.minimum_master_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"
主机3配置文件详情:
[root@ansible opt]# grep "^[a-z]" /etc/elasticsearch/elasticsearch.yml
cluster.name: linux666
node.name: node-3
path.data: /data/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
network.host: 10.0.0.2,127.0.0.1
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.0.0.3", "10.0.0.2"]
discovery.zen.minimum_master_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"
二、连接head查看node
出现2个node,(安装head请查看文章3进行连接)
(
集群状态有3种:
green:所有索引数据都存在,副本满足条件,所有数据都完整。
yellow:所有索引数据完整,但是副本不满足条件。
red:数据不完整,有的索引数据有丢失。
)
------------------------
查看系统检索信息
Cluster Stats API允许从群集范围的角度检索统计信息。
官网地址:
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html
操作命令:
curl -XGET 'http://localhost:9200/_cluster/stats?human&pretty'
查看集群的设置
官方地址:
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-get-settings.html
操作命令:
curl -XGET 'http://localhost:9200/_cluster/settings?include_defaults=true&human&pretty’
查询节点的状态
官网地址:
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html
操作命令:
curl -XGET 'http://localhost:9200/_nodes/procese?human&pretty'
curl -XGET 'http://localhost:9200/_nodes/_all/info/jvm,process?human&pretty'
curl -XGET 'http://localhost:9200/_cat/nodes?human&pretty'
---------------------------------
最终集群结果:
有问题请加博主微信进行沟通!
全部评论