Elastic Search 安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fengkang511/article/details/86472355

安装ElasticSearch

1、安装java

yum install -y java

查看java安装结果

java -version

2、下载elastic安装包,并解压

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.0.tar.gz

tar -zxvf elasticsearch-6.5.0.tar.gz -C /usr/local/

3、添加新账户,es不能再在root账户中启动

adduser esuser

passwd esuser

4、对Elastic文件授权

chown -R esuser/usr/local/elasticsearch-5.6.3/

5、切换账户

cd /usr/local/elasticsearch-5.6.3/ su esuser

6、修改Elastic配置/config/elasticsearch.yml

network.host: 192.168.0.168

http.port: 9200

7、启动elastic

bin/elasticsearch(加“ -d ”可以后台运行)

访问链接192.168.0.129:9200,出现下面内容

启动时遇到的问题

1、“OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N”

解决方案:

在jvm.options中添加-XX:-AssumeMP,文件在ES安装目录下:/config/jvm.options

2、提示端口未打开

解决方案:

在iptables中放开9200,9300端口(9200是http服务端口,9300是tcp服务端口),配置文件(/etc/sysconfig/iptables)中添加

-A INPUT -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 9300 -j ACCEPT

或者直接打开9200-9400之间的所有端口

-A INPUT -p tcp -m state --state NEW -m tcp --dport 9200:9400 -j ACCEPT

3、“max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]”

解决方案:

su root vim /etc/sysctl.conf

添加

vm.max_map_count=655360

保存退出,然后使配置生效

sysctl -p

4、“max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]”

解决方案:

su root vim /etc/security/limits.conf

添加下面的

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

猜你喜欢

转载自blog.csdn.net/fengkang511/article/details/86472355