elasticsearch集群安装配置

Posted lzfj

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了elasticsearch集群安装配置相关的知识,希望对你有一定的参考价值。

环境:CentOS release 6.7 (Final)     
           java version "1.8.0_77"
IP:192.168.98.161、192.168.98.162、192.168.98.163
 
安装见《简单安装elasticsearch步骤》
配置文件elasticsearch.yml:
192.168.98.161:
cluster.name : LZ
node.name : "lz-1"
path.data : "/tmp/elasticsearch/data"
path.logs : "/tmp/elasticsearch/logs"
network.host : "192.168.98.161"
network.port : "9200"
node.master : true
node.data : true
discovery.zen.ping.unicast.hosts : ["192.168.98.161","192.168.98.162","192.168.98.163"]
192.168.98.162:
cluster.name : LZ
node.name : "lz-2"
path.data : "/tmp/elasticsearch/data"
path.logs : "/tmp/elasticsearch/logs"
network.host : "192.168.98.162"
network.port : "9200"
node.master : false
node.data : true
discovery.zen.ping.unicast.hosts : ["192.168.98.161","192.168.98.162","192.168.98.163"]
192.168.98.163:
cluster.name : LZ
node.name : "lz-3"
path.data : "/tmp/elasticsearch/data"
path.logs : "/tmp/elasticsearch/logs"
network.host : "192.168.98.163"
network.port : "9200"
node.master : false
node.data : true
discovery.zen.ping.unicast.hosts : ["192.168.98.161","192.168.98.162","192.168.98.163"]
 

 

./bin/elasticsearch -d          ###后台运行elasticsearch
 
查看集群节点列表:
[root@ELK1 src]# curl \'192.168.98.161:9200/_cat/nodes?v\'
host           ip             heap.percent ram.percent load node.role master name
192.168.98.161 192.168.98.161            7          81 0.38 d         *      lz-1
192.168.98.162 192.168.98.162            2          92 0.49 d         -      lz-2
192.168.98.163 192.168.98.163            6          93 0.79 d         -      lz-3
查看索引信息:
[root@ELK1 ~]# curl 192.168.98.161:9200/_cat/indices
green open mysql-slowlog-2016.04.12 5 1 14 0 146.5kb 73.2kb
green open .kibana                  1 1  5 0  41.1kb 20.5kb
green open tomcat                   5 1 30 0  81.9kb 40.9kb
green open mysql-slowlog            5 1  5 0    55kb 27.5kb
 

以上是关于elasticsearch集群安装配置的主要内容,如果未能解决你的问题,请参考以下文章

Elasticsearch7.8.0版本进阶——分布式集群(单节点集群)

ElasticSearch第一天

ELK 实验elasticsearch集群搭建

Java连接Elasticsearch集群

Centos7 安装 elasticsearch-head插件

elasticsearch在centos7上的安装与配置教程