Cannot execute redis-cli commands

1,012 views
Skip to first unread message

Cliff Court

unread,
Mar 25, 2015, 6:34:46 AM3/25/15
to redi...@googlegroups.com
Hi All

I'm a newbie to redis. I'm running on Ubuntu 12.10

I went through the install instructions, which appeared to execute OK.

When I run redis-server (no parameters), it seems to run OK, except for a few config errors which the docs indicate can be expected because I don't have a redis.conf files setup yet. At the end of the run, it says "The server is now ready to accept connections on port 6379", but it does not return to the OS command prompt. It just sits/hangs there.

I've tried typing a ping command, but it stills just hangs there, 

If I exit out with Ctrl-Z, and run redis-cli, it goes into the program with a command prompt of 127.0.0.1:6379>, which is the default from my understanding. But I can't execute any commands like ping etc. It will accept help and quit i.e. those that don't access the DB.

I'm guessing that the redis-server is not running on the 127.0.0.1 IP address or the port 6379, but I'm hoping someone can point me in the right direction to fix this?

Many thanks
Cliff

Itamar Haber

unread,
Mar 25, 2015, 6:45:19 AM3/25/15
to redi...@googlegroups.com
After running redis-server, try opening another terminal window and using redis-cli from it. Alternatively, after you CTRL+Z, issue `bg` at the prompt to put the server in running the background and then run redis-cli.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Chief Developers Advocate
Redis Watch Newsletter - Curator and Janitor
Redis Labs - Enterprise-Class Redis for Developers

Mobile: +1 (415) 688 2443
Mobile (IL): +972 (54) 567 9692
Email: ita...@redislabs.com
Skype: itamar.haber

Blog  |  Twitter  |  LinkedIn


Jan-Erik Rediger

unread,
Mar 25, 2015, 6:50:57 AM3/25/15
to redi...@googlegroups.com
If you simply run `redis-server` it will run in the foreground and _not_
return to the command line as you already figured out.
You have to run `redis-cli` in another terminal to access it.

If you want to run it in the background use `redis-server --daemonize yes`
or set `daemonize yes` in the config file.
In that case, you can re-use the existing shell to send commands to it.
Reply all
Reply to author
Forward
0 new messages