swift/doc/saio/bin/remakerings
Matthew Oliver e11a38c63a Bind SAIO services on different loopback addresses
Currently all devices in the ring and all services in a SAIO
all bind to the same loopback address 127.0.0.1. But this
breaks servers_per_port if you want to do any testing on that.

This change binds each service to a different loopback address
and updates the rings (remakerings) accordingly.

To make sure rysncd binds correctly the bind address needed
to be changed to listen on all addresses (0.0.0.0).

Change-Id: I7e77434f275df1e2699de495d8b622b90157a9d7
2017-06-27 16:08:08 -04:00

43 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -e
cd /etc/swift
rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz
swift-ring-builder object.builder create 10 3 1
swift-ring-builder object.builder add r1z1-127.0.0.1:6010/sdb1 1
swift-ring-builder object.builder add r1z2-127.0.0.2:6020/sdb2 1
swift-ring-builder object.builder add r1z3-127.0.0.3:6030/sdb3 1
swift-ring-builder object.builder add r1z4-127.0.0.4:6040/sdb4 1
swift-ring-builder object.builder rebalance
swift-ring-builder object-1.builder create 10 2 1
swift-ring-builder object-1.builder add r1z1-127.0.0.1:6010/sdb1 1
swift-ring-builder object-1.builder add r1z2-127.0.0.2:6020/sdb2 1
swift-ring-builder object-1.builder add r1z3-127.0.0.3:6030/sdb3 1
swift-ring-builder object-1.builder add r1z4-127.0.0.4:6040/sdb4 1
swift-ring-builder object-1.builder rebalance
swift-ring-builder object-2.builder create 10 6 1
swift-ring-builder object-2.builder add r1z1-127.0.0.1:6010/sdb1 1
swift-ring-builder object-2.builder add r1z1-127.0.0.1:6010/sdb5 1
swift-ring-builder object-2.builder add r1z2-127.0.0.2:6020/sdb2 1
swift-ring-builder object-2.builder add r1z2-127.0.0.2:6020/sdb6 1
swift-ring-builder object-2.builder add r1z3-127.0.0.3:6030/sdb3 1
swift-ring-builder object-2.builder add r1z3-127.0.0.3:6030/sdb7 1
swift-ring-builder object-2.builder add r1z4-127.0.0.4:6040/sdb4 1
swift-ring-builder object-2.builder add r1z4-127.0.0.4:6040/sdb8 1
swift-ring-builder object-2.builder rebalance
swift-ring-builder container.builder create 10 3 1
swift-ring-builder container.builder add r1z1-127.0.0.1:6011/sdb1 1
swift-ring-builder container.builder add r1z2-127.0.0.2:6021/sdb2 1
swift-ring-builder container.builder add r1z3-127.0.0.3:6031/sdb3 1
swift-ring-builder container.builder add r1z4-127.0.0.4:6041/sdb4 1
swift-ring-builder container.builder rebalance
swift-ring-builder account.builder create 10 3 1
swift-ring-builder account.builder add r1z1-127.0.0.1:6012/sdb1 1
swift-ring-builder account.builder add r1z2-127.0.0.2:6022/sdb2 1
swift-ring-builder account.builder add r1z3-127.0.0.3:6032/sdb3 1
swift-ring-builder account.builder add r1z4-127.0.0.4:6042/sdb4 1
swift-ring-builder account.builder rebalance