centos7.9 部署elasticsearch 7.17.8 集羣

準備基本環境

名稱 ip地址 cpu 內存 es監聽端口
redis-651 10.0.2.1 8c 64G 9200
redis-652 10.0.2.2 8c 64G 9200
redis-653 10.0.2.3 8c 64G 9200

搭建集羣

  • 10.0.2.1 主機配置基本環境
# 更新hosts文件
cat /etc/hosts
10.0.2.1	es-node-1
10.0.2.2	es-node-2
10.0.2.3	es-node-3

# 創建es用戶
useradd -d /export/es  es
su - es

# 下載包並解壓
[es@es-node-1 ~]$ cd /export
[es@es-node-1 ~]$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.8-linux-x86_64.tar.gz
[es@es-node-1 ~]$ tar -xf elasticsearch-7.17.8-linux-x86_64.tar.gz

# 創建數據目錄並準備配置文件
[es@es-node-1 ~]$ mkdir /export/elasticsearch-7.17.8/data/
[es@es-node-1 ~]$ cd /export/elasticsearch-7.17.8/config/
[root@es-node-1 config]# vim elasticsearch.yml
cluster.name: my-application
node.name: es-node-1
node.master: true
node.data: true
path.data: /export/elasticsearch-7.17.8/data
path.logs: /export/elasticsearch-7.17.8/logs
network.host: 0.0.0.0
http.port: 9200

transport.tcp.port: 9300
transport.tcp.compress: true

discovery.seed_hosts: ["10.0.2.1:9300", "10.0.2.2:9300", "10.0.2.3:9300"]
cluster.initial_master_nodes: ["es-node-1", "es-node-2", "es-node-3"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
gateway.expected_nodes: 2
search.max_buckets: 90000000
indices.query.bool.max_clause_count: 10240
cluster.routing.allocation.same_shard.host: true
bootstrap.memory_lock: true
http.cors.enabled: true
http.cors.allow-origin: "*"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章