ubuntu安装elasticsearch

以下操作在root用户下进行

  1. 下载安装包 cd /home/elasticsearch && wget https://mirrors.huaweicloud.com/elasticsearch/7.6.2/elasticsearch-7.6.2-linux-x86_64.tar.gz
  2. 解压tar -zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz
  3. config/elasticsearch.yml配置文件中添加
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
  1. 添加用户adduser elasticsearch
  2. 给安装文件夹授权chown -R elasticsearch /home/elasticsearch
  3. 给elasticsearch用户操作文件夹权限chown -R elasticsearch:elasticsearch /home/elasticsearch
  4. 更改内存权限sysctl -w vm.max_map_count=262144
  5. 切换到elasticsearch用户su elasticsearch
  6. 后台启动elasticsearch,./bin/elasticsearch -d
  7. 添加密码,./bin/elasticsearch-setup-passwords interactive
posted @ 2023-11-16 13:53  小小爬虫  阅读(200)  评论(0编辑  收藏  举报