更新中
基本概念
安裝
centOS
安裝redis:yum install redis -y
啟動:systemctl start redis
設置開機啟動:systemctl enable redis
檢查運行狀態:systemctl status redis
遠程訪問
編輯配置文件?vi /etc/redis.conf
在其中修改為bind 0.0.0.0,方便允許遠程訪問(開發用,生產環境不允許)
修改后?systemctl restart redis
遠程測試是否連接成功
在另一臺機器上同樣的安裝redis
然后輸入指令?
redis-cli -h 123.123.123.123 -p 6379
PING # 應返回 PONG
SET test "hello world"
GET test # 應返回 "hello world"