美文网首页
elasticsearch

elasticsearch

作者: WFF_FFW | 来源:发表于2019-03-11 13:55 被阅读0次
基础环境

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依赖

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环境变量

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

环境变量生效

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 环境变量

echo -e "export NODE_HOME="/opt/node"
export PATH="$PATH:$NODE_HOME/bin"
export NODE_PATH="$NODE_HOME/lib/node_modules"" >>/etc/profile

修改node目录权限

chown root:root /opt/node -R

环境变量生效,查看node版本

source /etc/profile
node -v

修改最大文件数

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

创建普通用户

useradd dev
passwd dev

安装ela
1.1:移动包并且解压

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 #集群名称,默认为elasticsearch
node.name: node-wff1 #节点名
node.master: true
http.port: 9200
transport.tcp.port: 9003 #默认端口是9300
network.host: 0.0.0.0
#path.logs: #日志的路径
#path.data: #数据的路径
#path.plugins: #插件的路径
discovery.zen.ping.unicast.hosts: ["192.168.1.185"] #发现新的节点的ip
http.cors.enabled: true
http.cors.allow-origin: "*"

启动(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";

启动此插件

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: "*"

启动(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";

启动此插件

nohup grunt server &

相关文章

网友评论

      本文标题:elasticsearch

      本文链接:https://www.haomeiwen.com/subject/lynvpqtx.html