Redis官网:http://redis.io
下载Redis
wget https://github.com/antirez/redis/archive/3.0.0-rc1.tar.gz
解压并安装Redis
tar -zxvf 3.0.0-rc1.tar.gz cd redis-3.0.0-rc1 make
启动Redis服务
src/redis-server &
推荐以后台的方式启动,修改redis.conf文件
daemonize yes
再次启动Redis服务:src/redis-server ./redis.conf
检测Redis服务是否启动成功:
ps -ef|grep redis
会有类似的显示表示Redis服务启动成功:
[spark@hadoop000 ~]$ ps -ef|grep redis spark 31550 28512 0 18:58 pts/1 00:00:00 src/redis-server *:6379 spark 31555 31525 0 18:58 pts/2 00:00:00 grep redis
Redis默认的端口号是6379,可以通过redis.conf进行设置
客户端访问Redis:
[spark@hadoop000 redis-3.0.0-rc1]$ src/redis-cli 127.0.0.1:6379> set hello "world" OK 127.0.0.1:6379> get hello "world" 127.0.0.1:6379>