linux安装elasticsearch(单实例)及遇到的各种问题

1.获取elasticsearch

https://www.elastic.co/downloads/elasticsearch

终端输入赋值的下载链接进行下载

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz

2.解压文件

tar -zxvf elasticsearch-6.3.2.tar.gz

3.启动

#这是前台启动,Ctrl+c可以停止
sh ./bin/elasticsearch
#这是后台启动
sh ./bin/elasticsearch -d

效果

可能遇到的问题及注意事项

1.默认情况下,Elastic 只允许本机访问,如果需要远程访问,可以修改 Elastic 安装目录的config/elasticsearch.yml文件,去掉network.host的注释,将它的值改成0.0.0.0,然后重新启动 Elastic。

network.host: 0.0.0.0

2.不允许root启动

网上很多讲讲个用户组再授权路径啥的,我是采用的直接给普通用户授权的方式,然后就可以使用被授权的用户启动了

修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:

## Allow root to run any commands anywhere
root    ALL=(ALL)     ALL
zl    ALL=(ALL)     ALL

3.执行了启动命令但是没有成功启动,提示:Native controller process has stopped - no new native processes can be started

解决方法

修改三个配置文件,*代表所有用户

vi /etc/security/limits.conf
#添加配置
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
vi /etc/security/limits.d/90-nproc.conf
#添加配置
* soft nproc 4096
vi /etc/sysctl.conf 
#添加配置
vm.max_map_count=655360

猜你喜欢

转载自www.cnblogs.com/cnsdhzzl/p/9401829.html