使用yum安装配置ElasticSearch

安装

vim /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

yum install --enablerepo=elasticsearch elasticsearch

配置

vim /etc/elasticsearch/elasticsearch.yml
[cluster.name](http://cluster.name/): my-application  
[node.name](http://node.name/): node-1  
path.data: /var/lib/elasticsearch  
path.logs: /var/log/elasticsearch  
network.host: 127.0.0.1  
http.port: 9200

启动

ElasticSearch不允许root用户执行,新建分组es和用户es,用于执行ElasticSearch

groupadd es
useradd -g es es

修改owner

chown -R es.es /usr/share/elasticsearch /var/lib/elasticsearch /var/log/elasticsearch /etc/sysconfig/elasticsearch /etc/elasticsearch

切换到es用户,然后启动Elasticsearch

su es
/usr/share/elasticsearch/bin/elasticsearch

验证

curl -XGET '127.0.0.1:9200/_cat/health?v&pretty'

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/02/26/install-and-config-elasticsearch-using-yum/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
使用yum安装配置ElasticSearch
安装 vim /etc/yum.repos.d/elasticsearch.repo [elasticsearch] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co……
<<上一篇
下一篇>>
文章目录
关闭
目 录