> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safesquid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Master-Slave

> Configure SafeSquid master-slave architecture for centralized policy sync and reporting across slave instances.

## How master-slave works

In a master-slave configuration, one SafeSquid instance (the master) manages policy and reporting for multiple slave instances. Slaves enforce policy and process traffic; master provides centralized control.

**Data flow:**

* **Master → Slaves**: Policies, configuration, tasks
* **Slaves → Master**: Reporting data, logs, statistics

Control and policy flow from master to slaves; reporting data flows from slaves to master:

```mermaid theme={null}
flowchart TB
    Master[Master SafeSquid]
    Slave1[Slave 1]
    Slave2[Slave 2]
    Master -->|policies and tasks| Slave1
    Master -->|policies and tasks| Slave2
    Slave1 -->|reporting data| Master
    Slave2 -->|reporting data| Master
```

**Slave behavior:**

* Processes client traffic and enforces policy synced from master
* Forwards reporting data to master for centralized analysis
* Operates independently if master is temporarily unavailable (uses last synced policy)

**Master behavior:**

* Does not process client traffic directly
* Aggregates reporting data from all slaves into unified reports
* Pushes policy updates to slaves automatically

## Prerequisites

* SafeSquid installed on all nodes (master and slaves)
* Same activation key on all nodes
* Network access from slaves to master Configuration Portal (port 8888 by default)
* If authentication is enabled on master, slaves must be allowed in Access Restriction → Allow list

## Configure master-slave relationship

Follow these steps to connect a slave instance to a master. Perform slave configuration first, then (if authentication is enabled) configure the master to allow the slave.

## Step 1: Configure slave server

### [Access the SafeSquid User Interface](/Configuration_Portal) on the slave server

## Go to Support

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image1.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=ac15d7a9c8a94e97d304d7e612e3e8e8" alt="clicking on support in safesquid interface in top right corner " width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image1.webp" />

## Go to Startup params

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image2.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=39790487157291cfd13b08633057180e" alt="clicking on start up params" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image2.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image3.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=b111958edc729824aac65ef1960d20e9" alt="clicking on edit button" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image3.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image4.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=98ac043997bd9f12922da6de1e63ea8e" alt="entering the master IP address" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image4.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image5.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=65f624ac37c0b1855e7e1f61024476a6" alt="entering the port of master server" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image5.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image6.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=88a3cd9adb0756eebb3bad05ac4595d9" alt="clicking on submit button" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image6.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image7.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=7afd05f90f73e6eb78b521e3fbd06c1f" alt="clicking on restart button" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image7.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image8.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=9f9ad58d54b2c069acfef4417f0cf6ba" alt="clicking on yes for backup current configuration to cloud" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image8.webp" />

## Step 2: Configure master server (if authentication is enabled)

If your master requires authentication, add the slave IP to the Allow list so the slave can access the Configuration Portal and sync policies.

### Go to Access Restriction under Application Setup

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image9.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=0bbe9e634e7a07d8ca1f5d60b196d013" alt="Going to Access Restriction under Application Setup" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image9.webp" />

## Go to Allow list

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image10.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=0734afca2b19be8b283f16db0a4a4433" alt="going to allow list tab in access restrictions" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image10.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image11.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=095bf669f4592810bc2b893498200100" alt="enabling the policy as true" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image11.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image12.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=f66dd7a58c660335f2ac0fa97dfa4d25" alt="enabling the policy as true for giving access to slave server" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image12.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image13.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=a8f6dcd96c9aa5210756a8a0c14e9ff9" alt="clicking on save to save the policy" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image13.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image14.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=78cff7948d358cae8f2cfe794eefd910" alt="policy saved" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image14.webp" />

## Step 3: Verify synchronization

### Check slave configuration sync

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/MoDjed1u2_at-9B3/images/How_To/Master_Slave_configuration/image15.webp?fit=max&auto=format&n=MoDjed1u2_at-9B3&q=85&s=2757f268b90403ea8a5c8dedbcccbecc" alt="Verifying the synchronization of defined sections on Slave server" width="1280" height="720" data-path="images/How_To/Master_Slave_configuration/image15.webp" />

On the slave Configuration Portal, confirm that sections synced from the master appear with the same settings. Make a test policy change on the master and verify it appears on the slave within a few minutes.

### Verify reporting flow

On the master, open [Reporting Service](/Reporting_Service) and confirm logs from slave nodes appear in unified reports. Slave traffic should be visible on the master.

## Verification checklist

* [ ] Slave Configuration Portal → Support → Startup params shows correct master IP and port
* [ ] Master Configuration Portal → Access Restriction → Allow list includes slave IP (if authentication enabled)
* [ ] Test policy change on master propagates to slave within 5 minutes
* [ ] Slave traffic appears in master Reporting Service
* [ ] Slave logs show successful sync events (check `/var/log/safesquid/extended.log`)

## Troubleshooting

**Slave not syncing policies:**

* Verify network connectivity from slave to master port 8888: `telnet <master-ip> 8888`
* Check master firewall allows incoming connections on port 8888
* If authentication enabled, verify slave IP in master Access Restriction → Allow list
* Check slave logs: `tail -f /var/log/safesquid/extended.log` (look for sync errors)

**Slave traffic not appearing in master reports:**

* Verify reporting data path is not blocked by firewall
* Check slave Configuration Portal → Support → Startup params has correct master IP
* Restart slave: Configuration Portal → Support → Restart SafeSquid

**Policies syncing but not applying:**

* After policy changes on master, restart slave to apply: Configuration Portal → Support → Restart SafeSquid
* Verify slave activation key matches master (same license)

**Related**: [Configuration Sync](/Configuration_Sync), [Configuration Portal](/Configuration_Portal), [Reporting Service](/Reporting_Service), [Troubleshooting](/Troubleshooting)


## Related topics

- [Proxy Clustering](/use_cases/scaling_and_high_availability/proxy_clustering.md)
- [Configuration Sync](/use_cases/customisation/configuration_sync.md)
- [Customisation](/use_cases/customisation/customisation.md)
- [Startup Parameters](/use_cases/customisation/startup_parameters.md)
- [Backup Strategy](/use_cases/scaling_and_high_availability/disaster_recovery.md)
