在同一个数据中心,我有一个应用程序服务器(客户端)连接到包含 3 个节点的 couchbase 集群。
我希望客户端通过内部 IP 而不是外部 IP 进行连接,以优化性能。
假设这些是我的 IP:
- 节点1内部IP / 节点1外部IP
- 节点2内部IP / 节点2外部IP
- 节点 3 内部 IP / 节点 3 外部 IP
创建我的 couchbase 客户端(java 代码)时,我提供了我的内部 IP,但是当建立连接时,我得到这些日志:
2014-07-28 12:33:21.030 INFO net.spy.memcached.auth.AuthThread: Authenticated to /node1InternalIP :11210
2014-07-28 12:33:21.142 INFO net.spy.memcached.auth.AuthThread: Authenticated to /node2InternalIP :11210
2014-07-28 12:33:21.253 INFO net.spy.memcached.auth.AuthThread: Authenticated to /node3InternalIP :11210
2014-07-28 12:33:21.374 INFO com.couchbase.client.vbucket.provider.BucketConfigurationProvider: Carrier config not available, bootstrapped through HTTP.
2014-07-28 12:33:21.544 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=cache2.lac.company.info/node1ExternalIP:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2014-07-28 12:33:21.545 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=cache3.lac.company.info/node2ExternalIP:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2014-07-28 12:33:21.545 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=cache4.lac.company.info/node3ExternalIP:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
因此,身份验证似乎是针对内部 IP 完成的,但连接本身是通过外部 IP 进行的 - 这让我很担心。
此外,偶尔我会收到 CheckedOperationTimeoutException:
net.spy.memcached.internal.CheckedOperationTimeoutException: Timed out waiting for operation - failing node: cache2.lac.company.info/node1ExternalIP:11210
该异常表明客户端从外部 IP 连接超时。
如何确保我的连接将使用内部 IP?