Elasticsearch is a powerful search engine and analytical platform that allows users to efficiently search and analyze large datasets. Fedora CoreOS is a lightweight, immutable Operating System that is designed for container workloads. In this tutorial, we will show you how to install Elasticsearch on Fedora CoreOS latest.
Before proceeding with this tutorial, you will need:
It is recommended to update the package repository before installing any new packages to ensure that you have the latest versions of software available. Run the following command to update your system:
sudo rpm-ostree upgrade
Elasticsearch requires Java to be installed on the system in order to run. Fedora CoreOS does not come with Java pre-installed, therefore we will need to install it manually. To install Java, run the following command:
sudo rpm-ostree install java-latest-openjdk
Next, we need to download the Elasticsearch package. You can download the package from the official Elasticsearch website. To download the package, execute the following command:
sudo curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.0-linux-x86_64.tar.gz
Once the package has been downloaded, we need to extract its contents:
sudo tar -xvf elasticsearch-7.15.0-linux-x86_64.tar.gz
By default, Elasticsearch runs with a configuration that is suitable for development purposes, but not for production. We need to update the Elasticsearch configuration to ensure that it runs optimally on our system.
Open the Elasticsearch configuration file in a text editor:
sudo vi elasticsearch-7.15.0/config/elasticsearch.yml
Update the configuration file settings based on your requirements. Here are some important settings that you may want to change:
cluster.name
: By default, this setting is set to elasticsearch
. Change this to a unique name that will be used to identify your Elasticsearch cluster.network.host
: By default, Elasticsearch is configured to bind to the localhost interface. You may want to change this to the IP address of the network interface on which Elasticsearch should be bound.http.port
: By default, this setting is set to 9200
. You may want to change this setting to a port of your choice.Save the configuration file and exit the text editor.
We are now ready to start Elasticsearch:
cd elasticsearch-7.15.0
sudo ./bin/elasticsearch
You should see some output indicating that Elasticsearch is starting up. Once Elasticsearch has started successfully, you can access its REST API at http://localhost:9200
.
By default, Elasticsearch does not start automatically when the system boots up. We can enable it to do so by creating a systemd service file.
Create the elasticsearch.service
file using the following command:
sudo vi /etc/systemd/system/elasticsearch.service
Paste the following content into the file and save it:
[Unit]
Description=Elasticsearch
After=network-online.target
[Service]
User=root
WorkingDirectory=/var/lib/elasticsearch
LimitNOFILE=65536
ExecStart=/opt/elasticsearch-7.15.0/bin/elasticsearch
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
Reload the systemd service files and enable the Elasticsearch service to start at boot:
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch
Congratulations, you have successfully installed Elasticsearch on Fedora CoreOS latest. You should now be able to access the Elasticsearch REST API and start working with your data. For more information on Elasticsearch, please refer to the official Elasticsearch documentation.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!