Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run Redis in the background?

Tags:

redis

I need Redis running while I work on a particular codebase. I often open a new terminal and run it there. How can I run it in the background?

like image 957
Nathan Long Avatar asked Jul 24 '15 12:07

Nathan Long


People also ask

How do I run Redis locally?

To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.

How do I start Redis in the background Mac?

Use redis-server & On Linus or OSX, an easy way to run a process in the background is to follow the command with & . You can see that it's still running with ps -ef | grep redis (or pgrep redis-server ) and stop it with pkill redis-server .

How do I know if Redis is running?

you can do it by this way. $redis = new Redis(); $redis->connect('127.0. 0.1', 6379); echo $redis->ping(); and then check if it print +PONG , which show redis-server is running.

How to run Redis server on Windows?

For windows: 1 Step 1: Install redis as a service#N#redis-server --server-install 2 Step 2: Run background More ...

How do I daemonize Redis?

Set daemonize to yes in the config file. Say the file is ~/.redis/redis.conf, then just run And it just works. Show activity on this post.

How do I set up Redis on Docker?

docker run -d --cap-add sys_resource --name rp -p 8443:8443 -p 9443:9443 -p 12000:12000 redislabs/redis In the web browser on the host machine, go to https://localhost:8443 to see the Redis Enterprise Software web console. Click Setup to start the node configuration steps.

How to pass Redis configuration parameters using the command line?

Since Redis 2.6 it is possible to pass Redis configuration parameters using the command line directly. This is very useful for testing purposes. Show activity on this post. # 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


3 Answers

Or run the following

/usr/local/bin/redis-server --daemonize yes

like image 173
Stan Sokolov Avatar answered Oct 24 '22 08:10

Stan Sokolov


Use redis-server &

On Linus or OSX, an easy way to run a process in the background is to follow the command with &.

You can see that it's still running with ps -ef | grep redis (or pgrep redis-server) and stop it with pkill redis-server.

like image 25
Nathan Long Avatar answered Oct 24 '22 08:10

Nathan Long


I know this is an old question but I am answering just for the reference.

You need to set daemonize yes from daemonize no in your redis.conf

Reference: https://blog.art-coder.com/2011/12/01/how-to-run-redis-server-as-daemon/

like image 23
sadaf Avatar answered Oct 24 '22 08:10

sadaf