Linux环境下安装elasticsearch和elastic-head

安装elasticsearch:

1.解压安装包(我这里用的是elasticsearch6.2.2版本)tar -zxvf

2.切换用户su xxx(elasticsearch不能在root用户下启动)

如需增加用户并设置密码:

useradd xxx
passwd xxx

3.移动解压好的文件到soft文件夹下(个人习惯把应用都放在soft文件夹下)

mv elasticsearch-6.2.2 soft/elasticsearch

4.修改配置参数

vi elasticsearch/config/elasticsearch.yml
cluster.name: es-app             #集群名称,可以自行修改
node.name: es-1                  #节点名称,自行修改
network.host: 192.168.235.133    #主机地址,这里写本机IP
http.port: 9200                  #端口
http.cors.enabled: true          #设置跨域
http.cors.allow-origin: "*"      #设置访问

可能出现的问题:

(1)系统最大文件数太低

vi /etc/security/limits.conf 文件末尾追加
	xxx soft nofile 65536
    xxx hard nofile 131072
    xxx soft nproc 4096
    xxx hard nproc 4096

(2)虚拟内存太低

vi /etc/sysctl.conf文件末尾追加
	vm.max_map_count=655360

激活:sysctl -p

一定要激活一下

(3)java.nio.file.AccessDeniedException: …/elasticsearch-6.2.2/config/jvm.options

chown 用户名 elasticsearch-6.2.2安装目录路径 -R

启动elasticsearch:

在非root用户下进入

cd /opt/soft/elasticsearch/bin/
./elasticsearch

安装elastic-head

考虑需要安装elasticsearch-head作为web展示 所以首先安装nodejs主要是利用npm

安装nodejs:

1.wget https://npm.taobao.org/mirrors/node/v11.0.0/node-v11.0.0.tar.gz
2.tar –zxvf node-v11.0.0.tar.gz
3.cd node-v11.0.0
4.yum install gcc gcc-c++
5../configure
6.make
7.make install
8.node –v

make的时间非常长,大概20分钟左右,请耐心等待。。。

安装elastic-head:

1.tar –zxvf elasticsearch-head-master    解压压缩包
2.npm install                             安装
3.npm run start                           启动elastic-head

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值