s2db is a sorted set database who speaks redis protocol and stores data on disk.
- Start slave server by
s2db -l <SlaveIp>:<SlavePort> -C0 servername=<SlaveName>
, listening atSlaveIp:SlavePort
. - Start master server by
s2db -l <Ip>:<Port> -C0 slave=<SlaveIp>:<SlavePort>/?Name=<SlaveName>
, listening atIp:Port
.
ServerName (string)
: server's namePassword (string)
: server's passwordSlave (string)
: slave's conn string, minimal form:<SlaveIp>:<SlavePort>/?Name=<SlaveName>
:PullMaster (string)
: master's conn string, minimal form:<MasterIp>:<MasterPort>/?Name=<MasterName>
:MarkMaster (int, 0|1)
: mark server as master, rejecting all PUSHLOGS requestsPassthrough (string)
: relay all read-write commands to the destinated endpoint, minimal form:<Ip>:<Port>/?Name=<Name>
:PingTimeout (int, milliseconds)
: ping timeout of slave, used by masterCacheSize (int)
: cache size (number of cached objects)CacheObjMaxSize (int, kilobytes)
: max allowed size of a cached object, -1 means no object can be cachedSlowLimit (int, milliseconds)
: threshold of recording slow commands into ./log/slow.logResponseLogSize (int, bytes)
: max size of logs master can push to slave in PUSHLOGSBatchMaxRun (int)
: batch operations sizeBatchFirstRunSleep (int, milliseconds)
: time window of grouping continuous deferred commandsCompactLogsTTL (int, seconds)
: TTL of logsMetricsEndpoint (string)
: address of metrics collector, null means recording to internal metrics only
Refer to COMMANDS.txt.
Web console can be accessed at the same address as flag -l
identified, e.g.: http://127.0.0.1:6379
and http://127.0.0.1:6379/debug/pprof/
.
s2db use a Lua dialect called nj
as its script engine, to learn more, refer to this repo.