Manually updating Hipache port mappings in Redis - Appsembler

Manually updating Hipache port mappings in Redis

Hipache stores port mappings in Redis on 
isc.appsembler.com. To update port mappings:

  • Open a Redis prompt: `redis-cli -p 63790`
  • You can list all keys in Redis with `KEYS *`
  • For a particular key mapping to a list, you can use `LRANGE <KEY> 0 -1` to view the entire list. For example:
127.0.0.1:63790> LRANGE "frontend:57772-77777777.isc.appsembler.com" 0 -1
1) "77777777"
2) "http://45.55.236.164:44444"
  • Given the example above, we can update the port mapping using RPOP (which pops elements from the right side of the list) and RPUSH (which pushes elements on to the end of the list):
127.0.0.1:63790> RPOP "frontend:57772-77777777.isc.appsembler.com"
"http://45.55.236.164:44444"

127.0.0.1:63790> RPUSH "frontend:57772-77777777.isc.appsembler.com" "http://45.55.236.164:55555"
(integer) 2

127.0.0.1:63790> LRANGE "frontend:57772-77777777.isc.appsembler.com" 0 -1
1) "77777777"
2) "http://45.55.236.164:55555"