cloud9_note

cloud9に限らないメモ

View on GitHub

ElastiCache

ノードに接続する

セキュリティグループの設定

クラスターに設定されているSecurityGroupのインバウンドを設定する。

# SecurityGroupの確認
aws elasticache describe-cache-clusters --cache-cluster-id ${対象のcluster名} | jq -r '.CacheClusters[].SecurityGroups'

設定する値

redis-cliインストール

事前にgccをインストールしておく。

cd /opt
sudo wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make distclean
make

# 必要に応じてエイリアスを通しておく。
alias redis-cli=/opt/redis-stable/src/redis-cli

接続

export redis_host=${ElastiCacheのホスト名}
redis-cli -c -h ${redis_host} -p 6379

redis-cliコマンド

> set hoge 'hoge'
OK
> get hoge
"hoge"
> get hoge
"hoge"

参考