RedHat6.4安装Elasitcsearch5.2.0
来源:互联网 发布:网络调试助手cm精装版 编辑:程序博客网 时间:2024/06/05 20:09
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。原因:
- 国内到官网的网速奇慢无比,而现实中elasitc往往要部署在多台服务器上,采用yum的方式安装每装一台都要花很长时间;
- 生产环境中,服务器往往不允许访问外网。
下载完成后,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 failedmax file descriptors [5000] for elasticsearch process is too low, increase to at least [65536]
2.2 /etc/elasticsearch/elasticsearch.yml
cluster.name: CThun
:集群名,可修改为业务系统的名字。node.name: ${HOSTNAME}
:节点名,建议修改为引用主机名以便于进行标识,同时可以保持各节点配置的一致性。path.data: /opt/app/data/elasticsearch
:数据存放路径,由于数据量非常大,建议放到专用的分区及文件夹,这里是个例子。
另外,elasticsearch安装时会新建elasticsearch用户,并以此用户启动服务,所以不要忘了给此用户授权:chown -R elasticsearch /opt/app/data/elasticsearch
否则会报以下错误:
java.lang.IllegalStateException: Failed to created node environment......Caused by: java.nio.file.AccessDeniedException: /opt/app/data/elasticsearch/nodes
network.host: 0.0.0.0
:绑定端口,默认为localhost,建议改为0.0.0.0,否则其他机器无法访问到该机器。discovery.zen.ping.unicast.hosts: ["99.1.36.164"]
:master节点清单。bootstrap.system_call_filter: false
:系统调用过滤器,建议禁用该项检查,因为很多检查项需要Linux 3.5以上的内核,而市面上大多数的Linux发行版都未使用Linux 3.5。否则会报以下错误:
bootstrap checks failedsystem 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
#-XX:+HeapDumpOnOutOfMemoryError
:注释掉该选项,否则每次内存溢出都会生成一个巨大的内存文件#-XX:HeapDumpPath=/tmp
:如果不想取消上述选项,可以在这里将其设置为存放在临时文件夹,便于清理
3. 启动服务
建议以服务形式启动:
chkconfig --add elasticsearchservice 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.zipservice 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
0 0
- RedHat6.4安装Elasitcsearch5.2.0
- RedHat6.4安装Kibana5.2.0
- redhat6.4 安装codeblocks
- redhat6.4安装nginx
- redhat6.4简便安装yum
- redhat6.4安装was6.1
- Redhat6.4静默安装Oracle11g
- RedHat6.4 rpm 安装telnet
- redhat6.4下安装Oracle11g
- Redhat6.4安装ora11g数据库
- redhat6.4_LVS_install安装文档
- RedHat6.4(64bit)安装JDK
- icinga源码安装-基于redhat6.4
- Oracle 11g Linux 安装 redhat6.4
- RedHat6.4安装Oracle11g 11.2.0.4
- redhat6.4 安装FastDFS5.03、5.05
- redhat6.4 64安装qt5.0.run
- 在redhat6.4安装redis集群
- 【Python】实现网站备份文件扫描+源码分析
- MxNet系列——get_started——setup
- LeetCode9. Palindrome Number(Python)兼翻译
- 使用json_decode()的一些小积累
- MaltReport2:基于 OpenDocument-OpenOfficeXML 的开源报表引擎
- RedHat6.4安装Elasitcsearch5.2.0
- js高级程序设计笔记10--canvas绘图
- android 坐标系
- oracle起定时任务,每隔1秒执行一次
- redis实现商城中的秒杀并发问题思路
- 编译安装及运行单目ORBSLAM2在Ubuntu14.04
- 护眼配色方案.bat
- Qt之QThreadPool和QRunnable
- 安卓搭建nexus私服-4.nexus仓库下拉到androidstudio中项目