Redis安装配置
程序员文章站
2022-05-01 18:34:25
...
1、下载redis
[root@jack31 ~]# wget http://download.redis.io/releases/redis-4.0.6.tar.gz
2、解压redis-4.0.6.tar.gz
[root@jack31 ~]#tar -zxvf redis-4.0.6.tar.gz
3、编译
[root@jack31 ~]#mv redis-4.0.6 /usr/local/redis
[root@jack31 ~]#cd /usr/local/redis
[root@jack31 redis]#make
4、编译安装
[root@jack31 redis]# cd src && make install
5、 Redis系统启动(执行./utils/install_server.sh)
[root@jack31 src]# ../utils/install_server.sh
#[6379] 端口号
#[/etc/redis/6379.conf] 配置文件
#[/var/log/redis_6379.log] 日志
#[/var/lib/redis/6379] 库
#[/usr/local/bin/redis-server] 启动脚本
查看进程
[root@jack31 src]# ps -ef|grep redis
root 62913 1 0 20:29 ? 00:00:00 /usr/local/bin/redis-server 127.0.0.1:6379
root 62945 2617 0 20:30 pts/0 00:00:00 grep --color=auto redis
启动Redis
[root@jack31 src]# /etc/init.d/redis_6379 start
Starting Redis server...
或者
[root@jack31 src]# service redis_6379 start
Starting Redis server...
关闭Redis
[aaa@qq.com src]# service redis_6379 stop
Stopping ...
Redis stopped
或者
[aaa@qq.com src]# /etc/init.d/redis_6379 stop
Stopping ...
Redis stopped
重启Redis
[aaa@qq.com src]# service redis_6379 restart
Stopping ...
Redis stopped
Starting Redis server...
[aaa@qq.com src]# service redis_6379 status
Redis is running (63069)