show map
Use show map
to list map files defined in the configuration.
Description
Use the show map
command to list map files or to display the contents of a particular map file. The contents of the map may be different from what's on disk if you've used the Runtime API to add or delete entries in memory.
For each map file, the show map
command shows the following map file version information:
curr_ver
indicates the currently active version number of the map file.next_ver
indicates the version number of the temporary version (in-progress transaction) of the map file.entry_cnt
indicates the number of entries in the temporary transaction version of the map file.
Examples
In the example below, we use show map
with no arguments to list the map files registered with the load balancer. The output shows the path to the map files and their numeric IDs:
$ echo "show map" | \
sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
# id (file) description
0 (/etc/hapee-2.5/routes.map) pattern loaded from file '/etc/hapee-2.5/routes.map' used by map at file '/etc/hapee-2.5/hapee-lb.cfg' line 61. curr_ver=0 next_ver=2 entry_cnt=2
In this case, there is one map file defined at /etc/hapee-2.5/routes.map
and its ID is 0.
-
Display the contents of the
/etc/hapee-2.5/routes.map
map file by passing its path toshow map
:$ echo "show map /etc/hapee-2.5/routes.map" | \ sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
0x563bbeeee160 /cart/ cart_api 0x563bbeeee1a0 /reviews/ reviews_api 0x563bbeeee200 /products/ products_api 0x563bbeeee280 /login/ login_api 0x563bbeeee300 /chat/ chat_servers
You can also pass it the map's ID prefixed with a hash sign:
$ echo "show map #0" | \ sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
0x563bbeeee160 /cart/ cart_api 0x563bbeeee1a0 /reviews/ reviews_api 0x563bbeeee200 /products/ products_api 0x563bbeeee280 /login/ login_api 0x563bbeeee300 /chat/ chat_servers
You can also show the uncommitted changes in the uncommitted version of a map file:
$ echo "show map @3 #2" | \
sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
See also
Next up
show peers