频道栏目
首页 > 资讯 > Linux > 正文

Centos7.3服务器下elasticsearch5.5安装方法

18-06-11        来源:[db:作者]  
收藏   我要投稿

Centos7.3服务器下elasticsearch5.5安装方法。

第一步:必须要有jre支持

elasticsearch是用Java实现的,跑elasticsearch必须要有jre支持,所以必须先安装jre

可以参考 我前面的教程

第二步:下载elasticsearch

进入官方下载https://www.elastic.co/downloads/elasticsearch

因为是centos中运行 所以我们选 tar.gz压缩包;

下载后上传到/developer/setup下

第三步:配置elasticsearch

解压

剪切文件到/developer目录

启动elasticsearch

由于elasticsearch5.0默认分配jvm空间大小为2g,修改jvm空间分配

[root@iZwz92t5qpn97tcgtdd9y3Z developer]# cd elasticsearch-5.5.2/

[root@iZwz92t5qpn97tcgtdd9y3Z elasticsearch-5.5.2]# cd config

[root@iZwz92t5qpn97tcgtdd9y3Z config]# vim jvm.options

修改为

再次启动出现

意思是不能用root用户来启动,那我们新建一个用户来启动

[root@bogon ~]# useradd elastic

[root@bogon ~]# chown -R elastic:elastic /home/es/elasticsearch-5.5.2/

新建elastic用户 并且把目录权限赋予给elastic

我们切换成elastic用户,然后执行

[root@bogon ~]# su elastic

[elastic@bogon root]$ sh /home/es/elasticsearch-5.5.2/bin/elasticsearch

最后启动可以我们可以验证 curlhttp://localhost:9200

[elastic@bogon root]$ curl http://localhost:9200

{

"name" : "K22mJd5",

"cluster_name" : "elasticsearch",

"cluster_uuid" : "R2qfXKtrQl2PwKdJMmPuMA",

"version" : {

"number" : "5.5.2",

"build_hash" : "b2f0c09",

"build_date" : "2017-08-14T12:33:14.154Z",

"build_snapshot" : false,

"lucene_version" : "6.6.0"

},

"tagline" : "You Know, for Search"

}

出来这个 说明配置OK。

第四步:允许外网连接配置

前面我们配置的仅仅是本机使用 但是我们比如集群以及其他机器连接 ,则需要配置下。

可以修改 /developer/elasticsearch/config/elasticsearch.yml 文件

network.host: 0.0.0.0

http.port: 9200

修改后 保存退出

再启动下elasticsearch

我们用谷歌浏览器请求下http://192.168.1.108:9200/

OK 出现这东西 才算配置完成;

相关TAG标签
上一篇:centos7之yum安装lnmp
下一篇:VMware关于三种网络连接方式的区别介绍
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站