-
Notifications
You must be signed in to change notification settings - Fork 102
Setup ElasticSearch
Blueflood indexes all metric names in Elastic Search (ES). While this is an optional dependency, to get a list of metrics you will need to have Elasticsearch set up.
At the moment, Blueflood is tested to work with Elasticsearch 1.7. Because the instructions for installing this older version of Elasticsearch differ slightly from the process to install the latest version of Elasticsearch, we'll detail the process below.
General information about installing ElasticSearch can be found here:
As mentioned, we will detail the slightly different instructions to install Elasticsearch 1.7:
-
Add Elasticsearch Repo
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - echo "deb http://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-1.7.list
-
Update apt
sudo apt-get update
-
Install apps
sudo apt-get install elasticsearch
-
Start Elasticsearch automatically and start server
sudo update-rc.d elasticsearch defaults 95 10 sudo service elasticsearch start
-
Download and install the public signing key
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
-
Create elasticsearch.repo Add the following in your /etc/yum.repos.d/ directory in a file with a .repo suffix, for example elasticsearch.repo
[elasticsearch-1.7] name=Elasticsearch repository for 1.7 packages baseurl=http://packages.elastic.co/elasticsearch/1.7/centos gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1
-
Install Elasticsearch
yum install elasticsearch
-
Start Elasticsearch automatically and start the server
chkconfig --add elasticsearch
For OSX, we recommend using homebrew (http://brew.sh).
-
Install Elasticsearch
brew update brew install elasticsearch17
-
Start Elasticsearch automatically and start the server
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
-
Run the health check to verify that the service is started and to retrieve the cluster name.
curl -X GET http://localhost:9200/_cluster/health?pretty
Example output:
{ "cluster_name" : "elasticsearch_brew", "status" : "yellow", "timed_out" : false, "number_of_nodes" : 1, "number_of_data_nodes" : 1, "active_primary_shards" : 10, "active_shards" : 10, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 10 }
-
Edit your blueflood.conf file and add the following properties. The cluster name should match the name(cluster_name) from the curl command output above.
ELASTICSEARCH_CLUSTERNAME=<cluster_name>
With the previous example output of the
_cluster/health
API, you would useelasticsearch_brew
for<cluster_name>
. -
Finally, run this script to initialize Blueflood aliases and mappings in Elasticsearch:
blueflood-elasticsearch/src/main/resources/init-es.sh
That should be all you have to do to get Elasticsearch working for Blueflood. If you have any problems, talk to us!