1-elasticsearch安装

 
 
 

1、解压:

tar -zxvf elasticsearch-6.4.3.tar.gz
 

2、配置修改:

目录在/opt/elasticsearch-6.4.3/config/elasticsearch.yml下面,解开下面的注释
vim  /opt/elasticsearch-6.4.3/config/elasticsearch.yml
ip地址为当前机器的ip地址
network.host: 192.168.116.128
es的web的端口号,9300内部通讯
http.port: 9200
 

3、安装

cd /opt/elasticsearch-6.4.3/bin
./elasticsearch
 

4、报错解决,不能使用root账号

 
[2019-12-09T15:52:39,578][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
操作命令
[root@ip-100 bin]# groupadd esgroup
[root@ip-100 bin]# useradd esyg -g -p 123456
useradd: group '-p' does not exist
[root@ip-100 bin]# useradd esyg -g esgroup  -p 123456
[root@ip-100 bin]# chown -R esyg:esgroup /opt/elasticsearch-6.4.3
[root@ip-100 bin]# su esyg
[esyg@ip-100 bin]$
 

5、在su esyg之后,然后执行./elasticsearch安装之后报错是

ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决1-

vim /etc/sysctl.conf
vm.max_map_count=655360
sysctl -p
 

解决2-

vim /etc/security/limits.conf
加入四行:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
 

6、最后重启服务器(使用esyg这个账号启动)

 
关闭防火墙:
    systemctl stop firewalld.service
 
访问地址:成功
    http://192.168.116.128:9200/
 
{
  "name" : "nfauw-K",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "9gzQa7MkQ8esa4n_fSD6cQ",
  "version" : {
    "number" : "6.4.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "fe40335",
    "build_date" : "2018-10-30T23:17:19.084789Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值