ubuntu安装elasticsearch
以下操作在root用户下进行
- 下载安装包
cd /home/elasticsearch && wget https://mirrors.huaweicloud.com/elasticsearch/7.6.2/elasticsearch-7.6.2-linux-x86_64.tar.gz
- 解压
tar -zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz
- config/elasticsearch.yml配置文件中添加
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
- 添加用户
adduser elasticsearch
- 给安装文件夹授权
chown -R elasticsearch /home/elasticsearch
- 给elasticsearch用户操作文件夹权限
chown -R elasticsearch:elasticsearch /home/elasticsearch
- 更改内存权限
sysctl -w vm.max_map_count=262144
- 切换到elasticsearch用户
su elasticsearch
- 后台启动elasticsearch,
./bin/elasticsearch -d
- 添加密码,
./bin/elasticsearch-setup-passwords interactive
不积跬步无以至千里