Questo contenuto non è disponibile nella lingua selezionata.
8.6.2. Configuring the Sample Routing Plug-In
Procedure 8.18. To Enable and Configure the Sample Routing Plug-in:
- Add a new user, topic, and queue to ActiveMQ. On each ActiveMQ broker, edit the
/etc/activemq/activemq.xml
file and add the following line within the<users>
section, replacingroutinginfopasswd
with your own password:<authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/>
<authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 8.14. Example <users> Section
<users> <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/> <authenticationUser username="admin" password="secret" groups="mcollective,admin,everyone"/> <authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/> </users>
<users> <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/> <authenticationUser username="admin" password="secret" groups="mcollective,admin,everyone"/> <authenticationUser username="routinginfo" password="routinginfopasswd" groups="routinginfo,everyone"/> </users>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the following lines within the
<authorizationEntries>
section:<authorizationEntry topic="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" /> <authorizationEntry queue="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" />
<authorizationEntry topic="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" /> <authorizationEntry queue="routinginfo.>" write="routinginfo" read="routinginfo" admin="routinginfo" />
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 8.15. Example <authorizationEntries> Section
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the following lines within the
<plugins>
section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the
schedulerSupport="true"
directive within the<broker>
section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the
activemq
service:service activemq restart
# service activemq restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the broker host, verify that the rubygem-openshift-origin-routing-activemq package is installed:
yum install rubygem-openshift-origin-routing-activemq
# yum install rubygem-openshift-origin-routing-activemq
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
/etc/openshift/plugins.d/openshift-origin-routing-activemq.conf.example
file to/etc/openshift/plugins.d/openshift-origin-routing-activemq.conf
:cp /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf.example /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf
# cp /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf.example /etc/openshift/plugins.d/openshift-origin-routing-activemq.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
/etc/openshift/plugins.d/openshift-origin-routing-activemq.conf
file and ensure theACTIVEMQ_HOST
andACTIVEMQ_PORT
parameters are set appropriately for your ActiveMQ broker. Set theACTIVEMQ_PASSWORD
parameter to the password chosen for theroutinginfo
user:Example 8.16. Example Routing Plug-in Configuration File
ACTIVEMQ_TOPIC='/topic/routinginfo' ACTIVEMQ_USERNAME='routinginfo' ACTIVEMQ_PASSWORD='routinginfopasswd' ACTIVEMQ_HOST='127.0.0.1' ACTIVEMQ_PORT='61613'
ACTIVEMQ_TOPIC='/topic/routinginfo' ACTIVEMQ_USERNAME='routinginfo' ACTIVEMQ_PASSWORD='routinginfopasswd' ACTIVEMQ_HOST='127.0.0.1' ACTIVEMQ_PORT='61613'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In OpenShift Enterprise 2.1.2 and later, you can set theACTIVEMQ_HOST
parameter as a comma-separated list of host:port pairs if you are using multiple ActiveMQ brokers:Example 8.17. Example
ACTIVEMQ_HOST
Setting Using Multiple ActiveMQ BrokersACTIVEMQ_HOST='192.168.59.163:61613,192.168.59.147:61613'
ACTIVEMQ_HOST='192.168.59.163:61613,192.168.59.147:61613'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You can optionally enable SSL connections per ActiveMQ host. To do so, set the
MCOLLECTIVE_CONFIG
parameter in the/etc/openshift/plugins.d/openshift-origin-routing-activemq.conf
file to the MCollective client configuration file used by the broker:MCOLLECTIVE_CONFIG='/opt/rh/ruby193/root/etc/mcollective/client.cfg'
MCOLLECTIVE_CONFIG='/opt/rh/ruby193/root/etc/mcollective/client.cfg'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that while setting theMCOLLECTIVE_CONFIG
parameter overrides theACTIVEMQ_HOST
andACTIVEMQ_PORT
parameters in this file, theACTIVEMQ_USERNAME
andACTIVEMQ_PASSWORD
parameters in this file are still used by the routing plug-in and must be set. - Restart the broker service:
service openshift-broker restart
# service openshift-broker restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow