在CentOS7上安装Elasticsearch6.3

总结有关在CentOS7环境中安装Elasticsearch的信息。环境如下:

・CentOS 7.5 (文本操作系统)
・Elasticsearch 6.3 (搜索引擎软件)

将时区更改为JST

# timedatectl set-timezone Asia/Tokyo

JDK 的安装

# yum -y install java-1.8.0-openjdk-devel.x86_64

请参考这个链接,导入PGP密钥并注册Elasticsearch的yum仓库。

# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

# vi /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

安装 Elasticsearch

# yum install -y elasticsearch

服务的启动

# systemctl enable elasticsearch.service
# systemctl start elasticsearch.service

确认启动

# curl localhost:9200
# curl localhost:9200
{
  "name" : "9QZvJ8A",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "fYubptPbRTOzsRpMrg2rjw",
  "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"
}

Kibana的安装适用于可视化。

# yum install -y kibana

更改kibana.yml的配置。

# vi /etc/kibana/kibana.yml
server.host: X.X.X.X    (サーバのローカル IP アドレスを指定)

启动Kibana并进行防火墙配置。

# systemctl enable kibana.service
# systemctl start kibana.service

# firewall-cmd --add-port=5601/tcp --zone=public --permanent
# firewall-cmd --add-service=http --zone=public --permanent
# systemctl restart firewalld

访问Kibana

http://服务器的IP地址:5601/

Kibana.JPG
广告
将在 10 秒后关闭
bannerAds