我正在尝试使用Datestax OpsCenter 5.2和Cassandra 2.1.7。我遇到的一个问题是OpsCenter守护程序(即服务器)似乎尝试使用broadcast_rpc_address
连接到Cassandra代理,broadcast_rpc_address
被安全组阻止(因为opscenterd.log
是一个公共IP AWS)。
群集有三个节点(10.0.0.0/24是AWS上VPC的子网,52.x.x.x是公共IP)
cassandra.yaml:broadcast_address = 10.0.0.100,rpc_address = 10.0.0.100,broadcast_rpc_address = 52.2.3.100
address.yaml:stomp_interface = 10.0.0.99,local_interface = 10.0.0.100,agent_rpc_broadcast_address = 10.0.0.100
cassandra.yaml:broadcast_address = 10.0.0.101,rpc_address = 10.0.0.101,broadcast_rpc_address = 52.2.3.101
address.yaml:stomp_interface = 10.0.0.99,local_interface = 10.0.0.101,agent_rpc_broadcast_address = 10.0.0.101
cassandra.yaml:broadcast_address = 10.0.0.102,rpc_address = 10.0.0.102,broadcast_rpc_address = 52.2.3.102
address.yaml:stomp_interface = 10.0.0.99,local_interface = 10.0.0.102,agent_rpc_broadcast_address = 10.0.0.102
部署在同一子网中
IP = 10.0.0.99
添加" 10.0.0.100,10.0.0.101,10.0.0.102"到"添加群集"在OpsCenter Web控制台上的窗口,我在2015-09-04 11:05:38+0000 [] INFO: New Cassandra host 52.2.3.100 discovered
2015-09-04 11:05:38+0000 [] INFO: New Cassandra host 52.2.3.101 discovered
...
2015-09-04 11:05:43+0000 [] WARN: [control connection] Error connecting to 52.2.3.100: errors=Timed out creating connection, last_host=None
2015-09-04 11:05:43+0000 [] ERROR: Control connection failed to connect, shutting down Cluster: ('Unable to connect to any servers', {'52.2.3.100': OperationTimedOut('errors=Timed out creating connection, last_host=None',)})
中得到了以下内容:
broadcast_rpc_address
注意OpsCenter尝试通过其agent_rpc_broadcast_address
连接到节点,该节点已被安全组阻止。尽管我已将agent_rpc_broadcast_address
设置为子网IP。
问题1
这是OpsCenter的正确行为吗?为什么不使用broadcast_rpc_address
?
问题2
如果我将<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
(function (){
function hello_world(){
document.write("Hello planet!");
}
})();
</script>
</head>
<body>
<script type="text/javascript">
/* HOW DO I CALL "HELLO WORLD IN HERE?" */
</script>
</body>
</html>
更改为子网IP,则OpsCenter连接正常。但是这会阻止我的客户端连接,因为非种子节点的种子节点将子网IP报告给客户端,客户端无法访问它们。
我也可以将安全组打开到OpsCenter服务器,但这样做很危险,需要通过网关。
那么在这种情况下我该如何解决问题?
思想
这个问题的核心是如何智能地&#34;决定连接到哪个IP,具体取决于客户端是在子网内还是在子网外。我见过的所有文档都没有说清楚它是如何工作的。
感谢您的帮助。
如果您还能澄清客户端和OpsCenter如何使用rpc(thrift)和本机(二进制)协议,将不胜感激。
我的印象是rpc不赞成使用本机协议,但是这会影响节点间和客户端节点的连接吗?
答案 0 :(得分:1)
问题1
这是OpsCenter的正确行为吗?为什么不使用agent_rpc_broadcast_address?
现在正是这样。 OpsCenter(通过底层python驱动程序)从Cassandra本身获取rpc地址,因此它获得broadcast_rpc_address
的值,这些值是无法访问的。 agent_rpc_broadcast_address
用于连接代理,而不是Cassandra节点本身。
我不确定为什么你阻止从同一个子网(甚至同一个安全组?)访问广播地址,同时也允许从子网外部访问它。
如果您还能澄清客户端和OpsCenter如何使用rpc(thrift)和本机(二进制)协议,将不胜感激。
从5.2开始,OpsCenter不使用thrift与Cassandra进行通信,依赖于opscenterd的本地协议和代理的本地协议+ jmx。