• 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!
  • 相关阅读:
    关于《哈利波特》书的购买方案
    你的灯亮着吗读后感三
    jmeter做接口测试
    jmeter的分布式部署
    JMeter的定时器
    我的功能测试用例是怎么写
    常见的功能测试检查点
    测试用例概论
    敏捷开发与迭代开发
    软件测试模型
  • 原文地址:https://www.cnblogs.com/MimiSnowing/p/14958708.html
Copyright © 2020-2023  润新知