Category    diversify

Running MDMS and MDMS Diversified using docker

by Walter Rudametkin     docker diversify

Posted 2014.08.23 — Rennes, France

I am just finishing the docker image to run mdms quickly.

To play with it, just pull the following images.

docker pull barais/mdmsredis #contains the redis databases
docker pull barais/mdmssosies #contains the sosies (it is big)
docker pull barais/nginxsosies #contains nginx and the websocket server for displaying connection

To create quickly a cluster of regular mdms worker



<h1>start nginx</h1>

<p>export ID<em>REDIS=$(docker  run -i -d -t barais/mdmsredis /usr/bin/redis-server)
export IP</em>REDIS=<code>docker inspect --format=&#39;{{ .NetworkSettings.IPAddress }}&#39; $ID_REDIS</code> </p>

<h1>start some sosies</h1>

<h1>run just once</h1>

<p>export ID<em>SOSIES=$(docker  run -i -d -t barais/mdmssosies /bin/bash -xec &quot;sed -i &quot;s/$IP</em>REDIS/g&quot; /opt/mdms-ringojs/config.json &amp;&amp; /opt/sosies/ringojs-0.10/bin/ringo /opt/mdms-ringojs/tools/fakedb.js&quot;)</p>

<h1>run for each sosies</h1>

<p>for i in {1..10}
    export ID<em>SOSIES=$(docker  run -i -d -t barais/mdmssosies /bin/bash -xec &quot;sed -i &quot;s/$IP</em>REDIS/g&quot; /opt/mdms-ringojs/config.json &amp;&amp; /opt/sosies/ringojs-0.10/bin/ringo /opt/mdms-ringojs/main.js&quot;)
    export IP<em>SOSIES=`docker inspect --format=&#39;{{ .NetworkSettings.IPAddress }}&#39; $ID</em>SOSIES`
    if [ -z &quot;$IPS<em>WORKER&quot; ]; then export IPS</em>WORKER=$IP<em>SOSIES; else export IPS</em>WORKER=&quot;$IP<em>SOSIES;$IPS</em>WORKER&quot;; fi<br>

<h1>start some nginx and websocket server</h1>

<p>export ID<em>NGINX=$(docker  run -i -d -t barais/nginxsosies /main $IPS</em>WORKER) #you can add a second parameter for the public name of your website e.g.
export IP<em>NGINX=`docker inspect --format=&#39;{{ .NetworkSettings.IPAddress }}&#39; $ID</em>NGINX`
echo $IP_NGINX

To create quickly a cluster of diversified mdms workers:

Read More