Deployment
Deployment
This page covers a single-node MemCP service from build through shutdown and upgrade. A production deployment must choose a durability ENGINE, protect credentials and listeners, provide a writable data directory or configured remote backend, and install the executable together with the exact matching Scheme libraries and assets.
MemCP is currently Beta. Treat deployment as an operational workflow rather than merely starting a binary: establish backups, restart tests, resource limits, monitoring, upgrade rollback, and application-level compatibility checks before accepting production traffic. Multi-node ownership and failover are not yet provided by the Cluster Monitor.
Build and run
git clone https://github.com/launix-de/memcp cd memcp go mod download make ./memcp -data /var/lib/memcp --no-repl \ --api-port=4321 --mysql-port=3307 \ --root-password='replace-on-first-start' lib/main.scm
--root-password initializes a fresh data directory only. Never expose the HTTP or MySQL port using root/admin. Put the service behind the intended firewall or reverse proxy and protect the data directory and configuration file.
Interfaces
| Interface | Default |
|---|---|
| HTTP SQL/dashboard | TCP 4321 |
| MySQL protocol | TCP 3307 |
| MySQL Unix socket | /tmp/memcp.sock
|
| Data directory | ./data
|
Disable unused listeners with --disable-api, --disable-mysql, or an empty socket setting. Use --config=FILE for one argument per line; explicit command line options override configuration entries.
Service installation
MemCP supplies make install, Debian and RPM package targets, systemd lifecycle scripts, and make memcp.sif for Singularity/Apptainer. Packages install the binary and Scheme libraries in system paths and provide service configuration. Review paths and credentials before starting the service.
For a source checkout, PM2 remains a lightweight supervisor option:
pm2 start ./memcp --name memcp -- \ --no-repl -data /var/lib/memcp \ --api-port=4321 --mysql-port=3307 lib/main.scm pm2 save
After rebuilding, restart the named process with pm2 restart memcp. Keep the binary, lib/ and assets/ from the same commit. Docker is the other common deployment path; it consumes additional image/runtime resources but provides a reproducible bundle and a persistent /data volume. See Install MemCP with Docker.
Shutdown and upgrades
SIGTERM/SIGINT stops new work, drains in-flight requests up to ShutdownDrainSeconds, and closes storage. Before upgrading persistent data:
- back up the data directory or remote backend;
- read serialization and durability notes for the target release;
- stop MemCP cleanly;
- install the new binary and matching
lib//assets/files; - start it and verify logs, schema, representative reads/writes, and restart.
Do not copy only the binary while retaining incompatible Scheme libraries. See Install MemCP with Docker, Storage Backends, and Persistency and Performance Guarantees.