Elasticsearch

RedHat6.4安装Elasitcsearch5.2.0

2017-04-04  本文已影响140人  mvpboss1004

RedHat6.4安装配置Elasitcsearch5.2.0

elastic的5.2.0版本最近刚刚发布,相比之前版本变动很大,而且其中的所有组件(包括Elasticsearch、Kibana、X-Pack等)都统一到了5.2.0版本。为避免兼容性问题,建议所有组件都使用5.2.0版本。
本文使用环境:elastic 5.2.0套件+RedHat 6.4 64bit,也适用于CentOS。

1. 下载安装

官网提供了多种安装方式以及详细的安装步骤,这里建议采用下载安装包离线安装的方式,下载链接为:elasticsearch-5.2.0.rpm。原因:

下载完成后,rpm -i elasticsearch-5.2.0.rpm即可安装。

2. 配置

建议修改如下配置。Elasticsearch的日志信息记录在/var/log/elasticsearch下,以集群名开头的文件。如果启动失败,可以查看日志查找原因。

2.1 /etc/security/limits.conf

修改以下选项:

* soft nofile 65536
* hard nofile 65536

否则会报以下错误:

bootstrap checks failed
max file descriptors [5000] for elasticsearch process is too low, increase to at least [65536]

2.2 /etc/elasticsearch/elasticsearch.yml

java.lang.IllegalStateException: Failed to created node environment
...
...
Caused by: java.nio.file.AccessDeniedException: /opt/app/data/elasticsearch/nodes
bootstrap checks failed
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

2.3 /etc/elasticsearch/jvm.options

3. 启动服务

建议以服务形式启动:

chkconfig --add elasticsearch
service elasticsearch start

启动成功后,访问http://99.1.36.164:9200,即可打开页面。

4. 使用X-Pack插件

X-Pack插件提供了访问控制、加密、监控等多个功能,强烈建议在生产环境中使用X-Pack插件。下载链接为:x-pack-5.2.0.zip
假如下载在/root/x-pack-5.2.0.zip,安装很简单:

service elasticsearch stop
/usr/share/elasticsearch/bin/elasticsearch-plugin install file:///root/x-pack-5.2.0.zip
service elasticsearch start

再次访问http://99.1.36.164:9200,默认用户名elastic,密码changeme。可以通过以下方式修改:

curl -XPUT -u elastic '99.1.36.164:9200/_xpack/security/user/elastic/_password' -d '{
  "password" : "your_passwd"
}'

未注册的X-Pack只有15天试用期,访问以下链接注册一个Basic license,可以获得一年的试用期:Registration
下载license文件并导入:

curl -XPUT -u elastic 'http://99.1.36.164:9200/_xpack/license?acknowledge=true' -d @license.json
上一篇 下一篇

猜你喜欢

热点阅读