Linux系统下Elasticsearch 6.3.2安装

版权声明:转载请注明出处! https://blog.csdn.net/ywd1992/article/details/88345205

一、基础环境安装

1、安装java环境(链接:https://pan.baidu.com/s/1sDXtxyZcp1msGII2UhdoFQ 提取码:fis9)

rpm -ivh jdk-8u191-linux-x64.rpm

配置java环境 vi /etc/profile,在最后添加以下配置:

#set java environment
export JAVA_HOME=/usr/java/jdk1.8.0_191/
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

加载刚才设置的变量

source /etc/profile

2、安装sshfs
链接:https://pan.baidu.com/s/1Rj5Alt4z2nlJL0-gokBF0g 提取码:n9dk

tar -xvf sshfs.tar.gz
cd sshfs/

rpm -ivh fuse-libs-2.9.2-7.el7.x86_64.rpm  
rpm -ivh fuse-sshfs-2.5-1.el7.rf.x86_64.rpm --force --nodeps

二、ES安装配置

1、安装ES

链接:https://pan.baidu.com/s/1zqmbD2YSQlXowspcRXDI1g 提取码:9od6

rpm -ivh elasticsearch-6.3.2.rpm

sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
2、配置ES
vim /etc/elasticsearch/elasticsearch.yml

node.master: false
node.data: true

cluster.name: test_one #集群名(唯一)
node.name: node-1 #节点名称(每个节点不同)
path.data: /data1/es/data #数据存储目录,可配置多个,用“,”隔开
path.logs: /data1/es/logs #日志存储目录
path.repo: ["/data1/es/backups"]
network.host: 192.168.0.103 #本机IP
http.port: 9200 #访问端口
discovery.zen.ping.unicast.hosts: ["192.168.0.103", "192.168.0.104", "192.168.0.105"] #集群中节点所在IP
cluster.routing.allocation.disk.watermark.low: "90%" #es所占数据盘容量的最大百分比
http.enabled: true    #head插件是否可在浏览器中查看
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.minimum_master_nodes: 1   #最少主节点数
xpack.security.enabled: false
vim /etc/elasticsearch/jvm.options

# 修改为内存的一半
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms16g
-Xmx16g

vim /etc/sysctl.conf

vm.max_map_count=262144 #添加

sysctl -p #生效
3、相关目录创建
mkdir -p /data1/es/{data,logs,backups} 
chmod 777 -R /data1/es/*
4、安装ik插件及Head插件

链接:https://pan.baidu.com/s/1EURIgCtwk5o41t_3mqFk5Q 提取码:qft1

unzip ik.zip
mv ik/ /usr/share/elasticsearch/plugins/

Head插件使用Chrome扩展
链接:https://pan.baidu.com/s/1tiLFEU8WsId2SnhkumWA5w 提取码:1tve

5、重启ES使配置生效
systemctl restart elasticsearch

猜你喜欢

转载自blog.csdn.net/ywd1992/article/details/88345205
今日推荐