简体   繁体   English

允许Azure / Centos mongodb端口

[英]Allow Azure/Centos mongodb port

I'm trying to install a mongodb replicaset Azure Centos OS 7.2. 我正在尝试安装mongodb副本集Azure Centos OS 7.2。 Following this tutorial: azure mongodb docs , I've manage to get my tree centos instances up and running, with mongodb. 按照本教程: azure mongodb docs ,我设法通过mongodb启动并运行了我的tree centos实例。

The problem is: I can't place a replicaset working. 问题是:我无法使副本集正常工作。 After struggling trying to make rs.initiate work using this json 经过努力使rs.initiate使用此json工作

{
"_id" : "mongors",
    "members": [{
        "_id": 0,
        "host": "mongodbrs.cloudapp.net:27018"
    }, {
        "_id": 1,
        "host": "mongodbrs.cloudapp.net:27019"
    }, {
        "_id": 2,
        "host": "mongodbrs.cloudapp.net:27020"
    }]

} }

and getting errors saying that was not possible connect to any other instance but itself, I realize that my problem was before configuring a replicaset. 并收到错误消息,指出无法连接到任何其他实例,但本身无法连接,我意识到我的问题是在配置副本集之前。

My VM's can ping each other, pinging their private ip. 我的VM可以彼此ping通,也可以ping通其私有IP。 Telnet to port 22 (also using private network ip) is working fine. Telnet到端口22(也使用专用网络ip)工作正常。

But any other mongodb port is not allowed. 但是不允许任何其他mongodb端口。 I got the network security group and inbound security rules set. 我得到了网络安全组和入站安全规则集。

Azure入站安全规则

You have an error in your source port range. 您的源端口范围有误。 You need to make this a wildcard ( * ), meaning your traffic can originate from any port. 你需要让这个通配符( * ),这意味着你的流量可以从任意端口发起

The target port is where you specify the port range where traffic is allowed to reach. 在目标端口上,您可以指定允许流量到达的端口范围。

Setup the source to 0.0.0.0/0 and * ports. 将源设置为0.0.0.0/0和*端口。 It's not the better solution but will help you to understand if the problem is in network layer or not. 这不是更好的解决方案,但可以帮助您了解问题是否出在网络层。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM