Distributed representations vs. local representations
August 25, 2019
Django Deployment to Ubuntu 18.04
November 4, 2019
Show all

Up and Running Elasticsearch 7 in Ubuntu

For the Elasticsearch 7 Course:

After logging into your virtual Ubuntu server, use the following commands to install Elasticsearch itself:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

sudo apt-get install apt-transport-https

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" |
sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

sudo apt-get update && sudo apt-get install elasticsearch


Next, edit the Elasticsearch configuration using vi:

sudo vi /etc/elasticsearch/elasticsearch.yml

Uncomment the node.name line (in vi, use the arrow keys to where you want to edit, then hit “i” to enter “insert mode” and make your edits.)

Change network.host to 0.0.0.0, discovery.seed.hosts to [“127.0.0.1”], and cluster.initial_master_nodes to [“node-1”]

When done, hit ESC to exit “insert mode”, then type :wq to write your changes and quit vi.

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service

Elasticsearch is now up and running! Or, it will be in a couple of minutes after everything spins up.

Install the Shakespeare Search Index in Elasticsearch 7:

wget http://media.sundog-soft.com/es7/shakes-mapping.json

curl -H 'Content-Type: application/json' -XPUT 127.0.0.1:9200/shakespeare 
--data-binary @shakes-mapping.json
wget http://media.sundog-soft.com/es7/shakespeare_7.0.json

curl -H 'Content-Type: application/json' -XPOST '127.0.0.1:9200/shakespeare/_bulk?pretty' --data-binary
@shakespeare_7.0.json
curl -H 'Content-Type: application/json' -XGET '127.0.0.1:9200/shakespeare/_search?pretty' -d ' {
"query" : {
"match_phrase" : {
"text_entry" : "to be or not to be"
}
}
}
'
Elasticsearch 7: http://media.sundog-soft.com/es7/ElasticStack7.pdf

Install Kibana

sudo apt-get install kibana
sudo gedit /etc/kibana/kibana.yml
 change server.host to 0.0.0.0
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service
sudo /bin/systemctl start kibana.service

kibana is now available on port 5601

Amir Masoud Sefidian
Amir Masoud Sefidian
Data Scientist, Researcher, Software Developer

Leave a Reply

Your email address will not be published. Required fields are marked *