前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >在centos7上安装Elasticsearch 6

在centos7上安装Elasticsearch 6

作者头像
皇上得了花柳病
发布2020-05-04 21:24:34
5800
发布2020-05-04 21:24:34
举报
文章被收录于专栏:小辰的技术分享

Elasticsearch is a highly scalable open-source full-text search and analytics engine tool which helps you to store, search, and analyze big volumes of data in near real time. In this guide, I’ll show you the steps to install Elasticsearch 6 on CentOS 7 with Kibana to serve as Elastisearch Dashboard. Kibana lets you visualize your Elasticsearch data and navigate the Elastic Stack

How to Install Elasticsearch 6 on CentOS 7

As Elasticsearch depends on Java, you need it installed on your machine prior to installing Elasticsearch 6 on CentOS 7.

代码语言:javascript
复制
sudo yum install java-openjdk-devel java-openjdk

After it is installed, set Java environment variables

代码语言:javascript
复制
cat > /etc/profile.d/java8.sh <<EOF 
export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac)))))
export PATH=\$PATH:\$JAVA_HOME/bin
export CLASSPATH=.:\$JAVA_HOME/jre/lib:\$JAVA_HOME/lib:\$JAVA_HOME/lib/tools.jar
EOF

Add Elasticsearch 6 repository:

代码语言:javascript
复制
cat > /etc/yum.repos.d/elasticsearch.repo <<EOF
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=[https://artifacts.elastic.co/packages/6.x/yum](https://artifacts.elastic.co/packages/6.x/yum)
gpgcheck=1
gpgkey=[https://artifacts.elastic.co/GPG-KEY-elasticsearch](https://artifacts.elastic.co/GPG-KEY-elasticsearch)
enabled=1
autorefresh=1
type=rpm-md
EOF</pre>

Elasticsearch 6 repository is ready for use. You can install Elasticsearch using the command below:

代码语言:javascript
复制
sudo yum install elasticsearch

You can set JVM options like memory limits by editing the file:

代码语言:javascript
复制
/etc/elasticsearch/jvm.options

Start and enable elasticsearch service on boot:

代码语言:javascript
复制
$ sudo systemctl start elasticsearch
$ sudo systemctl enable elasticsearch
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.

Test to verify that it is working:

代码语言:javascript
复制
# curl [http://127.0.0.1:9200](http://127.0.0.1:9200/) {  "name"  :  "z55vMi1", "cluster_name"  :  "elasticsearch", "cluster_uuid"  :  "AdPjPVvWRkOZKC0ADLarXw", "version"  :  {  "number"  :  "6.3.2", "build_flavor"  :  "default", "build_type"  :  "rpm", "build_hash"  :  "053779d", "build_date"  :  "2018-07-20T05:20:23.451332Z", "build_snapshot"  : false, "lucene_version"  :  "7.3.1", "minimum_wire_compatibility_version"  :  "5.6.0", "minimum_index_compatibility_version"  :  "5.0.0"  }, "tagline"  :  "You Know, for Search"  }

Create a test index:

代码语言:javascript
复制
$ curl -X PUT "[http://127.0.0.1:9200/mytest_index](http://127.0.0.1:9200/mytest_index)"
{"acknowledged":true,"shards_acknowledged":true,"index":"mytest_index"}</pre>

Install Kibana on CentOS 7

代码语言:javascript
复制
sudo yum install kibana

After a successful installation, configure Kibana

代码语言:javascript
复制
$ sudo vim /etc/kibana/kibana.yml**
server.host: "0.0.0.0"
server.name: "[kibana.example.com](http://kibana.example.com/)"
elasticsearch.url: "[http://localhost:9200](http://localhost:9200/)"</pre>

Change other settings as desired then start kibana service:

代码语言:javascript
复制
sudo systemctl start kibana
sudo systemctl enable kibana

Access** http://ip-address:5601** to open Kibana Dashboard:

elasticsearch-kibana-centos7-min.png

If you have an active firewall, you’ll need to allow access to Kibana port:

代码语言:javascript
复制
sudo firewall-cmd --add-port=5601/tcp --permanent
sudo firewall-cmd --reload
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档