docker pull redis:5.0.7
wget http://download.redis.io/redis-stable/redis.conf
chmod 777 redis.conf
vi /root/docker/redis/redis.conf
bind 127.0.0.1 通过#注释掉,解除本地连接限制
protected-mode yes 默认no,保护模式,限制为本地访问,修改后解除保护模式
daemonize yes 默认no 为不守护进程模式,修改为yes
如果不下载的话,可以使用这个配置实例
protected-mode noport 6379tcp-backlog 511timeout 0tcp-keepalive 300#daemonize nodaemonize nosupervised nopidfile /var/run/redis_6379.pidloglevel noticelogfile ""databases 16always-show-logo yessave 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbrdb-del-sync-files nodir ./replica-serve-stale-data yesreplica-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-diskless-load disabledrepl-disable-tcp-nodelay noreplica-priority 100acllog-max-len 128lazyfree-lazy-eviction nolazyfree-lazy-expire nolazyfree-lazy-server-del noreplica-lazy-flush nolazyfree-lazy-user-del nooom-score-adj nooom-score-adj-values 0 200 800appendonly noappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yesaof-use-rdb-preamble yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events ""hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-size -2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000stream-node-max-bytes 4096stream-node-max-entries 100activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit replica 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10dynamic-hz yesaof-rewrite-incremental-fsync yesrdb-save-incremental-fsync yesjemalloc-bg-thread yes docker run -p 6379:6379 --name redis --privileged=true -v /root/docker/redis/redis.conf:/etc/redis/redis.conf -v /root/docker/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes --requirepass 123456免责声明:文章源自网络,版权归原作者所有,如有侵犯联系删除。