Rust launcher that orchestrates redis-server (replica), redis-rwproxy, and juicefs mount, then shuts them down in reverse order on SIGINT/SIGTERM or child exit.
CLI args (existing style):
juicefs-mounter <REMOTE> <REPLICA_PORT> <LOCAL_PORT> <USERNAME> <PASSWORD> <DATADIR> <MOUNTPOINT> <ARGS...>
Example:
juicefs-mounter 10.0.0.1:8080 8081 8082 testuser testpassword ~/.test/redis-read-replica ~/test -o allow_other --map-id 1000:2000 --map-id 1500:2500
You can supply the same values via a YAML file and point to it with --config <PATH>. Fields supplied on the CLI override values from the file; trailing ARGS... from the CLI are appended after any args listed in the file.
Sample config.yaml:
remote: "10.0.0.1:8080"
replica_port: 8081
local_port: 8082
username: "testuser"
password: "testpassword"
datadir: "~/.test/redis-read-replica"
mountpoint: "~/test"
args:
- "-o"
- "allow_other"
- "--map-id"
- "1000:2000"
- "--map-id"
- "1500:2500"Run with the config file:
juicefs-mounter --config config.yaml
- Checks TCP connectivity to the remote Redis before starting anything.
- Starts
redis-server(replica), waits for readiness, thenredis-rwproxy, thenjuicefs mount. - Logs child stdout/stderr with a
<name>|prefix. - On SIGINT/SIGTERM or if any child exits, sends SIGTERM in reverse order (juicefs → redis-rwproxy → redis-server), waiting for each to stop before moving on.