You picked Manticore Search because the legacy Sphinx-based search inside the application ran for a decade and the migration path is “edit the connection string.” The catch is the legacy stack ran a single searchd against a single VM, and you now want three nodes with replicated real-time indexes — write to any node, read from any node, lose a node without an incident. Manticore 6.x supports this natively via Galera-based replication groups plus distributed indexes with mirror agents, but the documentation assumes you already know the SphinxQL idioms and skips over the operational details of running it under systemd with a backup story. This is the installer that closes that gap.
What’s happening
A clustered Manticore deployment has two replication primitives, and they are not interchangeable. The first is the replication cluster — a Galera-flavoured write-set replication group across three (or more) nodes. You create a cluster on node 1 with CREATE CLUSTER mc_cluster, then JOIN CLUSTER mc_cluster AT '10.10.0.61:9312' on nodes 2 and 3. Indexes added to the cluster (ALTER CLUSTER mc_cluster ADD products) are replicated synchronously across all members. This is the right tool for write-heavy, durability-critical indexes — every transaction is acknowledged by a quorum before commit.
The second primitive is distributed indexes with mirror agents. A distributed index idx_dist is a logical index that fans out to N “agents” (other searchd instances on other nodes) and merges results. With agent_persistent and ha_strategy = roundrobin, a single SELECT against idx_dist sprays to all healthy mirrors, and a downed mirror is automatically excluded. This is the right tool for read scale-out — you replicate slowly-changing indexes by hand (or by INDEXER batch jobs) to N nodes and use the distributed index as the read facade.
Production deploys typically use both: the realtime indexes that take live writes go in a replication cluster (synchronous, slower-write, durable); the indexer-built indexes that take batch writes are mirrored manually with rsync and read through distributed indexes (fast, eventually consistent, cheap to scale).
The binlog story: searchd writes a binlog per realtime index for crash recovery. Set binlog_path = /var/lib/manticore/binlog and binlog_flush = 1 (flush every commit) for durability; binlog_max_log_size controls rotation. Backups are: a daily BACKUP INDEX SQL call to dump a consistent snapshot to a dedicated path, then rclone-to-S3, plus the binlog as the WAL story for point-in-time recovery.
How to verify
Cluster status from any node via SphinxQL on port 9306:
mysql -h 10.10.0.61 -P 9306 -e "SHOW STATUS LIKE 'cluster_%'"
# cluster_name = mc_cluster
# cluster_status = synced
# cluster_size = 3
# cluster_ready = yes
Each node sees the other two:
mysql -h 10.10.0.61 -P 9306 -e "SHOW STATUS LIKE 'cluster_node_state'"
# cluster_node_state = primary
mysql -h 10.10.0.62 -P 9306 -e "SHOW STATUS LIKE 'cluster_node_state'"
mysql -h 10.10.0.63 -P 9306 -e "SHOW STATUS LIKE 'cluster_node_state'"
A distributed index resolves all agents healthy:
mysql -h 10.10.0.61 -P 9306 -e "SHOW AGENT STATUS"
# Every agent line should show ha_strategy=roundrobin and a non-zero
# success_count, with last_query_time below your alert threshold.
Binlog flushing:
ls -lh /var/lib/manticore/binlog/
mysql -h 10.10.0.61 -P 9306 -e "SHOW STATUS LIKE 'binlog%'"
The fix
Save the script as /root/setup-manticore-node.sh and run it on each of the three Ubuntu 22.04 nodes. The installer handles base hardening, the official Manticore APT repository, a per-node /etc/manticoresearch/manticore.conf (the file Manticore 6 calls a “config” but is really a daemon config — index definitions live in SphinxQL CREATE TABLE statements), the systemd unit with raised file limits, firewall rules for port 9312 (binary protocol, cluster + agents) and 9306 (SphinxQL/MySQL), a backup timer that calls BACKUP INDEX daily and rclones the output, and post-install commands to print on each node so you can run them by hand and watch the cluster form.
#!/usr/bin/env bash
set -euo pipefail
### Ubuntu 22.04 Manticore Search 6.x cluster installer
### Run on each of 3 nodes; after install, manually run the SQL commands printed
### at the end on node 1 (CREATE CLUSTER) then nodes 2/3 (JOIN CLUSTER).
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run as root."
exit 1
fi
# === EDIT PER NODE ===
NODE_NAME="mc01"
NODE_IP="10.10.0.61"
PEER_IPS=("10.10.0.61" "10.10.0.62" "10.10.0.63")
PEER_NAMES=("mc01" "mc02" "mc03")
CLUSTER_NAME="mc_cluster"
S3_ENDPOINT="s3.us-east-2.wasabisys.com"
S3_BUCKET="acme-mc-backups"
S3_ACCESS_KEY="CHANGE_ME"
S3_SECRET_KEY="CHANGE_ME"
# =====================
echo
echo "========================================"
echo "Manticore node ${NODE_NAME} (${NODE_IP})"
echo "========================================"
echo
echo "==> Updating base OS"
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
apt-get -y install curl wget gnupg apt-transport-https ca-certificates \
ufw fail2ban unattended-upgrades chrony jq socat net-tools dnsutils \
mysql-client rsync rclone
systemctl enable --now chrony
echo "==> Kernel/sysctl"
cat > /etc/sysctl.d/99-manticore.conf <<'SYSCTL'
fs.file-max = 2097152
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.ip_local_port_range = 10240 65535
SYSCTL
sysctl --system
cat > /etc/security/limits.d/99-manticore.conf <<'LIMITS'
manticore soft nofile 65535
manticore hard nofile 65535
LIMITS
echo "==> Hardening SSH"
sed -i 's|^[#[:space:]]*PermitRootLogin.*|PermitRootLogin prohibit-password|' /etc/ssh/sshd_config
sed -i 's|^[#[:space:]]*PasswordAuthentication.*|PasswordAuthentication no|' /etc/ssh/sshd_config
sshd -t && systemctl restart ssh
echo "==> UFW: allow peer-only access to 9312, app access to 9306"
ufw --force reset
ufw default deny incoming
ufw default allow outgoing
ufw allow OpenSSH
for p in "${PEER_IPS[@]}"; do
ufw allow from "$p" to any port 9312 proto tcp
ufw allow from "$p" to any port 9306 proto tcp
# Galera SST port range
ufw allow from "$p" to any port 9315:9325 proto tcp
done
ufw allow 9306/tcp comment "Manticore SphinxQL — restrict to app subnet in prod"
ufw --force enable
cat > /etc/fail2ban/jail.d/sshd.local <<'FAIL2BAN'
[sshd]
enabled = true
port = ssh
backend = systemd
maxretry = 4
findtime = 10m
bantime = 1h
FAIL2BAN
systemctl enable --now fail2ban
echo "==> Adding Manticore APT repository"
wget -qO /tmp/manticore-repo.deb \
https://repo.manticoresearch.com/manticore-repo.noarch.deb
dpkg -i /tmp/manticore-repo.deb
rm -f /tmp/manticore-repo.deb
apt-get update
apt-get -y install manticore manticore-extra
apt-mark hold manticore manticore-extra
echo "==> Stopping default service to write our config"
systemctl stop manticore || true
echo "==> /etc/manticoresearch/manticore.conf"
mkdir -p /var/lib/manticore /var/log/manticore /var/lib/manticore/binlog
chown -R manticore:manticore /var/lib/manticore /var/log/manticore
cat > /etc/manticoresearch/manticore.conf <<EOF
common {
plugin_dir = /usr/share/manticore/modules
lemmatizer_base = /usr/share/manticore
}
searchd {
listen = ${NODE_IP}:9312
listen = ${NODE_IP}:9306:mysql
listen = ${NODE_IP}:9308:http
listen = ${NODE_IP}:9315-9325:replication
log = /var/log/manticore/searchd.log
query_log = /var/log/manticore/query.log
query_log_format = sphinxql
read_timeout = 30
client_timeout = 600
max_connections = 1024
pid_file = /run/manticore/searchd.pid
data_dir = /var/lib/manticore
binlog_path = /var/lib/manticore/binlog
binlog_flush = 1
binlog_max_log_size = 256M
# Production-grade: require auth for the cluster API
shutdown_timeout = 30s
network_timeout = 5s
# Distributed-index agent defaults
agent_connect_timeout = 1000
agent_query_timeout = 3000
ha_period_karma = 60
ha_ping_interval = 1000
}
EOF
chown root:manticore /etc/manticoresearch/manticore.conf
chmod 640 /etc/manticoresearch/manticore.conf
mkdir -p /run/manticore
chown manticore:manticore /run/manticore
echo "==> systemd override for limits + tmpfiles"
mkdir -p /etc/systemd/system/manticore.service.d
cat > /etc/systemd/system/manticore.service.d/override.conf <<'OV'
[Service]
LimitNOFILE=65535
Restart=on-failure
RestartSec=5s
RuntimeDirectory=manticore
RuntimeDirectoryMode=0755
OV
systemctl daemon-reload
systemctl enable --now manticore
echo "==> Waiting for SphinxQL on :9306"
for i in {1..30}; do
if mysql -h "${NODE_IP}" -P 9306 -e "SELECT 1" >/dev/null 2>&1; then break; fi
sleep 2
done
echo "==> /usr/local/bin/mc-backup.sh (daily BACKUP INDEX + rclone)"
cat > /usr/local/bin/mc-backup.sh <<'BCK'
#!/usr/bin/env bash
set -euo pipefail
NODE_IP="$(awk '/listen = .*:9306/ {gsub(/listen = /,""); split($0,a,":"); print a[1]; exit}' /etc/manticoresearch/manticore.conf)"
STAMP=$(date -u +"%Y%m%dT%H%M%SZ")
DEST="/var/lib/manticore/backups/${STAMP}"
mkdir -p "$DEST"
chown manticore:manticore "$DEST"
# Run BACKUP for every replicated index on this node
INDEXES=$(mysql -h "${NODE_IP}" -P 9306 -BNe "SHOW TABLES" | awk '{print $1}')
for idx in $INDEXES; do
mysql -h "${NODE_IP}" -P 9306 -e "BACKUP ${idx} TO '${DEST}'" || true
done
# Push to S3
rclone sync "$DEST" "wasabi:acme-mc-backups/${STAMP}/" --transfers=4 --checkers=8 || true
# Keep 14 days locally
find /var/lib/manticore/backups/ -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf {} \;
BCK
chmod 750 /usr/local/bin/mc-backup.sh
cat > /etc/systemd/system/mc-backup.service <<'SVC'
[Unit]
Description=Manticore daily BACKUP INDEX
After=manticore.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/mc-backup.sh
SVC
cat > /etc/systemd/system/mc-backup.timer <<'TMR'
[Unit]
Description=Daily Manticore BACKUP at 02:30
[Timer]
OnCalendar=*-*-* 02:30:00
Persistent=true
RandomizedDelaySec=10min
[Install]
WantedBy=timers.target
TMR
mkdir -p /root/.config/rclone
cat > /root/.config/rclone/rclone.conf <<EOF
[wasabi]
type = s3
provider = Wasabi
access_key_id = ${S3_ACCESS_KEY}
secret_access_key = ${S3_SECRET_KEY}
endpoint = ${S3_ENDPOINT}
acl = private
EOF
chmod 600 /root/.config/rclone/rclone.conf
systemctl daemon-reload
systemctl enable --now mc-backup.timer
echo
echo "========================================"
echo "DONE — ${NODE_NAME}"
echo "========================================"
echo
echo "Listeners:"
ss -lntp | grep -E ':(9306|9308|9312)\b' || true
echo
echo "Manticore version + status:"
mysql -h "${NODE_IP}" -P 9306 -e "SHOW STATUS LIKE 'version'; SHOW STATUS LIKE 'uptime';" || true
echo
echo "==> NEXT STEPS (run by hand once all 3 nodes are up):"
echo
echo " On ${PEER_NAMES[0]} (${PEER_IPS[0]}):"
echo " mysql -h ${PEER_IPS[0]} -P 9306 -e \"CREATE CLUSTER ${CLUSTER_NAME}\""
echo
echo " On ${PEER_NAMES[1]} (${PEER_IPS[1]}):"
echo " mysql -h ${PEER_IPS[1]} -P 9306 -e \"JOIN CLUSTER ${CLUSTER_NAME} AT '${PEER_IPS[0]}:9312'\""
echo
echo " On ${PEER_NAMES[2]} (${PEER_IPS[2]}):"
echo " mysql -h ${PEER_IPS[2]} -P 9306 -e \"JOIN CLUSTER ${CLUSTER_NAME} AT '${PEER_IPS[0]}:9312'\""
echo
echo " Then on any node — create a real-time table inside the cluster:"
echo " mysql -h ${PEER_IPS[0]} -P 9306 -e \"CREATE TABLE products (id BIGINT, title TEXT, sku STRING, price FLOAT) rt_mem_limit='256M'\""
echo " mysql -h ${PEER_IPS[0]} -P 9306 -e \"ALTER CLUSTER ${CLUSTER_NAME} ADD products\""
echo
echo " Distributed read-facing index (run on each node, idx_dist points at all peers):"
echo " mysql -h ${NODE_IP} -P 9306 -e \"CREATE TABLE idx_dist type='distributed' agent='${PEER_IPS[0]}:9312:products' agent='${PEER_IPS[1]}:9312:products' agent='${PEER_IPS[2]}:9312:products' ha_strategy='roundrobin'\""
echo
After all three nodes are up and the post-install SQL commands have been run, do a write test against any node and confirm it replicates:
mysql -h 10.10.0.61 -P 9306 -e "INSERT INTO products(id,title,sku,price) VALUES (1,'Test row','SKU-001',9.99)"
mysql -h 10.10.0.62 -P 9306 -e "SELECT * FROM products WHERE id=1"
mysql -h 10.10.0.63 -P 9306 -e "SELECT * FROM products WHERE id=1"
The row should show up on all three. Kill the searchd process on node 1 with systemctl stop manticore and confirm SHOW STATUS LIKE 'cluster_size' from the surviving nodes reports 2; writes should continue, the cluster status moves to non-Primary only if you lose two of three. Bring node 1 back and it rejoins automatically.
The backup story has two layers — the daily BACKUP INDEX to S3 covers the slow recovery path, the binlog covers point-in-time replay between backups. Test the restore on a sandbox cluster monthly; a backup never restored is a hypothesis.
For Manticore on managed compute, including replication-group monitoring and backup-integrity drills, our team runs the cluster under Managed Cloud Ops on Cloud Compute. Start a scoping call.