Skip to content

Instantly share code, notes, and snippets.

@tillkruss
Last active July 25, 2025 16:50
Show Gist options
  • Save tillkruss/86b61eab32fbf352a0b1e92ba4c0a3ed to your computer and use it in GitHub Desktop.
Save tillkruss/86b61eab32fbf352a0b1e92ba4c0a3ed to your computer and use it in GitHub Desktop.
<?php
$host = "redis-vanilla-0";
$port = 26379;
var_dump("phpredis", phpversion('redis'));
try {
$redis = new Redis([
'host' => $host,
'port' => $port,
// 'auth' => 'secret',
]);
$ping = $redis->ping();
var_dump("client", $ping);
} catch (Throwable $th) {
var_dump("client error", $th);
}
try {
$sentinel = new RedisSentinel([
'host' => $host,
'port' => $port,
// 'auth' => 'secret',
]);
$ping = $sentinel->ping();
var_dump("sentinel", $ping);
$masters = $sentinel->masters();
var_dump("masters", $masters);
} catch (Throwable $th) {
var_dump("sentinel error", $th);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment