美文网首页
redis启动,停止

redis启动,停止

作者: 西湖泛舟客 | 来源:发表于2020-12-02 10:03 被阅读0次

    1.直接启动

    进入redis根目录,执行命令:

    #加上‘&’号使redis以后台程序方式运行

    ./redis-server &

    2.通过指定配置文件启动

    可以为redis服务启动指定配置文件,例如配置为/etc/redis/6379.conf

    进入redis根目录,输入命令:

    ./redis-server /etc/redis/6379.conf

    #如果更改了端口,使用`redis-cli`客户端连接时,也需要指定端口,例如:

    redis-cli -p 6380

    后台方式启动

    修改redis.conf,把daemonize no修改成daemonize yes

    停止:redis-cli shutdown

    查找进程号

    ps -ef | grep redis

    杀进程

    kill -6 pid

    redis快照问题错误信息如下:

    MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

    排查与解决步骤:

    进入redis使用info命令查看,会发现最后一次快照失败的信息

    rdb_last_bgsave_status:err

    处理方法:

    1.进入redis临时关闭配置(如果需要,要再redis.conf上写上该配置,不然下次重启redis配置会失效)

    config set stop-writes-on-bgsave-error no

    相关文章

      网友评论

          本文标题:redis启动,停止

          本文链接:https://www.haomeiwen.com/subject/fajywktx.html