想要在后台不间断地运行redis-server [英] want to run redis-server in background nonstop

查看:250
本文介绍了想要在后台不间断地运行redis-server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了redis-2.6.16.tar.gz文件,并且安装成功.安装后,我运行src/redis-server可以正常工作.

I have downloaded redis-2.6.16.tar.gz file and i installed sucessfully. After installed i run src/redis-server it worked fine.

但是我不想每次都手动运行src/redis-server,而是希望redis-server连续作为后台进程运行.

But i don't want manually run src/redis-server everytime, rather i want redis-server running as background process continuously.

到目前为止,安装后我已完成以下任务:

So far after installed i did following tasks:

1. vim redis.conf,我更改为

1. vim redis.conf and i changed to

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
  daemonize yes

但是我发现了相同的结果.我犯了什么错误?

But same result i found. What mistake i did?

在Redis之后在后台运行.我还将使用以下命令将剑圣作为后台进程运行.

After redis run in background. I will run juggernaut also as background process with following command.

nohup node server.js

但是我无法使Redis在后台运行.请提供一些解决方案.

But i am not able to make redis run in background. Please provide some solution.

推荐答案

从Redis 2.6开始,可以直接使用命令行传递Redis配置参数.这对于测试非常有用.

Since Redis 2.6 it is possible to pass Redis configuration parameters using the command line directly. This is very useful for testing purposes.

redis-server --daemonize yes

检查该过程是否开始:

ps aux | grep redis-server

这篇关于想要在后台不间断地运行redis-server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆