Tuesday, February 7, 2017

Installing ElasticSearch into Ubuntu 16.04 LTS Xenial - easy list of commands

This is an easy to follow how-to and list of commands to install ElasticSearch into Ubuntu 16.04 LTS (xenial) server

Pre-requisites:

apt-get update


Install Java JRE:

apt-get install default-jre


Download & Install Elasticsearch Debian Package (.deb):

cd /usr/local/src

wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.3/elasticsearch-2.3.3.deb

dpkg -i elasticsearch-2.3.3.deb


Enable Elasticsearch Service (to be able to autostart)

systemctl enable elasticsearch.service



DONE - How to use your new ElasticSearch server

Edit configuration file:

nano /etc/elasticsearch/elasticsearch.yml

Default LOG file location:

/var/log/elasticsearch

Default DATA location:

/var/lib/elasticsearch


To Start ElasticSearch:

systemctl start elasticsearch

To Stop ElasticSearch:

systemctl stop elasticsearch

To Check Status of ElasticSearch:

systemctl status elasticsearch

List of commands to install MongoDB 3.2 to Ubuntu 16.04 LTS Xenial

Here are a list of commands that I have executed to install MongoDB into Ubuntu 16.04 LTS Xenial server.


Pre-requisites:


apt install software-properties-common

apt-get update




Add MongoDB repository:


apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
apt-get update




Install MongoDB Server Files:


apt-get install -y mongodb-org


Setup start-up script:


nano /etc/systemd/system/mongodb.service

Insert the following lines of content:

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

Enable start-up script:


systemctl enable mongodb


DONE - how to use your new MongoDB:

Configuration file is located here:
/etc/mongodb.conf

To Start service:
systemctl start mongodb

To Stop service:
systemctl stop mongodb

To Check Status of service:
systemctl status mongodb



MongoDB will start automatically on your next server boot process.


Enjoy! -  if you experience any issue - pls leave me a comment. Thanks