<div dir="ltr">Sure .. but I&#39;m wondering if there is native syslog support in RabbitMQ. Its much cleaner that way.</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">Matt Wise<div>Sr. Systems Architect</div>
<div>Nextdoor.com</div></div></div>
<br><br><div class="gmail_quote">On Wed, Nov 6, 2013 at 8:18 AM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 6 November 2013 16:02, Matt Wise &lt;<a href="mailto:matt@nextdoor.com">matt@nextdoor.com</a>&gt; wrote:<br>
&gt; See comments inline.<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Nov 6, 2013 at 2:37 AM, Tim Watson &lt;<a href="mailto:tim@rabbitmq.com">tim@rabbitmq.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Matt,<br>
&gt;&gt;<br>
&gt;&gt; Sorry to hear you&#39;ve been running into problems.<br>
&gt;&gt;<br>
&gt;&gt; On 5 Nov 2013, at 22:05, Matt Wise wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt; (sorry if this gets posted twice.. first email never seemed to make it<br>
&gt;&gt; &gt; to the list)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hey... I had a pretty rough time today with a 3-node RabbitMQ 3.1.3<br>
&gt;&gt; &gt; cluster thats under pretty heavy use (6-7 million messages per day -- 100MB<br>
&gt;&gt; &gt; peak bandwidth per node). I want to pose a few questions here. First off,<br>
&gt;&gt; &gt; here&#39;s the basic configuration though.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Configuration:<br>
&gt;&gt; &gt; � serverA, serverB and serverC are all configured with RabbitMQ 3.1.3.<br>
&gt;&gt; &gt; They each are configured via Puppet ... and Puppet uses a dynamic node<br>
&gt;&gt; &gt; discovery plugin (zookeeper) to find the nodes. The node lists are<br>
&gt;&gt; &gt; hard-coded into the rabbitmq.config file. A dynamic server list generator<br>
&gt;&gt; &gt; supplies Puppet with this list of servers (and is not really necessary to<br>
&gt;&gt; &gt; describe here in this email).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Scenario:<br>
&gt;&gt; &gt; � A momentary configuration blip caused serverA and serverB to begin<br>
&gt;&gt; &gt; reconfiguring their rabbitmq.config files... when they did this, they also<br>
&gt;&gt; &gt; both issued a &#39;service rabbitmq restart&#39; command. This command took<br>
&gt;&gt; &gt; 40+minutes and ultimately failed. During this failure, RabbitMQ was<br>
&gt;&gt; &gt; technically running and accepting connections to the TCP ports ... but it<br>
&gt;&gt; &gt; would not actually answer any queries. Commands like list_queues would hang<br>
&gt;&gt; &gt; indefinitely.<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; What ha recovery policy (if any) do you have set up? A and B might get a<br>
&gt;&gt; different &quot;view of the world&quot; set up in their respective rabbitmq.config<br>
&gt;&gt; files (either to each other and/or to C) and then get restarted, but this<br>
&gt;&gt; should affect their view of the cluster, because as per<br>
&gt;&gt; <a href="http://www.rabbitmq.com/clustering.html" target="_blank">http://www.rabbitmq.com/clustering.html</a>:<br>
&gt;&gt;<br>
&gt;&gt; &quot;Note that the cluster configuration is applied only to fresh nodes. A<br>
&gt;&gt; fresh nodes is a node which has just been reset or is being start for the<br>
&gt;&gt; first time. Thus, the automatic clustering won&#39;t take place after restarts<br>
&gt;&gt; of nodes. This means that any change to the clustering via rabbitmqctl will<br>
&gt;&gt; take precedence over the automatic clustering configuration.&quot;<br>
&gt;&gt;<br>
&gt;<br>
&gt; So far we&#39;ve taken the approach that clustering configuration should be<br>
&gt; hard-coded into the rabbitmq.config files. This works well in explicitly<br>
&gt; defining all of the hosts in a cluster on every machine, but it also means<br>
&gt; that adding a 4th node to a 3-node cluster will cause the 3 running live<br>
&gt; nodes to do a full service restart, which is bad. Our rabbitmq.config though<br>
&gt; is identical on all of the machines (other than the server-list, which may<br>
&gt; have been in-flux when Puppet was restarting these services)<br>
&gt;<br>
&gt;&gt; [<br>
&gt;&gt; � � � � {rabbit, [<br>
&gt;&gt; � � � � � � � � {log_levels, [{connection, warning}]},<br>
&gt;&gt; � � � � � � � � {cluster_partition_handling,pause_minority},<br>
&gt;&gt; � � � � � � � � {tcp_listeners, [ 5672 ] },<br>
&gt;&gt; � � � � � � � � {ssl_listeners, [ 5673 ] },<br>
&gt;&gt; � � � � � � � � {ssl_options,<br>
&gt;&gt; [{cacertfile,&quot;/etc/rabbitmq/ssl/cacert.pem&quot;},<br>
&gt;&gt; � � � � � � � � � � � � {certfile,&quot;/etc/rabbitmq/ssl/cert.pem&quot;},<br>
&gt;&gt; � � � � � � � � � � � � {keyfile,&quot;/etc/rabbitmq/ssl/key.pem&quot;},<br>
&gt;&gt; � � � � � � � � � � � � {verify,verify_peer},<br>
&gt;&gt; � � � � � � � � � � � � {fail_if_no_peer_cert,true}<br>
&gt;&gt; � � � � � � � � ]},<br>
&gt;&gt; � � � � � � � � {cluster_nodes,[&#39;rabbit@i-23cf477b&#39;, &#39;rabbit@i-07d8bc5f&#39;,<br>
&gt;&gt; &#39;rabbit@i-a3291cf8&#39;]}<br>
&gt;&gt; � � � � ]}<br>
&gt;&gt; ].<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; Questions:<br>
&gt;&gt; &gt; � 1. We only had ~2500 messages in the queues (they are HA&#39;d and<br>
&gt;&gt; &gt; durable). The policy is { &#39;ha-mode&#39;: &#39;all&#39; }. When serverA and serverB<br>
&gt;&gt; &gt; restarted, why did they never come up? Unfortunately in the restart process,<br>
&gt;&gt; &gt; they blew away their log files as well which makes this really tough to<br>
&gt;&gt; &gt; troubleshoot.<br>
&gt;&gt;<br>
&gt;&gt; It&#39;s nigh on impossible to guess what might&#39;ve gone wrong without any log<br>
&gt;&gt; files to verify against. We could sit and stare at all the relevant code for<br>
&gt;&gt; weeks and not spot a bug that&#39;s been triggered here, since if it were<br>
&gt;&gt; obvious we would&#39;ve fixed it already.<br>
&gt;&gt;<br>
&gt;&gt; If you can give us a very precise set of steps (and timings) that led to<br>
&gt;&gt; this situation, I can try and replicate what you&#39;ve seen, but I don&#39;t fancy<br>
&gt;&gt; my chances to be honest.<br>
&gt;<br>
&gt;<br>
&gt; Its a tough one for us to reproduce.. but I think the closest steps would<br>
&gt; be:<br>
&gt;<br>
&gt; � 1. Create a 3-node cluster... configured with similar config to the one I<br>
&gt; pasted above.<br>
&gt; � 2. Create enough publishers and subscribers that you have a few hundred<br>
&gt; messages/sec going through the three machines.<br>
&gt; � 3. On MachineA and MachineC, remove MachineB from the config file.<br>
&gt; � 4. Restart MachineA&#39;s rabbitmq daemon using init script<br>
&gt; � 5. Wait 3 minutes... theoretically #4 is still in process.. now issue the<br>
&gt; same restart to MachineC.<br>
&gt;<br>
&gt; � Fail.<br>
&gt;<br>
&gt; Thats our best guess right now.. but agreed, the logs are a problem. Can we<br>
&gt; configure RabbitMQ to log through syslog for the future?<br>
<br>
</div></div>Syslog-ng can tail logs, dumping the logs in some arbitrary<br>
destination (another file, Papertrail, etc.)<br>
<span class="HOEnZb"><font color="#888888"><br>
frank<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
&gt;&gt; &gt; � 2. I know that restarting serverA and serverB at nearly the same time<br>
&gt;&gt; &gt; is obviously a bad idea -- we&#39;ll be implementing some changes so this<br>
&gt;&gt; &gt; doesn&#39;t happen again -- but could this have lead to data corruption?<br>
&gt;&gt;<br>
&gt;&gt; It&#39;s possible, though obviously that shouldn&#39;t really happen. How close<br>
&gt;&gt; were the restarts to one another? How many HA queues were mirrored across<br>
&gt;&gt; these nodes, and were they all very busy (as your previous comment about<br>
&gt;&gt; load seems to suggest)? We could try replicating that scenario in our tests,<br>
&gt;&gt; though it&#39;s not easy to get the timing right and obviously the existence of<br>
&gt;&gt; network infrastructure on which the nodes are running won&#39;t be the same (and<br>
&gt;&gt; that can make a surprisingly big difference IME).<br>
&gt;<br>
&gt;<br>
&gt; The restarts were within a few minutes of each other. There are 5 queues,<br>
&gt; and all 5 queues are set to mirror to &#39;all&#39; nodes in the cluster. They were<br>
&gt; busy, but no more than maybe 100 messages/sec coming in/out.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; Once the entire RabbitMQ farm was shut down, we actually were forced to<br>
&gt;&gt; &gt; move the rabbitmq data directory out of the way and start up the farm<br>
&gt;&gt; &gt; completely with blank databases. It seemed that RabbitMQ 3.1.3 really did<br>
&gt;&gt; &gt; not want to recover from this failure. Any thoughts?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; � 3. Lastly .. in the event of future failures, what tools are there for<br>
&gt;&gt; &gt; recovering our Mnesia databases? Is there any way we can dump out the data<br>
&gt;&gt; &gt; into some raw form, and then import it back into a new fresh cluster?<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m afraid there are not, at least not &quot;off the shelf&quot; ones anyway. If you<br>
&gt;&gt; are desperate to recover important production data however, I&#39;m sure we<br>
&gt;&gt; could explore the possibility of trying to help with that somehow. Let me<br>
&gt;&gt; know and I&#39;ll make some enquiries at this end.<br>
&gt;<br>
&gt;<br>
&gt; At this point we can move on from the data loss... but it does make for an<br>
&gt; interesting issue. Having tools to analyze the Mnesia DB and get &quot;most of&quot;<br>
&gt; the messages out in some format where they could be re-injected into a fresh<br>
&gt; cluster would be an incredibly useful tool. I wonder how hard it is to do?<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Tim<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rabbitmq-discuss mailing list<br>
&gt;&gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt;&gt; <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rabbitmq-discuss mailing list<br>
&gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt; <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
&gt;<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br></div>