Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Redis Debugging
Description: Simple commands to help debug a redis server.Tutorial Level: INTERMEDIATE
Next Tutorial: Launching a Gateway Hub
Overview
This tutorial is useful to developers who are directly utilising the hub's redis server.
The Redis Server
The rocon hub redis server uses its own redis server (doesn't use your system's default redis server). This is done to keep the configuration very low on memory usage and conflict free. The port it runs on can be configured by rosparam and by default it runs on port 6380.
> roslaunch rocon_hub hub.launch
Command Line Access
Connecting to the redis server is much like any other database (e.g. mysql).
> redis-cli -p 6380
Cheat Sheet
info - get information and statistics about the server monitor - starts streaming every command processed by redis to the console flushall - Remove all data keys * - show all keys stored set <key> - set a single key get <key> - get a single key's value sadd <key> <value> [<value>...] - add one or more members to a set srem <key> <value> - remove one or more members from a set smembers <key> - returns a list of members
Examples
For the default rocon hub startup above...
> redis 127.0.0.1:6380> keys * 1) "rocon:hub:index" 2) "rocon:hub:name"
> redis 127.0.0.1:6380> get rocon:hub:name "Rocon Hub"
Start monitoring, dynamically, all interactions on the redis server.
> redis 127.0.0.1:6380> monitor