操作系统:CentOS。
Redis:
官网: https://redis.io/
Github: https://github.com/redis/redis
Releases包:http://download.redis.io/releases/
//执行命令
whereis redis
确保如上所示,没有Redis时再安装。
//此处使用6.2.5
wget http://download.redis.io/releases/redis-6.2.5.tar.gz
tar xzvf redis-6.2.5.tar.gz
cd redis-6.2.5
make
cd src
make install PREFIX=/usr/local/redis
cd ../
mkdir /usr/local/redis/etc
mv redis.conf /usr/local/redis/etc
//将daemonize no 改成 yes
vi /usr/local/redis/etc/redis.conf
//这样的话redis-cli指令可以在任意目录下直接使用,而不需要每次进到/usr/local/redis/bin
cp /usr/local/redis/bin/redis-server /usr/local/bin/
cp /usr/local/redis/bin/redis-cli /usr/local/bin/
redis-server
//或
redis-server /usr/local/redis/etc/redis.conf//查看进程或端口
ps -ef |grep redis
netstat -lntp | grep 6379
//检测redis-cli和redis-server
whereis redis-cli
whereis redis-server
//运行
redis-cli
//***为要设置的密码(第一次时)
config set requirepass ****//下次登录方式(***是密码)
redis-cli -h 127.0.0.1 -p 6379 -a ****
//运行
redis-cli shutdown//设置了密码以后,必须先登录才能运行各种命令,包括停止运行命令,
//不然会报错:(error) NOAUTH Authentication required.
//登录方式
redis-cli -h 127.0.0.1 -p 6379 -a ****
//去阿里云服务器安全组里面配置6379端口:
//修改redis.conf配置
//把bind 127.0.0.1 改为:bind 0.0.0.0
//重启redis生效
我使用的是:Another-Redis-Desktop-Manager
下载地址:
https://github.com/qishibo/AnotherRedisDesktopManager/releases/tag/v1.5.9
打开后新建连接,即可方便使用: