Centos7下Elastic Search的安装、配置、常见问题

安装ElasticSearch

1、安装java

yum install -y java

查看java安装结果

java -version

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

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、对ElasticSearch文件授权

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

5、切换账户

cd /usr/local/elasticsearch-6.5.0/

su esuser

6、修改ElasticSearch配置

vi /config/elasticsearch.yml

network.host: 192.168.0.129

http.port: 9200

注意,IP地址、端口号和冒号之间是有一个空格,一定要加上

7、启动ES

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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值