wzh789 发表于 2019-1-28 14:33:49

Elasticsearch部署

  http://223.202.204.189:5601/app/kibana#/dev_tools/console?_g=()   数据库接口
  http://www.ruanyifeng.com/blog/2017/08/elasticsearch.html 网络笔记
  需要安转jdk:yum install -y java-1.8.0-openjdk
  因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户
  第一步:liunx创建新用户adduser XXX    然后给创建的用户加密码 passwd XXX    输入两次密码。
  第二步:切换刚才创建的用户 su XXX然后执行elasticsearch会显示Permission denied 权限不足。
  第三步:给新建的XXX赋权限,chmod 777 *这个不行,因为这个用户本身就没有权限,肯定自己不能给自己付权限。所以要用root用户登录付权限。
  第四步:root给XXX赋权限,chown -R XXX /你的elasticsearch安装目录。
  然后执行成功。
  报错处理:
  在配置完elasticsearch,启动程序会包如下错误:
  1
  2
  3
  4
  5
  6
  7
  8
  9
  $ ./elasticsearch
  ... ...
  ERROR: bootstrap checks failed
  : max file descriptors for elasticsearch process is too low, increase to at least
  : max number of threads for user is too low, increase to at least : max virtual memory areas vm.max_map_count is too low, increase to at least
  : system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
  ... ...
  1、针对错误、,可以采取如下方式:
  修改/etc/security/limits.conf配置文件:
  1
  2
  3
  4
  5
  6
  7
  # vim /etc/security/limits.conf
  添加如下配置项:
  * - nproc 65535
  * - nofile 409600
  elastic - memlock unlimited
  修改/etc/security/limits.d/90-nproc.conf配置文件:
  1
  2
  3
  4
  5
  6
  # vim /etc/security/limits.d/90-nproc.conf
  修改如下配置项目:
  * soft nproc unlimited
  root soft nproc unlimited  
  修改完成后,重新登录elk账户,查看设置是否生效。
  1
  2
  3
  4
  $ ulimit -n
  409600
  $ ulimit -u
  65535
  2、针对错误,可以采取如下方式:
  修改/etc/sysctl.conf文件配置项:  
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  # vim /etc/sysctl.conf
  # 一个进程可以拥有的VMA(虚拟内存区域)的数量:
  vm.max_map_count=262144
  # 调用虚拟内存的阈值数:
  vm.swappiness=1
  #禁用IPv6
  net.ipv6.conf.all.disable_ipv6 = 1
  net.ipv6.conf.default.disable_ipv6 = 1
  # sysctl -p
  3、针对错误,可以采取如下方式:
  出现错误的原因:是因为centos6.x操作系统不支持SecComp,而elasticsearch 5.5.2默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
  在elasticsearch.yml中添加配置项:bootstrap.system_call_filter为false:
  1
  2
  3
  # ----------------------------------- Memory -----------------------------------
  bootstrap.memory_lock: false
  bootstrap.system_call_filter: false
  查看状态:curl "http://192.168.0.111:9200/health?pretty"
  curl "http://192.168.0.111:9200/statue?pretty"

页: [1]
查看完整版本: Elasticsearch部署