[rabbitmq-discuss] "None of the specified endpoints were reachable"
Trần Đức Thông
humg.thongit at gmail.com
Tue Feb 25 10:26:04 GMT 2014
Hi all.
I am leaning rabbitmq use haproxy to execute failover in a cluster.
IP server rabbitmq_1: 10.0.0.101 port: 15672
IP server rabbitmq_2: 192.168.247.129 port: 15672
IP server haproxy: 192.168.247.131
Haproxy config
# HAProxy Config for Local RabbitMQ SLB Warren
global
log 127.0.0.1 local0 info
maxconn 4096
daemon
nbproc 1
defaults
log global
mode tcp
option tcplog
option dontlognull
retries 3
option redispatch
maxconn 2000
timeout connect 5s
timeout client 120s
timeout server 120s
listen rabbitmq_local_cluster 192.168.247.131:8088
mode tcp
balance roundrobin
server rabbit_a 10.0.0.101:15672 check inter 5000 rise 2 fall 3
server rabbit_b 192.168.247.129:15672 backup inter 5000 rise 2 fall 3
listen private_monitoring :8101
mode http
log global
maxconn 10
clitimeout 100s
srvtimeout 100s
contimeout 100s
timeout queue 100s
option httplog
stats hide-version
stats show-node
stats enable
stats auth admin:123456
stats uri /stats
stats refresh 5s
Code APP send message
class Send
{
public static void Main()
{
var factory = new ConnectionFactory { HostName =
"192.168.247.131", Port=8088 };
using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
//channel.QueueDeclare("hello", false, false, false,
null);
channel.QueueDeclare("q_A", false, false, false, null);
channel.QueueDeclare("q_B", false, false, false, null);
int i = 0;
while (true)
{
string message = "Hello World! " + i.ToString();
var body = Encoding.UTF8.GetBytes(message);
channel.BasicPublish("", "q_A", null, body);
channel.BasicPublish("", "q_B", null, body);
Console.WriteLine(" [x] Sent {0}", message);
i++;
Thread.Sleep(1000);
}
}
}
Console.Read();
}
}
pls help me.
Thanks so muck.
On Thursday, 16 July 2009 21:45:56 UTC+7, Tammo.... at btc-ag.com wrote:
>
> Hy,
>
> i´m building a client server .net application that uses rabbitmq as mom.
>
> the code i´m using to pulish messages is:
>
> IProtocol protocol = Protocols
> .FromEnvironment();
> IConnection conn =
> factory.CreateConnection(rmqBrokerUrl);
> IModel channel = conn.CreateModel();
> conn.AutoClose = true;
> IBasicProperties props =
> channel.CreateBasicProperties();
> channel.BasicPublish(exchange, routingKey, props,
> buffer);
> channel.Close(200, "Goodbye");
>
>
>
>
> after sending about 4000msg each in a single thread using the above code,
> im getting error that states:
>
> "None of the specified endpoints were reachable".
>
>
>
> any hints on this?
>
> thanks a lot,
>
> Tammo
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140225/20fde409/attachment.html>
More information about the rabbitmq-discuss
mailing list