Browse code

ZeroMQ driver to default to redis matchmaker

Switching to the redis matchmaker.

The localhost matchmaker does not presently work.
Also, the localhost matchmaker could not work for
multi-host setups.

Change-Id: I81a26b9af78328e360a18b87371c619e194365d2

Eric Windisch authored on 2013/05/25 00:21:11
Showing 2 changed files
... ...
@@ -153,6 +153,7 @@ You can then run many compute nodes, each of which should have a `stackrc` which
153 153
     MYSQL_HOST=$SERVICE_HOST
154 154
     RABBIT_HOST=$SERVICE_HOST
155 155
     Q_HOST=$SERVICE_HOST
156
+    MATCHMAKER_REDIS_HOST=$SERVICE_HOST
156 157
 
157 158
 # Cells
158 159
 
... ...
@@ -78,11 +78,11 @@ function cleanup_rpc_backend {
78 78
         fi
79 79
     elif is_service_enabled zeromq; then
80 80
         if is_fedora; then
81
-            uninstall_package zeromq python-zmq
81
+            uninstall_package zeromq python-zmq redis
82 82
         elif is_ubuntu; then
83
-            uninstall_package libzmq1 python-zmq
83
+            uninstall_package libzmq1 python-zmq redis-server
84 84
         elif is_suse; then
85
-            uninstall_package libzmq1 python-pyzmq
85
+            uninstall_package libzmq1 python-pyzmq redis
86 86
         else
87 87
             exit_distro_not_supported "zeromq installation"
88 88
         fi
... ...
@@ -115,12 +115,15 @@ function install_rpc_backend() {
115 115
             exit_distro_not_supported "qpid installation"
116 116
         fi
117 117
     elif is_service_enabled zeromq; then
118
+        # NOTE(ewindisch): Redis is not strictly necessary
119
+        # but there is a matchmaker driver that works
120
+        # really well & out of the box for multi-node.
118 121
         if is_fedora; then
119
-            install_package zeromq python-zmq
122
+            install_package zeromq python-zmq redis
120 123
         elif is_ubuntu; then
121
-            install_package libzmq1 python-zmq
124
+            install_package libzmq1 python-zmq redis-server
122 125
         elif is_suse; then
123
-            install_package libzmq1 python-pyzmq
126
+            install_package libzmq1 python-pyzmq redis
124 127
         else
125 128
             exit_distro_not_supported "zeromq installation"
126 129
         fi
... ...
@@ -158,6 +161,11 @@ function iniset_rpc_backend() {
158 158
     local section=$3
159 159
     if is_service_enabled zeromq; then
160 160
         iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_zmq
161
+        iniset $file $section rpc_zmq_matchmaker \
162
+            ${package}.openstack.common.rpc.matchmaker_redis.MatchMakerRedis
163
+        # Set MATCHMAKER_REDIS_HOST if running multi-node.
164
+        MATCHMAKER_REDIS_HOST=${MATCHMAKER_REDIS_HOST:-127.0.0.1}
165
+        iniset $file matchmaker_redis host $MATCHMAKER_REDIS_HOST
161 166
     elif is_service_enabled qpid; then
162 167
         iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_qpid
163 168
         if is_ubuntu; then