2013年2月26日火曜日

ElastiCacheの"Configuration Endpoint"の実体

スズキです。

ElastiCacheの"Cache Cluster"を作成すると、下記のように"Configuration Endpoint"が
利用できます。


この"Configuration Endpoint"を名前解決してみたら下記のようになりました。
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 60 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-54-249-151-184.ap-northeast-1.compute.amazonaws.com. 60 IN A yyy.yyy.15.105

実はこのIPアドレスは、下記のような"Cache Node"のIPアドレスでした。

# dig +noall +answer test.xxxxxx.0001.apne1.cache.amazonaws.com
test.xxxxxx.0001.apne1.cache.amazonaws.com. 60 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 60 IN A yyy.yyy.15.105

ただ"Cache Node"は複数あるので、どのノードが割り当てられているのか、いろいろと
確認してみたところ、下記のようにDNSのTTLが切れたら、他のノードに変わるような
挙動をしていました。
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 2 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 2  IN A yyy.yyy.16.246
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 1 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 1  IN A yyy.yyy.16.246
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 60 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 60 IN A yyy.yyy.15.105
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 59 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 59 IN A yyy.yyy.15.105

というのが下記のドキュメントに、なんとなく書かれていました。
Connecting to Cache Nodes

The application resolves the configuration endpoint's DNS name.
Because the configuration endpoint maintains CNAME entries
for all of the cache nodes, the DNS name resolves to one of the nodes;
the client can then connect to that node.

なので"Configuration Endpoint"に向かってデータのGET/PUTはできちゃうのですが...
--------
http://www.suz-lab.com

0 コメント: