Hello,
I'm trying to implement some HA between 2 servers with Consul lock command.
On server1, I launch my program with "consul lock mylock myprogram"
On server2, I do the same.
Initial state is ok :
-server1 has "myprogram" running
-server2 is waiting for the lock
Then a network failure occurs, server1 looses the lock, and server2 tries to acquire it.
What I expect:
-server1 "consul lock" sends a SIGTERM to child process
-server2 acquire the lock and start the program
What I get:
-server1 "consul lock" sends a SIGTERM to child process
-server2 fails to acquire the lock with a message :
ERR] http: Request PUT /v1/kv/mylock/.lock?acquire=2ddce477-91a0-6624-a78e-fdaee01275a3&flags=3304740253564472344, error: rpc error: rpc error: invalid session "2ddce477-91a0-6624-a78e-fdaee01275a3" from=
127.0.0.1:47894
The service is started on server2 but the lock is not held.
I'm using Consul v0.6.4
Am I doing something wrong ?