amazon-web-services - 无法启动 Redis 内存数据存储。 Ubuntu 18.04

标签 amazon-web-services redis ubuntu-18.04

我正在尝试在我的 AWS 服务器上安装 redis。我在上面安装了 Ubuntu 18.04。我正在按照步骤从 digitalocean 安装 redis文章。

当我运行 sudo systemctl status redis 命令时,出现以下错误。

screenshot

我尝试编辑 /etc/systemd/system/redis.service 文件并在 [Service] 部分下添加了 Type=forking 但是仍然出现相同的错误。

谁能建议我如何修复它?

提前致谢。

最佳答案

基于相同的 digitalocean 教程,实际上它运行良好。

运行此命令sudo systemctl restart redis.service,我们得到(在最后一行显示“失败”):

● redis.service - Redis In-Memory Data Store
   Loaded: loaded (/etc/systemd/system/redis.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2021-06-28 12:03:11 +03; 1min 0s ago
  Process: 20428 ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf (code=exited, status=
 Main PID: 20428 (code=exited, status=203/EXEC)

Jun 28 12:03:11 XYZ systemd[1]: redis.service: Service hold-off time over, scheduling restar
Jun 28 12:03:11 XYZ systemd[1]: redis.service: Scheduled restart job, restart counter is at 
Jun 28 12:03:11 XYZ systemd[1]: Stopped Redis In-Memory Data Store.
Jun 28 12:03:11 XYZ systemd[1]: redis.service: Start request repeated too quickly.
Jun 28 12:03:11 XYZ systemd[1]: redis.service: Failed with result 'exit-code'.
Jun 28 12:03:11 XYZ systemd[1]: Failed to start Redis In-Memory Data Store.

但是如果你运行 sudo service redis-server status,我们会得到(在第 3 行显示“running”):

● redis-server.service - Advanced key-value store
   Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-06-28 11:50:13 +03; 19min ago
     Docs: http://redis.io/documentation,
           man:redis-server(1)
  Process: 19278 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 19371 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCC
 Main PID: 19382 (redis-server)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/redis-server.service
           └─19382 /usr/bin/redis-server 127.0.0.1:6379

Jun 28 11:50:13 XYZ systemd[1]: Starting Advanced key-value store...
Jun 28 11:50:13 XYZ systemd[1]: redis-server.service: Can't open PID file /var/run/redis/red
Jun 28 11:50:13 XYZ systemd[1]: Started Advanced key-value store.

找了好几个小时,好像systemctlservice 有什么区别而已,但实际的redis服务器运行正常。如果不是这样,请纠正我。这是链接:https://askubuntu.com/questions/903354/difference-between-systemctl-and-service-commands

你甚至可以通过redis-cli ping检查redis是否工作正常,应该打印PONG

关于amazon-web-services - 无法启动 Redis 内存数据存储。 Ubuntu 18.04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53587818/

相关文章:

redis - 在 sidekiq 容器中设置 redis 配置选项

ssl - 如何修复以下 ansible Galaxy SSL 错误?

amazon-web-services - S3 网站可以访问 API 网关私有(private)端点吗?

amazon-web-services - S3 存储桶访问被拒绝 [悬而未决]

ios - 使用 MQTT 将 iOS 设备连接到 AWS IoT 的最佳方式?

mongodb - 从数据库按时间间隔调度任务的最佳方法

ruby-on-rails - Rails + Sidekiq 不识别类

tesseract - 在 lubuntu 18.04 上安装 tesseract 3.04

ubuntu-18.04 - wxPython wx.adv中的ImportError libSDL2-2.0.so.0

javascript - AWS CDK 中 app.synth() 的用途是什么?