ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

CentOS 7.8 安装 Elasticsearch 6.8.17

2021-07-20 12:00:19  阅读:243  来源: 互联网

标签:CentOS 17 version elasticsearch build Elasticsearch localhost 6.8


安装环境

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)

检查Java版本

Elasticsearch 要求 Java 8 或以上版本。

[root@localhost ~]# java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
[root@localhost ~]#

新建用户

默认情况下,Elasticsearch 不允许使用 root 用户启动。

groupadd esgroup
useradd esapp -g esgroup

修改资源配置

vi /etc/security/limits.conf
# 在文件中添加下面内容
esapp soft nofile 65535
esapp hard nofile 65535

修改后,需要打开新的终端使之生效。

下载压缩包

cd /opt
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.17.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.17.tar.gz.sha512
shasum -a 512 -c elasticsearch-6.8.17.tar.gz.sha512

解压并修改属主

tar -xzf elasticsearch-6.8.17.tar.gz
chown -R esapp: elasticsearch-6.8.17

修改配置文件

# 切换到之前创建的普通用户
su - esapp
cd /opt/elasticsearch-6.8.17/config
cp elasticsearch.yml elasticsearch.yml.bak
vi elasticsearch.yml

network.host: 192.168.0.1 改为 network.host: 0.0.0.0 并取消注释。以便外部浏览器可以访问。

启动

# 依然使用普通用户
cd /opt/elasticsearch-6.8.17/bin
# 启动
./elasticsearch

检查是否启动成功

打开新的终端,输入下面的命令。

[root@localhost ~]# curl -X GET "localhost:9200/?pretty"
{
  "name" : "h1TMR1i",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "bFtHxxq0RzuWVx0xkW_Z0g",
  "version" : {
    "number" : "6.8.17",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "206f6a2",
    "build_date" : "2021-07-01T18:51:20.391869Z",
    "build_snapshot" : false,
    "lucene_version" : "7.7.3",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
[root@localhost ~]#

在非本地浏览器中访问http://ES所在机器的IP:9200/,正常的话同样也可以得到上面的信息。

相关资料

Installing Elasticsearch

Download Elasticsearch

Important System Configuration

标签:CentOS,17,version,elasticsearch,build,Elasticsearch,localhost,6.8
来源: https://blog.csdn.net/u012666784/article/details/118931577

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有