Upgrade RabbitMQ Software - rabbitmq

We are currently running RabbitMQ on our Windows server machine.
We want to switch to Linux server machine.
Our setup is on AWS.
We have already created a Linux machine and installed latest version of RabbitMQ in it.
Our client applications use IP to connect to RabbitMQ server. The linux server has an IP.
We would like to change the RabbitMQ server without any downtime. We have messages in Windows based RabbitMQ server and would like to move those messages as well.
What would be possible options in this scenario?
Is there a way to upgrade RabbitMQ software later without any downtime?

It's far easier if you don't need to move messages from one server to another.
I'd suggest this:
Run both servers in parallel
Create a bunch of new consumers ( a copy of all current consumers ) and make them consume from Linux server. At this moment, Linux server has no load yet.
Gradually switch producers from Windows to Linux server, monitoring the system.
Once all producers are switched, wait for queues on Windows server to be drained by existing consumers.
Once all queues are drained on Windows server, switch off Windows server's consumers.
You are done, all your load is on Linux server now

It is possible to proceed in such order:
Read and handle both servers on backend: old (Windows machine) and new (Linux machine) RabbitMQ server.
Toggle all the clients to write into new server only.
When queues in the old server are empty, old server will be no required anymore.

Related

Running two RabbitMQ instances as Windows Service in single machine

I have tried and successfully configured and run two rabbitmq instances as an application in Windows Server 2012. Following the tutorials below,
https://lazareski.com/multiple-rabbitmq-instances-on-1-machine/
https://www.rabbitmq.com/clustering.html
but I have to repeat the above steps as soon as the server restarts or when my session is over.
How do I go about configuring and running two RabbitMQ Services in a single windows machine to permanently run them in background ?
It's probably best to use the .zip distribution for Windows. Then, using two separate administrative accounts, set the required environment variables for two nodes in that account's environment. RABBITMQ_SERVICENAME will also have to be set and unique. Then, extract the .zip and run rabbitmq-service.bat install and rabbitmq-service.bat run.
The above is untested. Running multiple Erlang VMs on the same machine is not recommended as it can affect performance.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

RabbitMQ on Windows - enable the Firehose on service restart

Is there a way to setup RabbitMQ in a way that the Firehose is autamatically enabled (for a single virtual host preferably) after a Windows or RabbitMQ service restart?
As described in Running RabbitMQ Server as a Service (on Windows) doc,
The service runs using the rabbitmq-service.bat script in sbin.
So you can customize it to get desired behavior.

Understanding Apache ActiveMQ

I am confused about the function of Apache ActiveMQ.
I downloaded ActiveMQ from this link.
So I use it this way (environment: Windows 7): I start the bin/activemq.bat, then it works.
My question is: Does this mean I start a server on my machine? When I initialize the ActiveMQConnectionFactory, the broker URL is tcp://localhost:61616. But what if I want my machine to serve as a server and another machine to connect to my server?
Yes, you can use the primary box as a server and have consumers/subscribers running on other boxes (which will need to connect to the server - you will need to specify the server hostname & port for the connection to be established) - once in place, the messages on the server (topic or queue) can be consumed by the clients.
If you one have one producer and one consumer, you can look into using queues - if you have more than one consumer/subscriber, you can look into setting up a topic to which the consumers will subscribe to. Messages need to be inserted to the topic/queue as needed.
You can specify the server information in your code or preferably in the config file.
For reference to topologies:
http://activemq.apache.org/topologies.html
Also, you can choose to persist your messages or not based on your use case. Kaha DB is the preferred route (specially if performance is of concern).
Useful examples:
http://sujitpal.blogspot.com/2007/12/jms-patterns-with-activemq.html
http://vvratha.blogspot.com/2012/05/java-client-to-sendreceive-messages-for.html
Hope it helps.
Apache ActiveMQ ™ is the most popular and powerful open source messaging and Integration Patterns server
& it act like a third party server.
Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. Apache ActiveMQ is released under the Apache 2.0 License.
ActiveMQ have the capabilities to send 100 MB single message framework and maintain 1000 concurrent connection simultaneously , for the further information you can check activemq.xml in your documentation.
Further Info at here about the ActiveMQ

Celery, rabbitmq: How to install remote worker?

Can I have multiple machines to execute the tasks and return messages that are distributed by django? I looked into celery/rabbitmq, I'm not sure if I can setup celery workers on remote computers. Can anyone guide me through here?
If this is not possible or very hard, any alternative solution for the problem?
You can do this by installing your Django project on to the remote computer, and then ensuring that it is configured to use the correct broker, database server, and media directory (assuming your tasks need access to that).

Error to Connect RabbitMq in hyperic HQ

I am trying to monitor a machine in which RabbitMQ is installed.RabbitMQ's broker is working well in that machine.
Now I want to monitor that machine using open source HypricHQ software.
The problem is the HypricHQ server can't find my RabbitMQ broker.My Hypric Agent is also working fine, i.e. in HypricHQ server the detail of RabbitMQ machine is showing.
I have checked the error in agent.log file the error logged in that file is:
2011-05-30 15:24:16,549 INFO [Thread-1] [SingleConnectionFactory] Established shared Rabbit Connection: org.springframework.erlang.connection.DefaultConnection#1265109
2011-05-30 15:24:16,574 ERROR [Thread-1] [AutoScan] AutoScan failed for RabbitMQ
org.springframework.erlang.ErlangBadRpcException: {badrpc,{'EXIT',{undef,[{rabbit_access_control,list_vhosts,[]},{rpc,'-handle_call_call/6-fun-0-',5}]}}}
at org.hyperic.hq.plugin.rabbitmq.core.HypericErlangTemplate.executeRpcAndConvert(HypericErlangTemplate.java:72)
at org.hyperic.hq.plugin.rabbitmq.core.HypericRabbitAdmin.getVirtualHosts(HypericRabbitAdmin.java:75)
at org.hyperic.hq.plugin.rabbitmq.detect.RabbitServerDetector.getServerResources(RabbitServerDetector.java:106)
at org.hyperic.hq.autoinventory.scanimpl.NullScan.scan(NullScan.java:83)
at org.hyperic.hq.autoinventory.Scanner.start(Scanner.java:198)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:141)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
at org.hyperic.hq.autoinventory.ScanManager$1.run(ScanManager.java:107)
Why this error occure?
How can I overcome this error? The OS I am using is Windows 7.
Maybe it needs your broker to have the rabbitmq-management plugin installed?
Log into the server running the RabbitMQ broker and type
sudo rabbitmqctl status
Check that the version is one that is supported by Hypric. A lot of Linux distros have a very old version of RabbitMQ installed. It is easy enough to upgrade using the .deb or .rpm binaries on the RabbitMQ site so you should consider doing that.