17. Auto Discovery とは
□ Auto Discovery でノード情報を自動取得
Cache ClusterApplication
App ElastiCache
Cluster Client
get(Key)
Value
node1 node2 node3 node4
new Client()
client
configuration endpoint
でクライアントを生成
node1, node2, node3
Resolve
configuration
endpoint
Get cluster endpoints
Polling
Refresh nodes
once per minute
Consistent Hashing
Memcached Protocol の拡張
18. Auto Discovery とは(原文)
Connecting to Cache Nodes
1. 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.
2. The client requests the configuration information for all of the other nodes. Since each node maintains
configuration information for all of the nodes in the cluster, any node can pass configuration information to the
client upon request.
3. The client receives the current list of cache node hostnames and IP addresses. It can then connect to all of the
other nodes in the cluster.
Normal Cluster Operations
1. The application issues a get request for a particular data item, identified by its key.
2. The client uses a hashing algorithm against the key to determine which cache node contains the data item.
3. The data item is requested from the appropriate node.
4. The data item is returned to the application.
20. Cache Security Group の設定
□ Cache Security Group のため接続できない
Cache Cluster
Cache Parameter
Group
node1
node2
EC2
EC2SecurityGroup
Node1
Endpoint
Node2
Endpoint
ConfigurationEndpoint
CacheSecurityGroup
Instance
接続できない接続できない
21. Cache Security Group の設定
□ EC2 Security Group を許可するように設定を変更する
Cache Cluster
Cache Parameter
Group
node1
node2
EC2
EC2SecurityGroup
Node1
Endpoint
Node2
Endpoint
ConfigurationEndpoint
CacheSecurityGroup
Instance
設定を変更
22. Cache Security Group の設定
③ Add をクリック
② 接続を許可したい EC2
Security Group を選択する
① Cache Security Group
をクリック
前項では defaultというSecurity Group
を指定して Cache Cluster を作成しました
23. Cache Parameter Group の設定
□ パラメータ一覧
Cache Cluster
node1
node2
Cache Parameter
Group
name value
cas_disabled On/Off
chunk_size 1-1024
chunk_size_growth_factor 1.01-100.00
error_on_memory_exhausted On/Off
max_item_size 1024-134217728
maxconns_fast On/Off
memcached_connections_over
head
0-100000
slab_automove 0-2
slab_reassign On/Off
24. Cache Parameter Group の設定
③ Edit Parameters
をクリック
② Cache Parameter Group の1つを選択
① Cache Parameter Group
をクリック
デフォルトパラメータは
設定の変更ができない