1.下载redis
http://download.redis.io/releases/redis-5.0.5.tar.gz
$ wget http://download.redis.io/releases/redis-5.0.5.tar.gz
2.解压
$ tar zxf redis-5.0.5.tar.gz
3.安装gcc及g++编译环境
yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
4.安装redis
$ cd redis-5.0.5
$ make
5.修改redis.conf
删除或修改以下内容
# bind 127.0.0.1
protected-mode no
daemonize no
requirepass 123
6.启动redis服务
$ src/redis-server redis.conf
7.命令客户端访问
$ src/redis-cli -p 6379 -a 123 -h 127.0.0.1
redis> set address https://www.cnblogs.com/q924152020/p/11383173.html
OK
redis> get address
"https://www.cnblogs.com/q924152020/p/11383173.html"
8.Jedis客户端访问
public static void main(String[] args) {
Jedis jedis = new Jedis("192.168.8.10",6379);
jedis.auth("123");//密码
jedis.set("address","https://www.cnblogs.com/q924152020/p/11383173.html");
String value = jedis.get("address");
System.out.println(value);
jedis.close();
}