why does running redis-server & display output to console?

4,638 views
Skip to first unread message

S Ahmed

unread,
Dec 17, 2011, 8:12:10 AM12/17/11
to redi...@googlegroups.com
Just firing up a vm to test things out, and when I manually install redis-server and then run it using:

redis-server &

(trying to run it in the background so I can continue working/benchmarking on the vm)
It seems to output things to the console, am I doing this wrong?

Alexander Zhuravlev

unread,
Dec 17, 2011, 8:28:18 AM12/17/11
to redi...@googlegroups.com

If you do not pass a path to redis-server it starts up with a default
config. In default configuration redis works in foreground.

You need to open redis.conf in the root of the redis distribution, set
configuration option daemonize to yes and start the server as follows:

./redis-server ../redis.conf

--
Alexander Zhuravlev

S Ahmed

unread,
Dec 17, 2011, 8:57:59 AM12/17/11
to redi...@googlegroups.com
I see, thanks for the tip.


--
Alexander Zhuravlev

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.


Scott Smith

unread,
Dec 17, 2011, 11:43:38 AM12/17/11
to redi...@googlegroups.com, redi...@googlegroups.com
Otherwise you need to redirect standard out to another file descriptor.

Josiah Carlson

unread,
Dec 18, 2011, 1:03:45 AM12/18/11
to redi...@googlegroups.com
For the OP: check out 'man nohup'. It does exactly what you want to
do, and writes stdout/stderr to a file automatically.

Regards,
- Josiah

S Ahmed

unread,
Dec 18, 2011, 6:58:32 PM12/18/11
to redi...@googlegroups.com
I'm on ubuntu and it seems the version of redis is 2.0.1 or something.

I'm doing some simple benchmarks and like the convieninece of not having ot manually build and setup the startup scripts etc.

Are there any big changes performance wise in the latest version? Or any memory leaks/major bugs in older versions?

BTW, where should I be looking for the redis.conf?

S Ahmed

unread,
Dec 18, 2011, 7:00:55 PM12/18/11
to redi...@googlegroups.com
Exciting to test things out on a real server (I was doing VM's before), and I am on:
Ubuntu 10.04.3 LTS \n \l

When I installed redis-server from the default package, and try and run redis-cli I see this:

usage: redis-cli [-h host] [-p port] [-r repeat_times] [-n db_num] cmd arg1 arg2 arg3 ... argN
usage: echo "argN" | redis-cli [-h host] [-p port] [-r repeat_times] [-n db_num] cmd arg1 arg2 ... arg(N-1)

If a pipe from standard input is detected this data is used as last argument.

example: cat /etc/passwd | redis-cli set my_passwd
example: redis-cli get my_passwd
example: redis-cli -r 100 lpush mylist x

When testing things on 11.04 I guess it was more up-to-date version as it went into cli no problem.

Even doing redis-server --version gives me (as root) : 
18 Dec 18:00:32 * Fatal error, can't open config file

Greg Andrews

unread,
Dec 18, 2011, 10:04:30 PM12/18/11
to redi...@googlegroups.com
The Ubuntu 10.04 package installs a two year old version of Redis (v1.2.0).  It's not really worth bothering with that version, in my opinion.

The Ubuntu 11.04 package is better - it installs 2.0.1 (just over one year old), and puts the configuration files in /etc/redis.  My workplace standardized on 2.0.1, and we've been installing the 11.04 package on 10.04 servers without any ill effects so far as we know.

However, 2.0.1 has a simple master/slave replication protocol that can sometimes fail to notice that the connection to the master has gone away.  I had to write an extra test into my Nagios plug-in to detect that replication problem.  v2.2.x (I don't remember which one) improved the replication protocol to detect lost connections and re-connect.

  -Greg

Josiah Carlson

unread,
Dec 19, 2011, 12:45:06 PM12/19/11
to redi...@googlegroups.com
Also, more recent versions of Redis have a better memory allocator
included by default (jemalloc), reducing memory fragmentation and
improving performance overall.

Regards,
- Josiah

S Ahmed

unread,
Dec 19, 2011, 2:24:33 PM12/19/11
to redi...@googlegroups.com
thanks, I found a tutorial that held my hand through buildng from source and setting up startup scripts etc.

KH Cheng

unread,
Jan 9, 2015, 12:40:16 AM1/9/15
to redi...@googlegroups.com
redis-server --daemonize yes

will run the server in the background without showing the logs to your terminal

For more configuration information, check out http://redis.io/topics/config
Reply all
Reply to author
Forward
0 new messages