Når du vil bruge curl, skal du bruge REST over RESP, som webdis, tinywebdis eller turbowebdis. Se https://github.com/markuman/tinywebdis#turbowebdis-tinywebdis--cherrywebdis
$ curl -w '\n' http://127.0.0.1:8888/ping
{"ping":"PONG"}
Uden en REST-grænseflade til redis kan du f.eks. bruge netcat.
$ (printf "PING\r\n";) | nc <redis-host> 6379
+PONG
For adgangskodebeskyttet redis kan du bruge netcat som denne:
$ (printf "AUTH <password>\r\n";) | nc <redis-host> 6379
+PONG
Med netcat skal du bygge RESP-protokollen på egen hånd. Se http://redis.io/topics/protocol
opdatering 2018-01-09
Jeg har bygget en kraftfuld bash-funktion, som pinger redis-forekomsten for enhver pris over tcp
function redis-ping() {
# ping a redis server at any cost
redis-cli -h $1 ping 2>/dev/null || \
echo $((printf "PING\r\n";) | nc $1 6379 2>/dev/null || \
exec 3<>/dev/tcp/$1/6379 && echo -e "PING\r\n" >&3 && head -c 7 <&3)
}
brug redis-ping localhost