tulip / oplogtoredis

Publish MongoDB oplog entries to Redis
Apache License 2.0
38 stars 9 forks source link

Crashing with `Redis ping failed` #20

Closed SimonSimCity closed 5 years ago

SimonSimCity commented 5 years ago

I found the following today in my logs shortly after the docker-container crashed:

2019-07-04T08:57:42.906Z    INFO    oplog/tail.go:173   Oplog cursor timed out, will retry
2019-07-04T09:37:18.312Z    INFO    mgo/cluster.go:652  Waiting for servers to synchronize...
2019-07-04T09:37:18.360Z    INFO    mgo/cluster.go:517  SYNC Starting full topology synchronization...
2019-07-04T09:37:18.425Z    INFO    mgo/cluster.go:207  SYNC Processing server1.mymongo.com:22566...
2019-07-04T09:37:18.425Z    INFO    mgo/server.go:240   Establishing new connection to server1.mymongo.com:22566 (timeout=5s)...
2019-07-04T09:37:18.427Z    INFO    mgo/server.go:264   Connection to server1.mymongo.com:22566 established.
2019-07-04T09:37:18.440Z    INFO    mgo/cluster.go:207  SYNC Processing server2.mymongo.com:22568...
2019-07-04T09:37:18.440Z    INFO    mgo/server.go:240   Establishing new connection to server2.mymongo.com:22568 (timeout=5s)...
2019-07-04T09:37:18.442Z    INFO    mgo/server.go:264   Connection to server2.mymongo.com:22568 established.
2019-07-04T09:37:18.446Z    INFO    mgo/cluster.go:306  SYNC Adding server2.mymongo.com:22568 to cluster as a master.
2019-07-04T09:37:18.461Z    INFO    oplogtoredis/main.go:38 Initialized connection to Mongo
2019-07-04T09:37:18.461Z    INFO    mgo/cluster.go:308  SYNC Adding server1.mymongo.com:22566 to cluster as a slave.
2019/07/04 09:37:18 Error syncing zap log: sync /dev/stderr: invalid argument
panic: Error initializing Redis client: Redis ping failed: EOF

goroutine 1 [running]:
main.main()
    /go/src/github.com/tulip/oplogtoredis/main.go:42 +0x6ca

Have you experienced it before? What could be a reason, and how could it be fixed? I'm sadly not that good with Go ...

benweissmann commented 5 years ago

Sorry for the delayed response; didn't see this issue earlier.

Redis ping failed indicates that when oplogtoredis was starting up, it tried to connect to Redis and send a ping (a simple message just to verify connectivity to the Redis server), and it wasn't able to. This generally indicates an issue with the network connection between the oplogtoredis server, and your Redis server. If you see this again, I'd recommend running redis-cli on the same host as oplogtoredis (or even inside the same docker container) to verify that the network connection between oplogtoredis and Redis is working.