redis配置启动测试

解压安装redis

tar -xzvf redisxxx.xx生成解压目录

进入解压目录:执行命令

make

make install

安装成功:

redis默认安装位置/usr/local/bin

查看/usr/local/bin下新增文件命令:

修改配置文件

配置文件位于redis的解压目录:参见:关于配置文件的详述

将解压目录当中的redis.conf复制到自己新建的一个目录(myredis)下,作为副本,以后我们就修改副本即可。

默认本机运行

 默认端口6379

 修改为yes,使之以后台方式启动.

运行测试

redis-server /home/kakarotto/myredis/redis.conf
其中指定redis启动时绑定的配置文件,是我之前修改之后配置文件存放的位置(即副本)。
[root@localhost bin]# redis-server /home/kakarotto/myredis/redis.conf
9144:C 08 Aug 2020 23:48:08.996 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9144:C 08 Aug 2020 23:48:08.996 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=9144, just started
9144:C 08 Aug 2020 23:48:08.996 # Configuration loaded
[root@localhost bin]# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set k1 hello
OK
127.0.0.1:6379> get k1
"hello"
127.0.0.1:6379> shutdown
not connected> exit
[root@localhost bin]# ps -ef | grep redis
root       9169   8806  0 23:49 pts/1    00:00:00 grep --color=auto redis
[root@localhost bin]# 

 

posted @ 2020-08-08 16:04  liuyanntes'cnblogs  阅读(396)  评论(0编辑  收藏  举报