{"id":129,"date":"2023-07-31T15:52:05","date_gmt":"2023-07-31T15:52:05","guid":{"rendered":"http:\/\/192.168.0.142\/?p=129"},"modified":"2023-08-03T05:06:28","modified_gmt":"2023-08-03T05:06:28","slug":"installation-of-elastic-search-and-kibana-on-ubuntu-22-04","status":"publish","type":"post","link":"http:\/\/192.168.0.142\/installation-of-elastic-search-and-kibana-on-ubuntu-22-04\/","title":{"rendered":"Elasticsearch and Kibana installation on Ubuntu 22.04"},"content":{"rendered":"\n
Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine\u2011tuned relevancy, and powerful analytics that scale with ease.<\/p>\n\n\n\n
This post will guide you through installation and configuration of Elasticsearch and Kibana.<\/p>\n\n\n\n
Update package index files<\/strong><\/p>\n\n\n\n Install dependencies<\/strong><\/p>\n\n\n\n Import the Elasticsearch PGP Key<\/strong><\/p>\n\n\n\n Add the Elastic source list to the sources.list.d directory, where apt will search for new sources:<\/strong><\/p>\n\n\n\n Install elasticsearch<\/strong><\/p>\n\n\n\n Enable Elasticsearch service<\/strong><\/p>\n\n\n\n Elasticsearch can be started as follows<\/strong><\/p>\n\n\n\n To stop Elasticsearch run below command<\/strong><\/p>\n\n\n\n To list journal entries for the Elasticsearch service run below command<\/strong><\/p>\n\n\n\n You should see similar output as below in the console<\/strong><\/p>\n\n\n\n To reset password of Elasticsearch run below command<\/strong><\/p>\n\n\n\n You should see output similar to below in the console<\/strong><\/p>\n\n\n\n To Check Elasticsearch is up and running run below command<\/strong><\/p>\n\n\n\n You should see output similar to below after entering the password<\/strong><\/p>\n\n\n\n Install kibana by running below command<\/strong><\/p>\n\n\n\n Make below changes in \/etc\/elasticsearch\/elasticsearch.yml to allow connection from kibana. Edit the file and uncomment\/edit lines.<\/p>\n\n\n\n Restart Elasticsearch service<\/strong><\/p>\n\n\n\n Make below changes in \/etc\/kibana\/kibana.yml to configure kibana.<\/p>\n\n\n\n For e.g., <\/strong><\/p>\n\n\n\n Restart kibana<\/strong><\/p>\n\n\n\n Access host ip:5601 (for e.g http:\/\/192.168.0.183:5601\/) in a browser to configure Kibana with Elasticsearch. <\/strong><\/p>\n\n\n\nsudo apt update<\/code><\/pre>\n\n\n\n
sudo apt-get install apt-transport-https<\/code><\/pre>\n\n\n\n
wget -qO - https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch | sudo gpg --dearmor -o \/usr\/share\/keyrings\/elasticsearch-keyring.gpg<\/code><\/pre>\n\n\n\n
echo \"deb [signed-by=\/usr\/share\/keyrings\/elasticsearch-keyring.gpg] https:\/\/artifacts.elastic.co\/packages\/8.x\/apt stable main\" | sudo tee \/etc\/apt\/sources.list.d\/elastic-8.x.list<\/code><\/pre>\n\n\n\n
Elasticsearch Installation<\/h3>\n\n\n\n
sudo apt update && sudo apt install elasticsearch<\/code><\/pre>\n\n\n\n
sudo systemctl daemon-reload\nsudo systemctl enable elasticsearch.service<\/code><\/pre>\n\n\n\n
sudo systemctl start elasticsearch.service<\/code><\/pre>\n\n\n\n
sudo systemctl stop elasticsearch.service<\/code><\/pre>\n\n\n\n
journalctl --unit elasticsearch<\/code><\/pre>\n\n\n\n
$ journalctl --unit elasticsearch\nAug 01 11:34:36 abb systemd[1]: Starting Elasticsearch...\nAug 01 11:34:49 abb systemd[1]: Started Elasticsearch.<\/code><\/pre>\n\n\n\n
sudo \/usr\/share\/elasticsearch\/bin\/elasticsearch-reset-password -u elastic<\/code><\/pre>\n\n\n\n
$ sudo \/usr\/share\/elasticsearch\/bin\/elasticsearch-reset-password -u elastic\nThis tool will reset the password of the [elastic] user to an autogenerated value.\nThe password will be printed in the console.\nPlease confirm that you would like to continue [y\/N]y\n\n\nPassword for the [elastic] user successfully reset.\nNew value: D5SQMkZ*I_m5qCVAFHQE<\/code><\/pre>\n\n\n\n
curl -k -u elastic https:\/\/localhost:9200<\/code><\/pre>\n\n\n\n
$ curl -k -u elastic https:\/\/localhost:9200\nEnter host password for user 'elastic':\n{\n \"name\" : \"abb\",\n \"cluster_name\" : \"elasticsearch\",\n \"cluster_uuid\" : \"bD_SCK32SYinR79L6SbagQ\",\n \"version\" : {\n \"number\" : \"8.8.2\",\n \"build_flavor\" : \"default\",\n \"build_type\" : \"deb\",\n \"build_hash\" : \"98e1271edf932a480e4262a471281f1ee295ce6b\",\n \"build_date\" : \"2023-06-26T05:16:16.196344851Z\",\n \"build_snapshot\" : false,\n \"lucene_version\" : \"9.6.0\",\n \"minimum_wire_compatibility_version\" : \"7.17.0\",\n \"minimum_index_compatibility_version\" : \"7.0.0\"\n },\n \"tagline\" : \"You Know, for Search\"\n}<\/code><\/pre>\n\n\n\n
Kibana Installation<\/h3>\n\n\n\n
sudo apt install kibana<\/code><\/pre>\n\n\n\n
http.port: 9200\nnetwork.host: 0.0.0.0<\/code><\/pre>\n\n\n\n
sudo systemctl restart elasticsearch<\/code><\/pre>\n\n\n\n
server.port: 5601\nserver.host: \"X.X.X.X\" (Kibana server's IP address)<\/code><\/pre>\n\n\n\n
server.port: 5601\nserver.host: \"192.168.0.183\"<\/code><\/pre>\n\n\n\n
sudo systemctl restart kibana.service <\/code><\/pre>\n\n\n\n