아마존 EC2와 내가 서버에 연결하기 위해 5672 포트를 사용하기 위해 외부에서 rabbitmq 서버에 액세스 할 수없는 다른 회사의 다른 VPS에서이 문제가 발생했습니다. 새앙 토끼 라이브러리를 사용하여RabbitMQ 우분투 14.04 서버 구성
telnet: Unable to connect to remote host: Connection timed out
및 파이썬에서 간단한여보세요 세계 코드 예제 : 두 경우 모두에서 명령을
telnet <ip> 5672
returnes이
No handlers could be found for logger "pika.adapters.base_connection"
Traceback (most recent call last):
File "/home/.../Send.py", line 7, in <module>
connection = pika.BlockingConnection(pika.ConnectionParameters('<ip>', 5672, "/", credentials))
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 61, in __init__
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 513, in __init__
File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 804, in _connect
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 138, in _adapter_connect
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 120, in _adapter_connect
pika.exceptions.AMQPConnectionError: 2.0
:
import pika
credentials = pika.PlainCredentials('admin', 'password')
connection = pika.BlockingConnection(pika.ConnectionParameters('<ip>', 5672, "/", credentials))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
routing_key='hello',
body='Hello World!')
print " [x] Sent 'Hello World!'"
connection.close()
이 예외를 throw
ec2에서 테스트 용으로 모든 인스턴스 포트의 모든 보안 그룹에서 TCP, ICMP, UDP를 허용하고 this tutorial, 에서 간단한 설치를 수행했습니다. ec2에서 rabbitmq의 두 노드 클러스터를 성공적으로 만들 수 있었지만 수행 할 수 없었습니다. EC2 인스턴스에
wget <ip>:15672
가 관리한다는 것을 의미 HTML 파일을 저장 : 모든 포트에 액세스 할 수 있도록 관련하여, 외부에서 클러스터 노드에 액세스, 여전히 같은 텔넷 결과, 나 또한 발행, 관리 플러그인을 활성화 플러그인은 각 노드에서 작동하고 액세스 할 수있었습니다. 나는/etc/hosts에서 사설 IP 주소를 사용하여 노드들이/etc/hosts에서 서로를 찾도록했다.
우분투 14.04 vps에 간단한 rabbitmq 서버를 설치하기로 결정했습니다. 이번에는 내 목적이 액세스 만 가능하도록 만들었습니다. 작업 흐름은 in here이고 모든 것이 서버에서 로컬로 작동했지만 여전히 작동하는 것으로 나타났습니다. 같은 문제가 처음에 설명했다.
와 방화벽 우분투를 사용하지 :
# ufw disable
하고 명령을 실행 :
# iptables -F
도움이되지 않았다 문제를 발행에서 방화벽이나 먼저, iptable을 제거하기 위해. 외부에서 rabbitmq 서버에 액세스하려면 추가 구성을 생각해 볼 필요가 없습니다.
감사합니다.
:
내 EC2 보안 CONFIGS에서[
{kernel,
[{inet_dist_listen_min, 45000},
{inet_dist_listen_max, 45000}
]
}
].
: 또 다른 시나리오 포트에
All ICMP 0.0.0.0/0 everywhere
ALL TCP 0.0.0.0/0 everywhere
ALL UDP 0.0.0.0/0 everywhere
및 SSH는 22
업데이트 & 여기
내 rabbitmq.config입니다 나는이 문제에 정말로 고심하고있다. y 우분투 14의 경우에 더 구체적으로 질문하십시오.04 인스턴스 내 PC에서 EC2에 단일 rabbitmq 서버 인스턴스에 액세스하려고,이 어려운 일이 아니어야 :(여기 경우에 사용할 자세한 내용은 설명 :우분투 14.04 EC2 인스턴스 보안 그룹 설정 :
내 /etc/rabbitmq/rabbitmq-env.conf 파일 :
NODE_IP_ADDRESS=<instance private ip taken from ifconfig = 177.31.*.*>
내 /etc/hosts 파일 파일 :
,363,210127.0.0.1 localhost
172.31.*.* ip-172-31-*-*
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
내 netstat -vpln
명령 출력 :
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 927/sshd
tcp 0 0 172.31.*.*:5672 0.0.0.0:* LISTEN 4662/beam
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 4662/beam
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 2089/epmd
tcp6 0 0 :::22 :::* LISTEN 927/sshd
udp 0 0 0.0.0.0:68 0.0.0.0:* 501/dhclient
udp 0 0 0.0.0.0:45419 0.0.0.0:* 501/dhclient
udp6 0 0 :::61763 :::* 501/dhclient
하지만 내 개인 컴퓨터에서 내가 수행 할 때마다 :
$ telnet <instance public IP > 5672
Trying 54.86.*.*
telnet: Unable to connect to remote host: Connection timed out
나는 NODE_IP_ADDRESS
0.0.0.0
과 여전히 성공을 설정하지했습니다. (나는이 시나리오를 rabbitmq mailing list here에 게시했습니다.)
? rabbitmq conf 파일도 있습니까? –
@jpsf 끝까지 물어 본 내용을 추가했습니다. 덕분에 – NOVIA
이 설치된 동일한 컴퓨터에서 rabbitmq에 액세스 할 수 있습니까? 예를 들어, ''을'localhost'로 대체하면 –
Vor