I am using Tile38 inside a docker container in order to perform geospatial queries. It is a Redis like server that boots up and attaches itself to a primary server and replicates the primary servers data.
The problem is that the clients connecting to the redis(like) server (using Redis libraries) don't comprehend that when the server is booting up and replicating that it is not ready to process data even though it will accept connections and respond to any request with an LOADING: Catching up to leader
error. This causes tons of errors in my clients when they could have just connected to another replica in the pool and gone about their day but wont because this server is available.
I've been writing a wrapper service around Tile38 in order to handle these differences in behavior between a real Redis client and Tile38 but i'm stuck on this one.
My wrapper service knows when the server is up and ready to accept connections so my thought is to start the server up with the incoming ports blocked until its all caught up. At which point it will unblock the ports and allow incoming connections.
I've tried IPTABLES
commands but they always say not authorized even when i'm executing my entrypoint
service as root
. Is there anything i can do to drop connections until i give the all clear?