zoukankan      html  css  js  c++  java
  • Docker redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused

    Docker redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused

    redis-cli is the Redis command line interface, 用来与Redis服务进行交互,是因为Redis服务尚未启动。且docker启动redis里面没有配置文件。需要自己建立redis配置文件。

    [root@centos7 ~]# docker inspect redis-master | grep -i volume
                "VolumeDriver": "",
                "VolumesFrom": null,
                    "Type": "volume",
                    "Source": "/docker/volumes/8a29c5a2460e0e7f6555ea5ad139ba6d522116d9c659be5e2a97f201bb23a812/_data",
                "Volumes": {
    [root@centos7 ~]# cd /docker/volumes/8a29c5a2460e0e7f6555ea5ad139ba6d522116d9c659be5e2a97f201bb23a812/_data
    [root@centos7 _data]# vim redis.conf
    [root@centos7 _data]# cat redis.conf 
    daemonize yes
    pidfile /var/run/redis.pid
    [root@centos7 _data]# docker exec -it redis-master /bin/bash
    root@a5278da0079c:/data# redis-server /data/redis.conf 
    root@a5278da0079c:/data# redis-cli 
    127.0.0.1:6379> ping
    PONG
    127.0.0.1:6379> 
    
    WARNING: No any other purpose,keeping reminded! So sorry to offended,if necessary, contact me and I do change what I had done to protect your privileges!
  • 相关阅读:
    [51nod 1135] 原根
    [CF1303F] Number of Components
    [CF1303E] Erase Subsequences
    [CF1303D] Fill The Bag
    子域名收集的一些姿势
    使用phpstorm+wamp实现php代码实时调试审计
    XSS小游戏通关Writeup
    Exif xss
    xss的一个tip
    应急响应
  • 原文地址:https://www.cnblogs.com/MimiSnowing/p/14958708.html
Copyright © 2011-2022 走看看