ElasticSearch – Clustering Setup Procedure

Clustering in EnterMedia is the idea of setting up multiple environments that share specific sets of data (i.e. users, groups, assets). The benefit is that changes made in one environment will be reflected in the others, and any load on the servers are shared as well, resulting in a more optimal efficiency. Clustering is also useful for automatic failover. EnterMedia utlilizes ElasticSearch (http://www.elasticsearch.org/) to implement this.

1. Set up a shared mount of the /WEB-INF/data folder of one server node. And symlink the other /WEB-INF/data to this data. So that both nodes are pointing at the same data directory.

2. Add a Tomcat setting with a unique entermedianodeid in it tomcat/conf/server.xml:

<Context path="/" 
 docBase="${catalina.base}/../webapp" 
 debug="false" 
 reloadable="false" 
 processTlds="false">

<Parameter name="entermedianodeid" 
 value="server101" 
 override="false"/>

3. Edit the node.xml with your cluster name. All nodes should have the same cluster node.  /WEB-INF/node.xml:

<node id="default" name="Default Single Node">
 <property id="cluster.name">emdbcluster1</property>
 <property id="discovery.zen.ping.unicast.hosts">192.168.2.5,192.168.2.6</property>
 <property id="index.mapping._id.indexed">true</property>
 <property id="gateway.fs.snapshot_lock">false</property>
 <property id="path.data">${webroot}/WEB-INF/elastic/${nodeid}/data</property>
 <property id="path.logs">${webroot}/WEB-INF/elastic/${nodeid}/logs</property>
 <property id="path.work">${webroot}/WEB-INF/elastic/${nodeid}/work</property>
 <property id="repo.root.location">${webroot}/WEB-INF/elastic/repos</property> 
</node>

discovery.zen.ping.unicast.hosts should be a comma separated list of IP’s

Note

Entermediadb 9 uses Elastic Search 2.0, that is configured to listen only localhost by default. To allow Elastcsearch to loopback interfaces simultaneously you need to add this extra property to the node.xml file

<property id="network.bind_host">0</property>

4. Make sure that port range of 9200-9300 are open and accessible on each server

5. Enable ElasticSearch for data storage for the system table, create the beans.xml file inside of the configuration folder:

#mkdir -p /opt/entermedia/webapp/system/configuration

#vi /opt/entermedia/webapp/system/configuration/beans.xml

<beans basedatatype="elastic">

</beans>

6. Make your catalog default “/opt/entermedia/webapp/media/catalogs/public/configuration/beans.xml”:

<beans basedatatype="elastic">

</beans>

7. Restart Web Server

#/opt/entermedia/tomcat/bin/shutdown.sh

#/opt/entermedia/tomcat/bin/startup.sh

8. Verify Cluster is running properly

#curl -XGET 'http://{Node_IP}:9200/_cluster/health?pretty=true'

The status should be “green” and there should be a node count of 2.