Elasticsearch 集群安装
说明
公网 | 内网 | 用途 |
---|---|---|
47.93.118.39 | 10.30.50.108 | Elasticsearch master |
47.93.118.43 | 10.30.50.94 | Elasticsearch slave |
安装
1、下载
cd /usr/local
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.1.tar.gz
2、解压
tar zxvf elasticsearch-5.6.1.tar.gz
3、改名
mv elasticsearch-5.6.1 elasticsearch
4、修改配置文件
vi elasticsearch/config/elasticsearch.yml
添加如下内容
http.port:9200
node.name: node1
cluster.name: es_cluster
network.host: 59.110.215.36.222
bootstrap.memory_lock: false
path.data: /usr/local/elasticsearch/data
path.logs: /usr/local/elasticsearch/logs
discovery.zen.ping.unicast.hosts:[“xxx.xxx.x.x”,”xxx.xxx.x.x”]
5、配置足够内存
vi /usr/local/elasticsearch/config/jvm.options
6、配置环境变量
vi /etc/profile
添加如下内容
export ES_HOME=/usr/local/elasticsearch
7、添加独立用户
groupadd elsearch
useradd elsearch -g elsearch
chown -R elsearch:elsearch /usr/local/elasticsearch
8、启动
su elsearch
cd /usr/local/elasticsearch/bin
./elasticsearch -d //后台运行