文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Mac的docker安装redis

2023-09-01 13:45

关注

Mac的docker安装redis

1、docker search redis

NAME    DESCRIPTION          STARS     OFFICIAL   AUTOMATEDredis   Redis is an open source key-value store that…   12205     [OK]       redislabs/redisearch                Redis With the RedisSearch module pre-loaded…   56                   redislabs/redisinsight              RedisInsight - The GUI for Redis                 88                   redislabs/rebloom                   A probablistic datatypes module for Redis        23                   [OK]redislabs/redis                     Clustered in-memory database engine compatib…   38                   redis/redis-stack-server            redis-stack-server installs a Redis server w…   47                   redislabs/rejson                    RedisJSON - Enhanced JSON data type processi…   53                   redis/redis-stack                   redis-stack installs a Redis server with add…   59                   redislabs/redisgraph                A graph database module for Redis                26                   [OK]redislabs/redismod                  An automated build of redismod - latest Redi…   41                   [OK]redislabs/redistimeseries           A time series database module for Redis          12                   redislabs/operator           7                    redislabs/operator-internal         This repository contains pre-released versio…   1                    redislabs/redis-py           5                    redislabs/redis-webcli              A tiny Flask app to provide access to Redis …   3                    [OK]redislabs/redisgears                An automated build of RedisGears                 4                    redislabs/k8s-controller-internal                        0                    redislabs/memtier_benchmark         Docker image to run memtier_benchmark            0                    redislabs/ng-redis-raft             Redis with redis raft module                     0                    redislabs/k8s-controller     2                    redislabs/redisai            5                    redislabs/olmtest                   Test artefact for OLM CSV                        0                    bitnami/redis                       Bitnami Redis Docker Image                       259                  [OK]redislabs/olm-bundle         0                    redislabs/redisml                   A Redis module that implements several machi…   3                    [OK]

2、docker pull redis

macdeMacBook-Pro:~ mac$ docker pull redisUsing default tag: latestlatest: Pulling from library/redisfaef57eae888: Pull complete bb595d48e52d: Pull complete d479b54c3bb2: Pull complete 2044989c541a: Pull complete 01e4ba5495fa: Pull complete ed7a9fd4b0ea: Pull complete Digest: sha256:08a82d4bf8a8b4dd94e8f5408cdbad9dd184c1cf311d34176cd3e9972c43f872Status: Downloaded newer image for redis:latestdocker.io/library/redis:latestWhat's Next?  View summary of image vulnerabilities and recommendations → docker scout quickview redis

3、添加两个映射目录

mkdir /Users/mac/docker/redis/conf/redis.confmkdir /Users/mac/docker/redis/data

4、运行

docker run --name redis -p 6379:6379 -v /Users/mac/docker/redis/conf/redis.conf:/etc/redis/redis.conf -v /Users/mac/docker/redis/data:/data -d redis redis-server /etc/redis/redis.conf 

在这里插入图片描述

5、查看日志

在这里插入图片描述
或者

macdeMacBook-Pro:redis mac$ docker logs -f redis1:C 13 Jul 2023 13:47:33.118 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo1:C 13 Jul 2023 13:47:33.118 # Redis version=7.0.12, bits=64, commit=00000000, modified=0, pid=1, just started1:C 13 Jul 2023 13:47:33.118 # Configuration loaded1:M 13 Jul 2023 13:47:33.119 * monotonic clock: POSIX clock_gettime1:M 13 Jul 2023 13:47:33.120 * Running mode=standalone, port=6379.1:M 13 Jul 2023 13:47:33.120 # Server initialized1:M 13 Jul 2023 13:47:33.121 * Ready to accept connections1:M 13 Jul 2023 13:48:07.372 # Possible SECURITY ATTACK detected. It looks like somebody is sending POST or Host: commands to Redis. This is likely due to an attacker attempting to use Cross Protocol Scripting to compromise your Redis instance. Connection aborted.

6、为redis设置密码

#1.进入redis的容器docker exec -it 容器ID bashcd /usr/local/bin# redis-cli127.0.0.1:6379> config get requirepass1) "requirepass"2) ""127.0.0.1:6379> config set requirepass 123456OK127.0.0.1:6379> config get requirepass1) "requirepass"2) "123456"

7、测试:

127.0.0.1:6379> set ycz "abc"OK127.0.0.1:6379> get ycz"abc"

来源地址:https://blog.csdn.net/weixin_48319193/article/details/131712283

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     807人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     351人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     314人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     433人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     221人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-移动开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯