首页 > 数据库 >docker,redis速拉

docker,redis速拉

时间:2022-11-25 14:33:18浏览次数:40  
标签:myredis no max redis 速拉 docker yes

记录docker快速拉取redis
1.搜索
docker search redis
2.拉取
docker pull redis
3.路径
mkdir -p /home/redis/myredis/data
cd /home/redis/myredis/
4.配置


vim myredis.conf
myredis.conf详细
# bind 192.168.6.240 

protected-mode no

port 6379

tcp-backlog 511

requirepass 123456

timeout 0

tcp-keepalive 300

daemonize no

supervised no

pidfile /var/run/redis_6379.pid

loglevel notice

logfile ""

databases 30

always-show-logo yes

save 900 1
save 300 10
save 60 10000

stop-writes-on-bgsave-error yes

rdbcompression yes

rdbchecksum yes

dbfilename dump.rdb

dir ./

replica-serve-stale-data yes

replica-read-only yes

repl-diskless-sync no

repl-disable-tcp-nodelay no

replica-priority 100

lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no

appendonly yes

appendfilename "appendonly.aof"

no-appendfsync-on-rewrite no

auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

aof-load-truncated yes

aof-use-rdb-preamble yes

lua-time-limit 5000

slowlog-max-len 128

notify-keyspace-events ""

hash-max-ziplist-entries 512
hash-max-ziplist-value 64

list-max-ziplist-size -2

list-compress-depth 0

set-max-intset-entries 512

zset-max-ziplist-entries 128
zset-max-ziplist-value 64

hll-sparse-max-bytes 3000

stream-node-max-bytes 4096
stream-node-max-entries 100

activerehashing yes

hz 10

dynamic-hz yes

aof-rewrite-incremental-fsync yes

rdb-save-incremental-fsync yes

5.运行
docker run --restart=always --log-opt max-size=100m --log-opt max-file=2 -p 6379:6379 --name myredis -v /home/redis/myredis/myredis.conf:/etc/redis/redis.conf -v /home/redis/myredis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes --requirepass 123456
6.进入redis交互
docker exec -it myredis redis-cli
确认密码
auth 123456
创建

标签:myredis,no,max,redis,速拉,docker,yes
From: https://www.cnblogs.com/yimouz-219/p/16925005.html

相关文章

  • Redis的那些最常见面试问题
    1.什么是redis?Redis是一个基于内存的高性能key-value数据库。  2.Reids的特点Redis本质上是一个Key-Value类型的内存数据库,很像memcached,整个数据库统统加载在内存......
  • 更改docker存储路径
    docker默认存储路径是/var/lib/docker,占用服务器根分区。容易导致磁盘空间占满停止docker1systemctlstopdocker创建新的存储路径1mkdir/home/docker-p迁移......
  • 令牌桶限流思路分享(PHP+Redis实现机制)
    一、场景描述 在开发接口服务器的过程中,为了防止客户端对于接口的滥用,保护服务器的资源,通常来说我们会对于服务器上的各种接口进行调用次数的限制。比如对于某个用户,他......
  • php与Redis实现一个100万用户的投票项目,实现实时查看投票情况?
    微信分享里总是有一些亲子活动,或者参加某些大赛需要进行投票,而面向的是所有人都可以参与,或者有限制一个人每天能投票同一个参与者3票之类的。。。这些应用场景有很多。假如......
  • PHP操作Redis
    redis的基本操作方法1.redis的连接://实例化redis$redis=newRedis();//连接$redis->connect('127.0.0.1',6379);//检测是否连接成功echo"Serverisrunning:".$r......
  • docker中常用的命令
    一、docker的基础命令1.docker的帮助命令//命令docker--help[root@localhost~]#docker--helpUsage:docker[OPTIONS]COMMANDAself-sufficientruntime......
  • Redis安装
    Redis安装redis简介https://blog.csdn.net/qq_27870421/article/details/103292904下载地址Redis官方网站Redis中文官方网站安装版本6.2.6forLinux(redis-6.2.7.......
  • Redis分页
    <?phpclassRedisPage{protected$_redis;protected$_redis_ip;protected$_redis_port;protected$_redis_db;protected$_hash_prefix;/**......
  • PHP+Redis实现分页
    废话少说,上代码吧<?phpclassRedisPage{protected$_redis;protected$_redis_ip;protected$_redis_port;protected$_redis_db;protected$_has......
  • Redis 锁的使用
    <?php/***RedisdistributedlocksinPHP*@authorassasin<>*/classRedisLock{private$retryDelay;private$retryCount;private$clockDriftFactor......