安裝部署node
建立程序目錄bootstrap
mkdir /usr/local/elasticsearch mkdir /usr/local/elasticsearch/6.4.3 mkdir /usr/local/elasticsearch/6.4.3/01 #第一個節點 mkdir /usr/local/elasticsearch/6.4.3/02 #第二個節點 mkdir /usr/local/elasticsearch/6.4.3/03 #第三個節點
mkdir /data mkdir /data/elasticsearch mkdir /data/elasticsearch/01 mkdir /data/elasticsearch/01/data mkdir /data/elasticsearch/01/logs mkdir /data/elasticsearch/02 mkdir /data/elasticsearch/02/data mkdir /data/elasticsearch/02/logs mkdir /data/elasticsearch/03 mkdir /data/elasticsearch/03/data mkdir /data/elasticsearch/03/logs
3.1 下載Elasticsearch 6.4.3 tarcurl
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.3.tar.gz
3.2 解壓文件elasticsearch
tar -xvf elasticsearch-6.4.3.tar.gz cd elasticsearch-6.4.3/ cp -rf * /usr/local/elasticsearch/6.4.3/01/ cp -rf * /usr/local/elasticsearch/6.4.3/02/ cp -rf * /usr/local/elasticsearch/6.4.3/03/
修改配置文件測試
# ---------------------------------- Cluster ----------------------------------- #這個填寫集羣名稱,集羣中每一個節點的名稱必須一致,es節點是經過名稱纔來肯定是不是同一個集羣的 cluster.name: es-test # ------------------------------------ Node ------------------------------------ #配置當前節點的名稱,該名稱在集羣中惟一,不可重複 node.name: node01 # ----------------------------------- Paths ------------------------------------ path.data: /data/elasticsearch/01/data path.logs: /data/elasticsearch/01/logs # ----------------------------------- Memory ----------------------------------- #用於程序啓動時建設內存是否足夠存放heap size,測試版能夠設成false bootstrap.memory_lock: true # ---------------------------------- Network ----------------------------------- #綁定IP地址 network.host: 0.0.0.0 #默認端口9200, 注:9300爲es節點間TCP通信使用,配置是請勿佔用 http.port: 9201 # --------------------------------- Discovery ---------------------------------- #集羣最小主節點數,爲了防止腦裂,主節點數必須爲奇數個,正式版建議採用 「總節點數/2 + 1」 discovery.zen.minimum_master_nodes: 1
# ---------------------------------- Cluster ----------------------------------- #這個填寫集羣名稱,集羣中每一個節點的名稱必須一致,es節點是經過名稱纔來肯定是不是同一個集羣的 cluster.name: es-test # ------------------------------------ Node ------------------------------------ #配置當前節點的名稱,該名稱在集羣中惟一,不可重複 node.name: node02 # ----------------------------------- Paths ------------------------------------ path.data: /data/elasticsearch/02/data path.logs: /data/elasticsearch/02/logs # ----------------------------------- Memory ----------------------------------- #用於程序啓動時建設內存是否足夠存放heap size,測試版能夠設成false bootstrap.memory_lock: true # ---------------------------------- Network ----------------------------------- #綁定IP地址 network.host: 0.0.0.0 #默認端口9200, 注:9300爲es節點間TCP通信使用,配置是請勿佔用 http.port: 9202 # --------------------------------- Discovery ---------------------------------- #集羣最小主節點數,爲了防止腦裂,正式版建議採用 「總節點數/2 + 1」 discovery.zen.minimum_master_nodes: 1
# ---------------------------------- Cluster ----------------------------------- #這個填寫集羣名稱,集羣中每一個節點的名稱必須一致,es節點是經過名稱纔來肯定是不是同一個集羣的 cluster.name: es-test # ------------------------------------ Node ------------------------------------ #配置當前節點的名稱,該名稱在集羣中惟一,不可重複 node.name: node03 # ----------------------------------- Paths ------------------------------------ path.data: /data/elasticsearch/03/data path.logs: /data/elasticsearch/03/logs # ----------------------------------- Memory ----------------------------------- #用於程序啓動時建設內存是否足夠存放heap size,測試版能夠設成flase bootstrap.memory_lock: true # ---------------------------------- Network ----------------------------------- #綁定IP地址 network.host: 0.0.0.0 #默認端口9200, 注:9300爲es節點間TCP通信使用,配置是請勿佔用 http.port: 9203 # --------------------------------- Discovery ---------------------------------- #集羣最小主節點數,爲了防止腦裂,正式版建議採用 「總節點數/2 + 1」 discovery.zen.minimum_master_nodes: 1
部署隔離完善url
groupadd elastic useradd -g elastic elasticsearch
chown -R elasticsearch:elastic /data/elasticsearch chown -R /usr/local/elasticsearch/6.4.3
[program:elasticsearch01] command=/usr/local/elasticsearch/6.4.3/01/bin/elasticsearch autostart=true autorestart=true startsecs=3 user=elasticsearch redirect_stderr=true stdout_logfile=/var/logs/supervisor/elasticsearch01.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=10 [program:elasticsearch02] command=/usr/local/elasticsearch/6.4.3/02/bin/elasticsearch autostart=true autorestart=true startsecs=3 user=elasticsearch redirect_stderr=true stdout_logfile=/var/logs/supervisor/elasticsearch02.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=10 [program:elasticsearch03] command=/usr/local/elasticsearch/6.4.3/03/bin/elasticsearch autostart=true autorestart=true startsecs=3 user=elasticsearch redirect_stderr=true stdout_logfile=/var/logs/supervisor/elasticsearch03.log stdout_logfile_maxbytes=10MB stdout_logfile_backups=10