Reference
show map
Use show map
to list map files defined in the configuration.
Description Jump to heading
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.
As of version 2.4r1
, the show map
command shows the following map file version information for each map file:
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 Jump to heading
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:
bash
echo "show map" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "show map" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputbash
# id (file) description0 (/etc/hapee-2.8/routes.map) pattern loaded from file '/etc/hapee-2.8/routes.map' used by map at file '/etc/hapee-2.8/hapee-lb.cfg' line 61. curr_ver=0 next_ver=2 entry_cnt=2
outputbash
# id (file) description0 (/etc/hapee-2.8/routes.map) pattern loaded from file '/etc/hapee-2.8/routes.map' used by map at file '/etc/hapee-2.8/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.8/routes.map
and its ID is 0.
-
Display the contents of the
/etc/hapee-2.8/routes.map
map file by passing its path toshow map
:bashecho "show map /etc/hapee-2.8/routes.map" | \sudo socat stdio tcp4-connect:127.0.0.1:9999bashecho "show map /etc/hapee-2.8/routes.map" | \sudo socat stdio tcp4-connect:127.0.0.1:9999outputbash0x563bbeeee160 /cart/ cart_api0x563bbeeee1a0 /reviews/ reviews_api0x563bbeeee200 /products/ products_api0x563bbeeee280 /login/ login_api0x563bbeeee300 /chat/ chat_serversoutputbash0x563bbeeee160 /cart/ cart_api0x563bbeeee1a0 /reviews/ reviews_api0x563bbeeee200 /products/ products_api0x563bbeeee280 /login/ login_api0x563bbeeee300 /chat/ chat_serversYou can also pass it the map’s ID prefixed with a hash sign:
bashecho "show map #0" | \sudo socat stdio tcp4-connect:127.0.0.1:9999bashecho "show map #0" | \sudo socat stdio tcp4-connect:127.0.0.1:9999outputbash0x563bbeeee160 /cart/ cart_api0x563bbeeee1a0 /reviews/ reviews_api0x563bbeeee200 /products/ products_api0x563bbeeee280 /login/ login_api0x563bbeeee300 /chat/ chat_serversoutputbash0x563bbeeee160 /cart/ cart_api0x563bbeeee1a0 /reviews/ reviews_api0x563bbeeee200 /products/ products_api0x563bbeeee280 /login/ login_api0x563bbeeee300 /chat/ chat_servers
As of version 2.4r1
, you can also show the uncommitted changes in the uncommitted version of a map file:
bash
echo "show map @3 #2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "show map @3 #2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
See also Jump to heading
If this page was useful, please, Leave the feedback.