CentOS 7.3 安装ElasticSearch5.6.1步骤
2017-09-21 16:58
501 查看
1.准备并安装好CentOS系统(本文是在Vmware下安装,配置的硬件信息是双核4G内存),下载链接如下:
CentOS: https://www.centos.org/download/
2.用户设置,如果当前默认登录root用户,需要创建一个普通用户(ES5.x以后版本不支持root下启动):
添加用户es,所属root组密码test123
>useradd es -g root -p test123
3. 下载ElasticSearch包,链接如下:
>wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.1.zip
>unzip elasticsearch-5.6.1.zip
4.解压elasticsearch-5.6.1.zip至/home/es/目录下,并给目录elasticsearch-5.6.1赋es权限
>chown -R es:root elasticsearch-5.6.1
5.安装java:
>yum install java -y
6.在root用户下操作:
>vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
保存退出.
>vim /etc/security/limits.d/20-nproc.conf
修改如下内容:
* soft nproc 4096
#修改为
* soft nproc 2048
修改配置sysctl.conf
>vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
>sysctl -p
修改yml配置文件:
> vim config/elasticsearch.yml
修改bind address:
network.host: 0.0.0.0
6.启动es:
>cd /home/es/elasticsearch-5.6.1/
>su es
> ./bin/elasticsearch
显示如下信息说明安装成功:
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[aggs-matrix-stats]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [ingest-common]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[lang-expression]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [lang-groovy]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [lang-mustache]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [lang-painless]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [parent-join]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [percolator]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [reindex]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[transport-netty3]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[transport-netty4]
[2017-09-21T01:26:28,878][INFO ][o.e.p.PluginsService ] [9dhujIO] no plugins loaded
[2017-09-21T01:26:30,574][INFO ][o.e.d.DiscoveryModule ] [9dhujIO] using discovery type [zen]
[2017-09-21T01:26:31,258][INFO ][o.e.n.Node ] initialized
[2017-09-21T01:26:31,258][INFO ][o.e.n.Node ] [9dhujIO] starting ...
[2017-09-21T01:26:31,455][INFO ][o.e.t.TransportService ] [9dhujIO] publish_address {127.0.0.1:9300},bound_addresses {127.0.0.1:9300}
[2017-09-21T01:26:31,467][WARN ][o.e.b.BootstrapChecks ] [9dhujIO] max file descriptors [4096] forelasticsearch process is too low, increase to at least [65536]
[2017-09-21T01:26:34,555][INFO ][o.e.c.s.ClusterService ] [9dhujIO] new_master{9dhujIO}{9dhujIOFR9-vaVR2ZLjhSw}{iN4sZh8PRdmOrDvUir7pXQ}{127.0.0.1}{127.0.0.1:9300},reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-09-21T01:26:34,646][INFO ][o.e.g.GatewayService ] [9dhujIO] recovered [0] indices intocluster_state
[2017-09-21T01:26:34,649][INFO][o.e.h.n.Netty4HttpServerTransport] [9dhujIO] publish_address{127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2017-09-21T01:26:34,649][INFO ][o.e.n.Node ] [9dhujIO] started
7.用curl检查是否连接成功或浏览器连接http://localhost:9200:
>curl localhost:9200
{
"name" :"9dhujIO",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "PeP7JMg7R9mAvU6suUPJNw",
"version": {
"number": "5.6.1",
"build_hash" : "667b497",
"build_date" : "2017-09-14T19:22:05.189Z",
"build_snapshot" : false,
"lucene_version" : "6.6.1"
},
"tagline": "You Know, for Search"
}
8.设置防火墙端口9200,9300例外:
>systemctl start firewalld.service
>systemctl enable firewalld.service
>systemctl status firewalld.service
>firewall-cmd --permanent --add-port={9200/tcp,9300/tcp}
>firewall-cmd --reload
>firewall-cmd --state
>firewall-cmd --list-all
9. 配置ElasticSearch后台运行
>./bin/elasticsearch -d
若启动出现错误根据信息去度娘或谷哥搜一下吧 ,好运~~
CentOS: https://www.centos.org/download/
2.用户设置,如果当前默认登录root用户,需要创建一个普通用户(ES5.x以后版本不支持root下启动):
添加用户es,所属root组密码test123
>useradd es -g root -p test123
3. 下载ElasticSearch包,链接如下:
>wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.1.zip
>unzip elasticsearch-5.6.1.zip
4.解压elasticsearch-5.6.1.zip至/home/es/目录下,并给目录elasticsearch-5.6.1赋es权限
>chown -R es:root elasticsearch-5.6.1
5.安装java:
>yum install java -y
6.在root用户下操作:
>vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
保存退出.
>vim /etc/security/limits.d/20-nproc.conf
修改如下内容:
* soft nproc 4096
#修改为
* soft nproc 2048
修改配置sysctl.conf
>vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
>sysctl -p
修改yml配置文件:
> vim config/elasticsearch.yml
修改bind address:
network.host: 0.0.0.0
6.启动es:
>cd /home/es/elasticsearch-5.6.1/
>su es
> ./bin/elasticsearch
显示如下信息说明安装成功:
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[aggs-matrix-stats]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [ingest-common]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[lang-expression]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [lang-groovy]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [lang-mustache]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [lang-painless]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [parent-join]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [percolator]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module [reindex]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[transport-netty3]
[2017-09-21T01:26:28,877][INFO ][o.e.p.PluginsService ] [9dhujIO] loaded module[transport-netty4]
[2017-09-21T01:26:28,878][INFO ][o.e.p.PluginsService ] [9dhujIO] no plugins loaded
[2017-09-21T01:26:30,574][INFO ][o.e.d.DiscoveryModule ] [9dhujIO] using discovery type [zen]
[2017-09-21T01:26:31,258][INFO ][o.e.n.Node ] initialized
[2017-09-21T01:26:31,258][INFO ][o.e.n.Node ] [9dhujIO] starting ...
[2017-09-21T01:26:31,455][INFO ][o.e.t.TransportService ] [9dhujIO] publish_address {127.0.0.1:9300},bound_addresses {127.0.0.1:9300}
[2017-09-21T01:26:31,467][WARN ][o.e.b.BootstrapChecks ] [9dhujIO] max file descriptors [4096] forelasticsearch process is too low, increase to at least [65536]
[2017-09-21T01:26:34,555][INFO ][o.e.c.s.ClusterService ] [9dhujIO] new_master{9dhujIO}{9dhujIOFR9-vaVR2ZLjhSw}{iN4sZh8PRdmOrDvUir7pXQ}{127.0.0.1}{127.0.0.1:9300},reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-09-21T01:26:34,646][INFO ][o.e.g.GatewayService ] [9dhujIO] recovered [0] indices intocluster_state
[2017-09-21T01:26:34,649][INFO][o.e.h.n.Netty4HttpServerTransport] [9dhujIO] publish_address{127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2017-09-21T01:26:34,649][INFO ][o.e.n.Node ] [9dhujIO] started
7.用curl检查是否连接成功或浏览器连接http://localhost:9200:
>curl localhost:9200
{
"name" :"9dhujIO",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "PeP7JMg7R9mAvU6suUPJNw",
"version": {
"number": "5.6.1",
"build_hash" : "667b497",
"build_date" : "2017-09-14T19:22:05.189Z",
"build_snapshot" : false,
"lucene_version" : "6.6.1"
},
"tagline": "You Know, for Search"
}
8.设置防火墙端口9200,9300例外:
>systemctl start firewalld.service
>systemctl enable firewalld.service
>systemctl status firewalld.service
>firewall-cmd --permanent --add-port={9200/tcp,9300/tcp}
>firewall-cmd --reload
>firewall-cmd --state
>firewall-cmd --list-all
9. 配置ElasticSearch后台运行
>./bin/elasticsearch -d
若启动出现错误根据信息去度娘或谷哥搜一下吧 ,好运~~
相关文章推荐
- centos7下elasticsearch安装以及elasticsearch的中文分词插件ik的安装步骤
- 阿里云CentOS 7.3安装Redis3.2.6详细步骤
- 阿里云CentOS 7.3安装Redis3.2.6详细步骤(自己有修改)
- 最小化安装 CentOS 7.3 部署 Cacti-1.1.23 详细步骤
- Centos7.3安装Zabbix3.2(Yum详细步骤)
- linux安装步骤(CentOS 7.3)
- centos安装Elasticsearch步骤
- 安装MySQL先复制1. Linux (CentOS 7.3) 下快速安装Mysql数据库(安装教程)2.后复制阿里云配置 MySQL 远程连接的详细步骤
- 【080】centos7.3安装docker步骤
- 阿里云CentOS 7.3安装Redis3.2.6详细步骤
- Linux(CentOS7.3)使用yum安装MySQL详细步骤
- centos7下elasticsearch安装以及elasticsearch的中文分词插件ik的安装步骤
- R for Centos安装步骤
- CentOS 7.3 中安装 JDK 及环境变量配置
- Elasticsearch5、Elasticsearch-head安装步骤
- centos7.3 编译安装lamp,利用wordpress实现个人博客搭建
- Centos6.5下Elasticsearch5.2.1及head插件的安装(实践成功)
- centos7.3 安装redis
- 阿里云服务器配置开发环境第三章:Centos7.3安装Tomcat8以及环境配置
- GemFire 入门篇2:GemFire 8.2 在CentOS & Mac OS X的安装步骤