linux(Centos7)安装elasticsearch6.2.2

1、安装jdk,至少需要jdk1.8版本

6382f45b013b886ef4bbe63da0eec3c41c8.jpg

2、下载elasticsearch 安装包

cd /usr/local/src
###如果没有安装wget 请安装(yum -y install wget)
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.2.tar.gz

3、解压 elasticsearch

##创建目录,存放es安装位置
mkdir /usr/local/es
##解压elasticsearch安装包
tar -xvf elasticsearch-6.2.2.tar.gz -C /usr/local/es/

4、修改解压后的目录名称

cd /usr/local/es/
mv elasticsearch-6.2.2/ node-1

5、创建用户组和用户(elasticsearch不能用root用户启动)

##创建用户组
groupadd elasticsearch
##创建用户es 指定到elasticsearch用户组 并设置用户es的密码为es
useradd es -g elasticsearch -p es
##给用户es授权可操作的目录
chown -R es:elasticsearch /usr/local/es

6、创建elasticsearch 的数据存放目录data

su es
mkdir /usr/local/es/node-1/data

7、编辑elasticsearch.yml文件

cd /usr/local/es/node-1/config/
vi elasticsearch.yml
##集群名称
cluster.name: es-cluster
##节点名称
node.name: node-1
##网络监听地址
network.host: 192.168.56.101
http.port: 9200
##使用head等插件监控集群信息,需要打开以下配置项
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-credentials: true

8、修改jvm.options

-Xms512m
-Xmx512m

9、修改用户可用的最大线程数配置

##切换到root用户,编辑limits.conf 添加类似如下内容
su root
##编辑文件
vim /etc/security/limits.conf
编辑为如下内容
*        soft    nofile           65536
*        hard    nofile           131072
*        soft    nproc            2048
*        hard    nproc            4096

10、编辑 vi /etc/sysctl.conf 

vm.max_map_count=655360

编辑完成后执行命令:

sysctl -p

11、切换回es用户启动elasticsearch

su es
cd /usr/local/es/node-1/bin
./elasticsearch

4690696e50063a285b7d6e1853995b3bc98.jpg

启动成功就是以上界面

如果要后台启动 在启动的时候后面加 -d参数即可

./elasticsearch -d

 

转载于:https://my.oschina.net/shxjinchao/blog/2878040

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值