liunx上EalsticSearch安装步骤,亲测可用

#安装java

yum -y install java

#安装wget

yum -y install wget

#安装es

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

#解压至 /usr/local

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

#新增用户testuser,因root不能启动es

adduser testuser

#设置用户密码

passwd testuser

#给权限

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

#进入到bin目录

cd /usr/local/elasticsearch-5.6.3/

#切换用户

su testuser

#启动,要是后台启动,就加 -d

./bin/elasticsearch -d

注:

1.更新elasticsearch.yml    network.host:   为本机ip

2.启动报错,bootstrap checks failed max virtual memory areas vm.max_map_count [65530] 

  解决办法:
       切换到root用户修改配置sysctl.conf
       vim /etc/sysctl.conf 
      添加下面配置:
      vm.max_map_count=655360
      并执行命令:
      sysctl -p

3.启动报错 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

  解决办法:是在/etc/security/limits.conf文件中加两行,(root是我用户名)
   root       hard        nofile        65536
   root       soft        nofile         65536
    然后用ulimit -Hn查看是由4096--》65536
   未成功的话,退出xshell,从新连接

4.关闭防火墙(或者开放9200端口)

5.重新启动

测试:新开命令脚本窗口,执行
curl 'http://ip:9200/?pretty'

出现下图,即ok

猜你喜欢

转载自blog.csdn.net/SmallTenMr/article/details/86523196
今日推荐