- Konfigurasi Password
- Akses Redis
- Akses ke Server lokal
- Akses ke server lain
- Akses ke spesifik database ID
- Melihat salah satu key
- Basic Control Redis
- Melihat Info dan Statistik dari Redis
- Menampilkan Client yang sedang terkoneksi ke Redis Server
- Memutuskan Koneksi dari Client
- Memonitor Redis
- Menyimpan database ke disk
- Menyimpan database ke disk dengan backgrond
- Melihat stempel dari terakhir save
- Menyimpan dan matikan redis server
sulaiman@learn:~$ sudo vi /etc/redis/redis.conf
#tambahkan berikut
requirepass katasandi
requirepass katasandi
sulaiman@learn:~$ sudo systemctl restart redis
sulaiman@learn:~$ sudo redis-cli
#Dengan Password
sulaiman@learn:~$ sudo redis-cli -a katasandi
#Dengan Password
sulaiman@learn:~$ sudo redis-cli -a katasandi
sulaiman@learn:~$ redis-cli -h node1.example.com -a password
sulaiman@learn:~$ redis-cli -n 1
127.0.0.1:6379[1]>
#Pindah ke database lain
127.0.0.1:6379[1]>select 2
127.0.0.1:6379[2]>
127.0.0.1:6379[1]>
#Pindah ke database lain
127.0.0.1:6379[1]>select 2
127.0.0.1:6379[2]>
sulaiman@learn:~$ redis-cli -n 1 get key01
sulaiman@learn:~$ redis-cli -a katasandi
127.0.0.1:6379>info
# Server
redis_version:3.0.6
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:687a2a319020fa42
redis_mode:standalone
os:Linux 4.4.0-21-generic x86_64
arch_bits:64
multiplexing_api:epoll
...
127.0.0.1:6379>info
# Server
redis_version:3.0.6
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:687a2a319020fa42
redis_mode:standalone
os:Linux 4.4.0-21-generic x86_64
arch_bits:64
multiplexing_api:epoll
...
127.0.0.1:6379>client list
id=6 addr=127.0.0.1:35370 fd=5 name= age=221 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
id=4 addr=10.40.40.50:35379 fd=6 name= age=10 idle=10 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=auth
id=6 addr=127.0.0.1:35370 fd=5 name= age=221 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
id=4 addr=10.40.40.50:35379 fd=6 name= age=10 idle=10 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=auth
127.0.0.1:6379>client kill 10.40.40.50:35379
127.0.0.1:6379>monitor
127.0.0.1:6379>save
127.0.0.1:6379>bgsave
127.0.0.1:6379>lastsave
127.0.0.1:6379>shutdown
not connected>quit
not connected>quit
0 comments:
Post a Comment