Linux环境安装Redis
自己在Centos系统上安装Redis的步骤,写下以作记录。
登录Linux用户,使用Xshell 6连接工具腾讯云服务器,链接见下
执行下面命令
[root@VM_0_10_centos ~]# cd /usr/
[root@VM_0_10_centos usr]# mkdir redis
[root@VM_0_10_centos usr]# cd redis/
然后通过wget命令下载Redis的安装包,执行命令
[root@VM_0_10_centos redis]# wget http://download.redis.io/releases/redis-3.2.4.tar.gz
解压缩安装包
[root@VM_0_10_centos redis]# tar xzf redis-3.2.4.tar.gz
进入解压缩的文件夹,进行安装
[root@VM_0_10_centos redis]# cd redis-3.2.4
安装Redis,执行make命令
[root@VM_0_10_centos redis-3.2.4]# make
之后启动Redis服务,执行src/redis-server
[root@VM_0_10_centos redis-3.2.4]# src/redis-server
之后可以开启另外一个命令行窗口,登录
进入Redis目录,执行,cd /usr/redis/redis-3.2.4
执行src/redis-cli命令,运行客户端命令。
数据存储:set key1 value1
数据读取:get key1
[root@VM_0_10_centos ~]# cd /usr/redis/redis-3.2.4
[root@VM_0_10_centos redis-3.2.4]# src/redis-cli
127.0.0.1:6379> set key1 value1
OK
127.0.0.1:6379> get key1
"value1"
127.0.0.1:6379> exit
[root@VM_0_10_centos redis-3.2.4]#