install elasticsearch on centos 8
Update your system by running the following command:
sudo dnf update
Add the Elasticsearch repository to your system by running the following command:
sudo rpm –import https://artifacts.elastic.co/GPG-KEY-elasticsearch
sudo vi /etc/yum.repos.d/elasticsearch.repo
Then paste the following content into the file:
[elasticsearch-7.x]
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=1
autorefresh=1
type=rpm-md
Install Elasticsearch by running the following command:
sudo dnf install elasticsearch
Configure Elasticsearch by editing the /etc/elasticsearch/elasticsearch.yml file. You can use the following settings as a starting point:
cluster.name: mycluster
node.name: mynode
network.host: 127.0.0.1
Start and enable Elasticsearch by running the following commands:
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
test:
sudo systemctl status elasticsearch
or
curl -X GET “localhost:9200/”
centos 8