2

i have a question here..

i already install redis-server on my CentOS vps for my wordpress frontend cache.. but i have a little problem here..

sometimes my redis-server was closed/disconnected suddenly, and i must have to restart it manually using command

/etc/init.d/redis-server start

my question is..

how to auto start the redis-server if my redis-server down or crashed suddenly..

i install redis using this tutorial http://www.saltwebsites.com/2012/install-redis-245-service-centos-6

great thanks before

4

3 回答 3

2

如果我的 redis 服务器突然关闭或崩溃,如何自动启动 redis 服务器

尝试查看像upstartmonit这样的工具,如果它意外死亡,它们可以用来重生 redis。

于 2012-11-16T08:02:34.190 回答
1

如果您将 docker 与 docker-compose 一起使用:

version: '3'

services:
  redis:
    container_name: "redis"
    image: redis:5.0.3-alpine
    command: ["redis-server", "--appendonly", "yes"]
    hostname: redis
    ports:
      - "6339:6379"
    volumes:
      - /opt/docker/redis:/data
    restart:
      always

看最后一行: 重启:总是

于 2019-01-03T10:57:03.510 回答
0

我不太清楚centos 和 linux

sudo systemctl enable redis_6379

上面的工作就像魅力一样,上面将在 /etc/systemd/system/redis_6379.service 中创建一个符号链接。

于 2019-06-07T10:31:52.760 回答