Linux环境下安装elasticsearch和elastic-head

Linux环境下安装elasticsearch和elastic-head

首先安装好jdk1.8版本。

elasticsearch安装:

我所使用的是elasticsearch6.2.2版本

1、解压安装包: tar -zxvf

​ 移动解压后的文件到自己习惯存放的文件夹中

mv elasticsearch-6.2.2 soft/elasticsearch

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

如果需要增加用户和设置密码

useradd xxx
passwd xxx

3、修改配置参数

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

为了防止出现一些问题,还要改一些文件的配置参数

(1)解除Linux系统的最大文件打开数限制

​ 编辑 /etc/security/limits.conf

	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)权限问题

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

4、启动elasticsearch:

在非root用户下进入

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

5、安装elastic-head

我们要安装elasticsearch-head作为web展示页面,同样要装nodejs,nodejs是一个服务端的javaScript运行环境。首先要安装一个下载工具npm,就类似于迅雷一样

wget https://npm.taobao.org/mirrrors/node/v11.0.0/node-v11.0.0tar.gz
tar -zxf node-v11.0.0.tar.gz
cd node-v11.0.0
yum install gcc gcc-c++
../configure
make
make install
node -v

设置完之后就安装elastic-head:

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值