Linux中安装配置Redis图文教程
- 首先到官网下载安装包:gz格式 官网链接:
- 放在Linux系统中的任意文件夹
- 用root身份打开终端,进入安装的目录。并且要编译并安装!
#cd redis-2.8.17 #make #cd src #make install PREFIX=/usr/local/redis
如果出现这样就是安装成功!
4.成功之后启动服务!!
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
第一个是启动服务,第二个是启动配置 这样就启动成功了! 然后我们在将配置文件复制到需要的目录中,如:
[root@localhost redis-4.0.1]# cp redis.conf /usr/local/redis [root@localhost redis-4.0.1]# cd /usr/local/redis [root@localhost redis]# ls bin redis.conf
首先编辑redis.conf
[root@localhost redis]# vim redis.conf
这么做就是为了能在后端启动 按esc退出编辑模式,再按:输入wq。代表保存并且退出 再次启动:
[root@localhost redis]# ls bin redis.conf [root@localhost redis]# ./bin/redis-server ./redis.conf//加载配置文件
成功后会如图 通过命令查看是否启动
ps -ef | grep -i redis
关闭redis
[root@localhost redis]# ./bin/redis-cli shutdown
上一篇:
IDEA上Java项目控制台中文乱码