如何在centos中离线安装elasticsearch7.8

官网下载安装包

下载地址:https://www.elastic.co/cn/downloads/past-releases

下载好的文件为:elasticsearch-7.8.0-linux-x86_64.tar.gz

300M官网慢可以从这里下载 

https://pan.baidu.com/s/1-c3WeI5mm-2A8EVk4WPugg

下载密码见文章末尾

 

上传安装包

上传至linux服务器/usr/local目录下,

执行并解压,解压后会生成一个名为elasticsearch-7.8.0的文件夹

cd /usr/local

tar xzvf elasticsearch-7.8.0-linux-x86_64.tar.gz

修改配置文件

修改配置文件/root/elasticsearch-7.8.0/config/elasticsearch.yml

#设置节点服务器ip(其他服务器可通过IP访问)

network.host: 0.0.0.0

cluster.initial_master_nodes: ["node-1"]

创建启动用户

elasticsearch不支持root用户启动,所以需要新建一个用户,并把解压后的目录权限赋给新建用户。

#新建用户es

useradd es

#给用户设置密码

passwd es

#目录赋权

chown -R es /usr/local/elasticsearch-7.8.0

后台启动elasticsearch

切换到用户es,并进入/usr/local执行bin/elasticsearch -d

su - es
cd /usr/local/elasticsearch-7.8.0
bin/elasticsearch -d

 

 

查看启动日志/usr/local/elasticsearch-7.8.0/logs/elasticsearch.log

验证

curl http://localhost:9200

 

常见启动异常

启动elasticsearch时常见报错有

1,max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

修改/etc/security/limits.conf文件,增加配置,用户退出后重新登录生效

*               soft    nofile          65536

*               hard    nofile          65536

 

2,max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

修改/etc/sysctl.conf文件,增加配置vm.max_map_count=262144

vi /etc/sysctl.conf

sysctl -p

3,the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

修改elasticsearch.yml添加

cluster.initial_master_nodes: ["node-1"]

扫码定义爱开发公众号,回复"es"获取下载密码

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值