基礎(chǔ)環(huán)境
centos linux: 7.4
node-wff1:192.168.1.184
node-wff2:192.168.1.185
node:v10.14.1
java:1.8.0_92
elasticsearch: 6.3.0
包兒下載地址:https://pan.baidu.com/s/1SVfropUMNezILxbVjfRIwA
提取碼:oj7e
安裝yum依賴(lài)
yum -y install unzip bzip2
jdk 安裝
tar -zxf jdk-8u92-linux-x64.gz -C /usr/local/
cd /usr/local/
mv jdk1.8.0_92 jdk
添加java環(huán)境變量
echo -e "JAVA_HOME=/usr/local/jdk
JRE_HOME=/usr/local/jdk/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$HOME/bin:/sbin:/usr/bin:/usr/sbinexport:/usr/local/sbin:/usr/local/bin:/bin:/usr/sbin:/root/bin
CLASSPATH=.:$JAVA_HOME/lib/jt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH" >> /etc/profile
環(huán)境變量生效
source /etc/profile
查看java版本
java -version
node安裝
tar -xf node-v10.14.1-linux-x64.tar.xz -C /opt/
mv /opt/node-v10.14.1-linux-x64 /opt/node
添加node 環(huán)境變量
echo -e "export NODE_HOME="/opt/node"
export PATH="$PATH:$NODE_HOME/bin"
export NODE_PATH="$NODE_HOME/lib/node_modules"" >>/etc/profile
修改node目錄權(quán)限
chown root:root /opt/node -R
環(huán)境變量生效工腋,查看node版本
source /etc/profile
node -v
修改最大文件數(shù)
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
修改配置sysctl.conf
vim /etc/sysctl.conf
vm.max_map_count=655360
立即生效
/sbin/sysctl -p
創(chuàng)建普通用戶(hù)
useradd dev
passwd dev
安裝ela
1.1:移動(dòng)包并且解壓
cd /root
mv elasticsearch-* /home/dev/
su - dev
tar -zxf elasticsearch-6.3.0.tar.gz -C /home/dev
1.2:node-wff1-master配置文件修改:
vim /home/dev/elasticsearch-6.3.0/config/elasticsearch.yml
cluster.name: ela-wff #集群名稱(chēng)吼蚁,默認(rèn)為elasticsearch
node.name: node-wff1 #節(jié)點(diǎn)名
node.master: true
http.port: 9200
transport.tcp.port: 9003 #默認(rèn)端口是9300
network.host: 0.0.0.0
#path.logs: #日志的路徑
#path.data: #數(shù)據(jù)的路徑
#path.plugins: #插件的路徑
discovery.zen.ping.unicast.hosts: ["192.168.1.185"] #發(fā)現(xiàn)新的節(jié)點(diǎn)的ip
http.cors.enabled: true
http.cors.allow-origin: "*"
啟動(dòng)(9200|9300)
/home/dev/elasticsearch-6.3.0/bin/elasticsearch -d
安裝界面化操作插件
su root
unzip elasticsearch-head-master.zip
mv elasticsearch-head-master elasticsearch-head
cd elasticsearch-head
npm install -g grunt-clinpm install
修改第4354行
vim _site/app.js
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.1.184:9200";
啟動(dòng)此插件
nohup grunt server &
node-wff2配置
cluster.name: ela-wff
node.name: node-wff2
http.port: 9200
transport.tcp.port: 9003
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
啟動(dòng)(9200|9300)
/home/dev/elasticsearch-6.3.0/bin/elasticsearch -d
安裝界面化操作插件
su root
unzip elasticsearch-head-master.zip
mv elasticsearch-head-master elasticsearch-head
cd elasticsearch-head
npm install -g grunt-cli
npm install
修改第4354行
vim _site/app.js
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.1.185:9200";
啟動(dòng)此插件
nohup grunt server &