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="/" 

<Parameter name="entermedianodeid" 

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">,</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> 

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


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.

For Docker instances you need to enable internal communications for those ports in the internal firewall in both instances:

iptables -t nat -A DOCKER -p tcp --dport 9200 -j DNAT --to-destination
iptables -t nat -A DOCKER -p tcp --dport 9300 -j DNAT --to-destination

For old instalation not based on ElasticSearch, you first need to enable it:
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">

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

<beans basedatatype="elastic">

5. Restart EnterMedia



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.