Persistent instance manager for Redis server processes.
Tracks instances across IEx sessions via a JSON state file. Instances are detached by default so they outlive the Elixir process that started them.
Usage
Manager.start_basic(port: 6400)
Manager.start_cluster(masters: 3, base_port: 7100)
Manager.start_sentinel(master_port: 6390)
Manager.list()
Manager.info("redis-basic-1")
Manager.stop("redis-basic-1")
Manager.cleanup()State is stored at ~/.config/redis-server-wrapper/instances.json.
Summary
Functions
Removes instances from state that are no longer running.
Gets detailed info for a named instance, including live status.
Lists all tracked instances.
Optionally filter by type: :basic, :cluster, :sentinel.
Starts a basic single-node Redis instance.
Starts a Redis Cluster.
Starts a Redis Sentinel topology.
Stops a named instance by sending SHUTDOWN to all its processes.
Stops all tracked instances.
Types
@type instance() :: %{ name: String.t(), type: instance_type(), created_at: String.t(), bind: String.t(), ports: [non_neg_integer()], pids: [non_neg_integer()], password: String.t() | nil, url: String.t(), metadata: map() }
@type instance_type() :: :basic | :cluster | :sentinel
Functions
@spec cleanup() :: {non_neg_integer(), non_neg_integer()}
Removes instances from state that are no longer running.
Gets detailed info for a named instance, including live status.
@spec list(instance_type() | nil) :: [instance()]
Lists all tracked instances.
Optionally filter by type: :basic, :cluster, :sentinel.
Starts a basic single-node Redis instance.
Options
:name- instance name (auto-generated if omitted):port- Redis port (default: 6379):password- Redis password (auto-generated if omitted, passnilfor no auth):bind- bind address (default: "127.0.0.1"):persist- enable persistence (default: false):maxmemory- memory limit (e.g., "256mb"):loadmodule- modules to load; accepts paths or{path, [args]}tuples- Plus any
RedisServerWrapper.Configoptions via:extra
Starts a Redis Cluster.
Options
:name- instance name (auto-generated if omitted):masters- number of masters (default: 3):replicas_per_master- replicas per master (default: 0):base_port- starting port (default: 7100):password- Redis password (auto-generated if omitted):bind- bind address (default: "127.0.0.1"):loadmodule- modules loaded into every cluster node
Starts a Redis Sentinel topology.
Options
:name- instance name (auto-generated if omitted):master_port- master port (default: 6390):replicas- number of replicas (default: 2):sentinels- number of sentinels (default: 3):sentinel_base_port- starting sentinel port (default: 26389):password- Redis password (auto-generated if omitted):bind- bind address (default: "127.0.0.1"):loadmodule- modules loaded into the master and every replica
@spec stop(String.t()) :: :ok | {:error, :not_found}
Stops a named instance by sending SHUTDOWN to all its processes.
@spec stop_all() :: :ok
Stops all tracked instances.