Elasticsearch 7在CentOS Linux 8下的基础安装学习

使用DNF安装Elasticsearch

配置Elasticsearch的yum源

# vi /etc/yum.repos.d/elasticsearch.repo

输入下面的代码

[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md 

开始安装

# dnf -y install --enablerepo=elasticsearch elasticsearch

配置服务

# systemctl enable elasticsearch
# systemctl stop elasticsearch
# systemctl start elasticsearch
# systemctl restart elasticsearch

测试访问

# curl -X GET localhost:9200

输出类似以下内容:

{
  "name" : "hadoop240",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "_GzcatiqTdafEddZyfIJfQ",
  "version" : {
    "number" : "7.6.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "7f634e9f44834fbc12724506cc1da681b0c3b1e3",
    "build_date" : "2020-02-06T00:09:00.449973Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

ip访问、外网访问、修改端口

# vi /etc/elasticsearch/elasticsearch.yml

相关内容修改如下:

path.data: /data/elasticsearch
path.logs: /log/elasticsearch
network.host: 192.168.1.240
discovery.seed_hosts: ["192.168.1.240:9200"]

目录相关配置:

# mkdir -p /data/elasticsearch
# mkdir -p /log/elasticsearch
# chown  -R elasticsearch:elasticsearch /data/elasticsearch
# chown  -R elasticsearch:elasticsearch  /log/elasticsearch

修改完了重启服务

# systemctl restart elasticsearch
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值