Redis
EC2 & Elastic Cache test
EC2 Security Group neyse Redis Security Groupa ekliyoruz. EC2 Security Group a 6379 nolu portu açıyoruz.
sudo apt install gcc
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make distclean # ubuntu systems only
make
src/redis-cli -c -h mycachecluster.eaogs8.0001.usw2.cache.amazonaws.com -p 6379
Test
ping
pong
gelirse işler yolundadır.
set a "hello" // Set key "a" with a string value and no expiration
OK
get a // Get value for key "a"
"hello"
get b // Get value for key "b" results in miss
(nil)
set b "Good-bye" EX 5 // Set key "b" with a string value and a 5 second expiration
get b
"Good-bye"
// wait 5 seconds
get b
(nil) // key has expired, nothing returned
quit // Exit from redis-cli
Last updated