同じデータ センターに、3 つのノードを含むソファベース クラスターに接続するアプリケーション サーバー (クライアント) があります。
パフォーマンスを最適化するために、クライアントが外部 IP ではなく内部 IP 経由で接続するようにしたいと考えています。これらが私のIPであるとしましょう:
- node1InternalIP / node1ExternalIP
- node2InternalIP / node2ExternalIP
- node3InternalIP / node3ExternalIP
カウチベース クライアント (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 が使用されるようにするにはどうすればよいですか?