1.官網下載相應軟件
elasticsearch7.3.0:https://www.elastic.co/cn/downloads/elasticsearch
cerebro-0.8.4:https://github.com/lmenezes/cerebro/releases
jdk1.8:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2.軟件安裝
tar -zxvf elasticsearch-7.3.0-linux-x86_64.tar.gz
cd elasticsearch-7.3.0-linux-x86_64/config
mkdir -p config-data1
mkdir -p config-data2
mkdir -p config-data3
將config下面的文件
elasticsearch.keystore
jvm.options
role_mapping.yml
users
elasticsearch.yml
log4j2.properties
roles.yml
users_roles
分別複製到config-data1,config-data2,config-data3
3.配置修改
3.1增大文件打開數
vim /etc/security/limits.conf
##############################
* - nofile 65536
* - nproc 65535
##############################
重啓後生效
3.2增大虛擬內存
vim /etc/sysctl.conf
###########################
vm.max_map_count = 262144
###########################
3.3ES節點配置文件
#############################
#修改節點1的配置文件
#############################
vim config-data1/elasticsearch.yml
cluster.name: LCP
node.name: node-1
discovery.zen.minimum_master_nodes: 1
node.max_local_storage_nodes: 4
path.data: /appdata/es-data/data1
path.logs: /applog/es-log/log1
network.host: 127.0.0.1
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9302","127.0.0.1:9304"]
cluster.initial_master_nodes: ["node-1","node-2","node-3"]
http.cors.enabled: true
http.cors.allow-origin: "*"
path.repo: ["/backup/es-backup"]
bootstrap.memory_lock: true
indices.memory.index_buffer_size: 30%
thread_pool.search.queue_size: 1000
thread_pool.write.queue_size: 1000
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
#############################
#修改節點2的配置文件
#############################
vim config-data2/elasticsearch.yml
cluster.name: LCP
node.name: node-2
discovery.zen.minimum_master_nodes: 1
node.max_local_storage_nodes: 4
path.data: /appdata/es-data/data2
path.logs: /applog/es-log/log2
network.host: 127.0.0.1
http.port: 9202
transport.tcp.port: 9302
discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9302","127.0.0.1:9304"]
cluster.initial_master_nodes: ["node-1","node-2","node-3"]
http.cors.enabled: true
http.cors.allow-origin: "*"
path.repo: ["/backup/es-backup"]
bootstrap.memory_lock: true
indices.memory.index_buffer_size: 30%
thread_pool.search.queue_size: 1000
thread_pool.write.queue_size: 1000
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
#############################
#修改節點3的配置文件
#############################
vim config-data1/elasticsearch.yml
cluster.name: LCP
node.name: node-3
discovery.zen.minimum_master_nodes: 1
node.max_local_storage_nodes: 4
path.data: /appdata/es-data/data3
path.logs: /applog/es-log/log3
network.host: 127.0.0.1
http.port: 9204
transport.tcp.port: 9304
discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9302","127.0.0.1:9304"]
cluster.initial_master_nodes: ["node-1","node-2","node-3"]
http.cors.enabled: true
http.cors.allow-origin: "*"
path.repo: ["/backup/es-backup"]
bootstrap.memory_lock: true
indices.memory.index_buffer_size: 30%
thread_pool.search.queue_size: 1000
thread_pool.write.queue_size: 1000
xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true
3.4修改java內存大小
vim config/config-data1/jvm.options
###############################
-Xms512m
-Xmx512m
###############################
由於單臺電腦配置較低,改成512M。
4.ES節點啓動
依次啓動三個ES節點
5.安裝cerebro工具
unzip cerebro-0.8.4.zip
cd cerebro-0.8.4/
nohup bin/cerebro >/dev/null &