@@ -39,16 +39,17 @@ ansible -i env/$ENV_DIR/inventory runners_s3[0] -m shell \
3939# Step 3: Find the vault-metadata repd leader IP (port 5300)
4040ansible -i env/$ENV_DIR /inventory md1-cluster1 -m shell \
4141 -a ' curl -s http://localhost:5300/_/raft/leader'
42- # Note the "ip" value from the output, e.g., {"ip":"10.160.116.162","port":4300}
42+ # Note both "ip" and "port" values, e.g., {"ip":"10.160.116.162","port":4300}
43+ # On 3-server rings the port may differ per node (4300, 4301, etc.)
4344
44- # Step 4: Set the LEADER_IP variable and run the permission check script
45+ # Step 4: Set the LEADER variable (ip:port) and run the permission check script
4546# Note: replace ctrctl with docker on RHEL/CentOS 7
46- LEADER_IP =< leader-ip-from-step-3>
47+ LEADER =< leader-ip> : < leader-port -from-step-3>
4748
4849ansible -i env/$ENV_DIR /inventory runners_s3[0] -m shell \
4950 -a " cp /root/buckets-with-replication.json {{ env_host_logs}}/scality-vault{{ container_name_suffix | default(" " )}}/logs && \
5051 ctrctl exec scality-vault{{ container_name_suffix | default(" " )}} node /logs/check-replication-permissions.js \
51- /logs/buckets-with-replication.json $LEADER_IP /logs/missing.json"
52+ /logs/buckets-with-replication.json $LEADER /logs/missing.json"
5253
5354# Step 5: Retrieve results
5455ansible -i env/$ENV_DIR /inventory runners_s3[0] -m shell \
@@ -276,19 +277,20 @@ This ensures portability while using the exact same protocol and key formats as
276277 -a ' curl -s http://localhost:5300/_/raft/leader'
277278 ```
278279
279- This returns JSON like ` {"ip":"10.160.116.162","port":4300} ` - use the ` ip ` value.
280+ This returns JSON like ` {"ip":"10.160.116.162","port":4300} ` - use both ` ip `
281+ and ` port ` values. On 3-server rings the port may differ per node (4300, 4301, etc.).
280282
281283 ** Note:** Vault metadata uses port 5300 for admin.
282284
2832856 . Copy files to ` /var/tmp ` (mounted in vault container) and run the script:
284286
285287 ``` bash
286- LEADER_IP =< leader-ip-from-step-5>
288+ LEADER =< leader-ip> : < leader-port -from-step-5>
287289
288290 ansible -i env/$ENV_DIR /inventory runners_s3[0] -m shell \
289291 -a " cp /root/buckets-with-replication.json {{ env_host_logs}}/scality-vault{{ container_name_suffix | default(" " )}}/logs && \
290292 ctrctl exec scality-vault{{ container_name_suffix | default(" " )}} node /logs/check-replication-permissions.js \
291- /logs/buckets-with-replication.json $LEADER_IP /logs/missing.json"
293+ /logs/buckets-with-replication.json $LEADER /logs/missing.json"
292294 ```
293295
2942968 . Retrieve the output:
@@ -301,13 +303,13 @@ This ensures portability while using the exact same protocol and key formats as
301303### Command Line Arguments
302304
303305```
304- node check-replication-permissions.js [input-file] [leader-ip] [output-file] [--include-policies]
306+ node check-replication-permissions.js [input-file] [leader-ip[:port] ] [output-file] [--include-policies]
305307```
306308
307309| Argument | Default | Description |
308310| ----------| ---------| -------------|
309311| ` input-file ` | /root/buckets-with-replication.json | Input JSON from list script |
310- | ` leader-ip ` | 127.0.0.1 | Vault-metadata repd leader IP |
312+ | ` leader-ip[:port] ` | 127.0.0.1:4300 | Vault-metadata repd leader IP and optional port (default 4300) |
311313| ` output-file ` | /root/missing-replication-permissions.json | Output file path |
312314| ` --include-policies ` | (not set) | Include full policy documents in output |
313315
@@ -426,7 +428,7 @@ In this example, the policy is missing `s3:ReplicateObject` - it only has
426428
427429### Script Logic
428430
429- 1 . ** Connects to repd** : TCP connection to vault-metadata repd on port 4300
431+ 1 . ** Connects to repd** : TCP connection to vault-metadata repd (default port 4300, configurable via ` ip:port ` argument)
4304322 . ** For each bucket's replication role** :
431433 - Get role ID: ` linkRoleArn(arn) ` → role ID
432434 - List attached policies: ` policyByRoleId(accountId, roleId, '', '') `
@@ -490,9 +492,10 @@ Output saved to: /tmp/missing.json
490492
491493** Connection timeout or refused**
492494
493- - Ensure you're connecting to the correct repd leader IP
494- - The script must run inside a container that can reach repd on port 4300
495- - Find the leader: ` curl -s http://localhost:5300/_/raft/leader `
495+ - Ensure you're connecting to the correct repd leader IP ** and port**
496+ - On 3-server rings, the leader port may not be 4300 (e.g. 4301, 4302)
497+ - Find the leader: ` curl -s http://localhost:5300/_/raft/leader ` — use both ` ip ` and ` port ` from the response
498+ - The script must run inside a container that can reach repd on the leader port
496499
497500** Script timeout**
498501
0 commit comments