zoukankan      html  css  js  c++  java
  • docker安装部署redis用dockercompose启动设置密码

    搜索镜像

    [root@localhost ~]# docker search redis
    NAME                             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
    redis                            Redis is an open source key-value store that…   10202     [OK]       
    sameersbn/redis                                                                  83                   [OK]
    grokzen/redis-cluster            Redis cluster 3.0, 3.2, 4.0, 5.0, 6.0, 6.2      80                   
    rediscommander/redis-commander   Alpine image for redis-commander - Redis man…   70                   [OK]
    redislabs/redisearch             Redis With the RedisSearch module pre-loaded…   41                   
    redislabs/redisinsight           RedisInsight - The GUI for Redis                35                   
    kubeguide/redis-master           redis-master with "Hello World!"                33                   
    oliver006/redis_exporter          Prometheus Exporter for Redis Metrics. Supp…   31                   
    redislabs/redis                  Clustered in-memory database engine compatib…   31                   
    redislabs/rejson                 RedisJSON - Enhanced JSON data type processi…   31                   
    arm32v7/redis                    Redis is an open source key-value store that…   25                   
    arm64v8/redis                    Redis is an open source key-value store that…   19                   
    redislabs/redisgraph             A graph database module for Redis               17                   [OK]
    redislabs/rebloom                A probablistic datatypes module for Redis       16                   [OK]
    redislabs/redismod               An automated build of redismod - latest Redi…   15                   [OK]
    webhippie/redis                  Docker image for redis                          11                   [OK]
    s7anley/redis-sentinel-docker    Redis Sentinel                                  10                   [OK]
    insready/redis-stat              Docker image for the real-time Redis monitor…   10                   [OK]
    redislabs/redistimeseries        A time series database module for Redis         10                   
    goodsmileduck/redis-cli          redis-cli on alpine                             9                    [OK]
    centos/redis-32-centos7          Redis in-memory data structure store, used a…   6                    
    clearlinux/redis                 Redis key-value data structure server with t…   3                    
    tiredofit/redis                  Redis Server w/ Zabbix monitoring and S6 Ove…   1                    [OK]
    wodby/redis                      Redis container image with orchestration        1                    [OK]
    xetamus/redis-resource           forked redis-resource                           0                    [OK]

    拉取镜像

    [root@localhost ~]# docker pull redis
    Using default tag: latest
    latest: Pulling from library/redis
    eff15d958d66: Pull complete
    1aca8391092b: Pull complete
    06e460b3ba1b: Pull complete
    def49df025c0: Pull complete
    646c72a19e83: Pull complete
    db2c789841df: Pull complete
    Digest: sha256:619af14d3a95c30759a1978da1b2ce375504f1af70ff9eea2a8e35febc45d747
    Status: Downloaded newer image for redis:latest
    docker.io/library/redis:latest

    设置docker-compose.yml配置

    [root@localhost bin]# vi docker-compose.yml

    version: '3'
    services:
      redis:
        image: redis:latest
        restart: always
        container_name: redis
        command:
          - /bin/bash
          - -c
          - redis-server /usr/local/bin/redis.conf/redis.conf --requirepass "xxxxxxxx"
        privileged: true
        ports:
          - "0.0.0.0:6379:6379"
        volumes:
          - ./redis/data:/data
          - ./redis/redis.conf:/usr/local/bin/redis.conf/redis.conf

    创建Redis容器

    [root@localhost bin]# docker-compose up -d

    Creating redis         ... done
    [root@localhost bin]# docker ps -a
    CONTAINER ID    IMAGE                       COMMAND                    CREATED              STATUS              PORTS                                           NAMES
    e558e25c45bb     redis:latest                "docker-entrypoint.s…"    13 minutes ago     Up 13 minutes     0.0.0.0:6379->6379/tcp                    redis

    本机客户端登录

    root@e558e25c45bb:/usr/local/bin#
    root@e558e25c45bb:/usr/local/bin# ./redis-cli -h 127.0.0.1 -p 6379 -a "xxxxxx"
    Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
    127.0.0.1:6379> ping
    PONG
    127.0.0.1:6379>


  • 相关阅读:
    url 百分号解密
    16.UA池和代理池
    15.scrapy框架之日志等级、请求传参、提高scrapy框架的爬取效率
    14. scrip框架之5大核心组件和post请求
    13.scrapy 框架之递归解析(手动发送请求),
    12. scrapy 框架持续化存储
    11.scrapy框架简介和基础应用
    10. 移动端数据爬取
    09.python之网络爬虫之selenium、phantomJs和谷歌无头浏览器的自动化操作
    08 python之网络爬虫之乱码问题
  • 原文地址:https://www.cnblogs.com/xiaweicn/p/15604072.html
Copyright © 2011-2022 走看看