一.安装步骤
1.1 下载ElasticSearch
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.4.tar.gz
1.2. 解压安装包
tar -zxvf elasticsearch-6.8.4.tar.gz
二. 常见的错误以及解决方案
2.1 es 不支持 root启动,解决办法如下
添加用户组:groupadd esroot
添加用户 :useradd esroot -g esroot
设置密码: passwd 12345678
切换账户: su esroot
2.2 启动时报jvm.options的错误
vim /etc/security/limits.conf
参加参数
* soft nproc 4096
* hard nproc 4096
* soft nofile 65536
* hard nofile 65536
用root用户赋权限
chown -R 用户名:用户名 文件目录
chown -R esroot:esroot /usr/local/elastic/
2.3 页面无法访问
network.host: ip地址(注意:后要写空格,不然的话要报线程异常)
2.4 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:
切换到root用户
执行命令:
sysctl -w vm.max_map_count=262144
查看结果:
sysctl -a|grep vm.max_map_count
显示:
vm.max_map_count = 262144
上述方法修改之后,如果重启虚拟机将失效,所以:
解决办法:
在 /etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144
下方有免费书籍的地址,大家可以看看是否对自己有用!
今天的分享就到这里,希望对大家有所帮助
关注 Java有货领取更多资料
联系小编。微信:372787553,带您进群互相学习
左侧小编微信,右侧获取免费资料
技术博客:https://blog.csdn.net/weixin_38937840
免费书籍:https://github.com/Dylan-haiji/Programmer-Learning-materials
SpringCloud学习代码: https://github.com/Dylan-haiji/javayh-cloud
Redis、Mongo、Rabbitmq、Kafka学习代码: https://github.com/Dylan-haiji/javayh-middleware
AlibabaCloud学习代码:https://github.com/Dylan-haiji/javayh-cloud-nacos
SpringBoot+SpringSecurity实现自定义登录学习代码:https://github.com/Dylan-haiji/javayh-distribution