ElasticSearch安装以及注意事项
1、准备事项
es安装包地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.tar.gz
jdk安装包地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
#注意 jdk版本和es版本需要兼容,如果安裝结束后启动es报错–版本不兼容,则需要对jdk版本进行升降处理。
2、安装配置jdk
yum -y install jdk-8u221-linux-x64.rpm
export JAVA_HOME=/usr/java/jdk1.8.0_221-amd64
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
3、安装配置es
cd /opt
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.tar.gz
tar -xzvf elasticsearch-6.3.0.tar.gz
cd elasticsearch-6.3.0/config
因为启动es不能使用root用户,所以需要使用其他用户
useradd vagrant
chown -R vagrant:vagrant elasticsearch-6.3.0
修改配置参数 elasticsearch.yml
network.host: 192.168.10.18 # 当前节点的IP地址
http.port: 9200
在最下面添加两个配置:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
登录root用户修改/etc/security/limits.conf 文件
vim /etc/security/limits.conf
加入以下配置
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
再修改配置文件/etc/sysctl.conf,添加如下内容
vm.max_map_count=655360
执行:sysctl -p
应该输出vm.max_map_count=655360。
退出重新登录,并切换用户black。
启动es:/opt/elasticsearch-6.3.0/bin/elasticsearch
通过curl 192.168.10.18:9200可以验证es安装启动成功。
或者浏览器url验证也可以
至此,es安装配置完成。