[Moxi 1.8] What is the good way to start multiple Moxi service (/etc/init.d/moxi-server) proxying to distinct couchbase Buckets
We are running multiple node.js servers connecting to 4 distinct buckets on the same Couhbase 2.0 cluster (3 nodes)
All the servers (node.js and couchbase) a running on Amazon Linux (RedHat/CentOS 6 like)
After a quick bench we had to give up with couchnode SDK for due to performance issues
We are now using node-memcache and client side Moxi 1.8 on each node.js server
We start 4 different Moxi listenning on 4 local distinct ports, each of them forwarding memcahed operations from node.js to the associated Bucket (and to the appropriate vBucket in the cluster)
Here is an example of the command we use to start those 4 distincts moxy :
/opt/moxi/bin/moxi -u zbo -Z port_listen=11215 http://couch1:8091/pools/default/bucketsStreaming/bucket1,http://couch2:...
/opt/moxi/bin/moxi -u zbo -Z port_listen=11216 http://couch1:8091/pools/default/bucketsStreaming/bucket2,http://couch2:...
/opt/moxi/bin/moxi -u zbo -Z port_listen=11217 http://couch1:8091/pools/default/bucketsStreaming/bucket3, http://couch2:8091/pools/default/bucketsStreaming/bucket3
/opt/moxi/bin/moxi -u zbo -Z port_listen=11218 http://couch1:8091/pools/default/bucketsStreaming/bucket4,http://couch2:...
The question :
What is the good/best way to start multiple Moxi as a linux service (using /etc/init.d/moxi-server or any other solution) so that :
- we can be sure it would restart at the appropriate run level after an instance reboot,
- we could use a service process monitoring tool like monit or upstart to restart/respawn in case of a failing moxy
We can see in the "moxi-manual-1.8.pdf" section "8.4.4. Multi-cluster configuration" that :
The multi-pool codepaths are also overloaded and re-used to support multi-tenancy (multiple buckets).
But we are not sure how to use this for couchbase 2.0 buckets and cluster discovery.
Could this example work for 2 buckets (Assuming we still want to have 4x2 worker threads) :
moxi -t 8 -Z "port_listen=11215; port_listen=11216" -z "http://couch1:8091/pools/default/bucketsStreaming/bucket1,http://couch2:8091/pools/default/bucketsStreaming/bucket1;http://couch1:8091/pools/default/bucketsStreaming/bucket2,http://couch2:8091/pools/default/bucketsStreaming/bucket2"
What monitoring/restart Moxi tool do you recommend ?