Before starting the Object Storage services, you must create the initial account, container, and object rings. The ring builder creates configuration files that each node uses to determine and deploy the storage architecture. For simplicity, this guide uses one region and one zone with 2^10 (1024) maximum partitions, 3 replicas of each object, and 1 hour minimum time between moving a partition more than once. For Object Storage, a partition indicates a directory on a storage device rather than a conventional partition table.
Perform these steps on the controller (Proxy server) node1
We need to create account , container and object rings. Follow below steps.
- Change to the /etc/swift directory.
- Create the base account , container and object.builder file:
$ swift-ring-builder account.builder create 10 3 1 $ swift-ring-builder container.builder create 10 3 1 $ swift-ring-builder object.builder create 10 3 1
- Add each storage node to the ring:
- Repeat this command for each storage device on each storage node.
Distribute ring configuration files to each storage nodes:
- Copy the account.ring.gz, container.ring.gz, and object.ring.gz files to the /etc/swift directory on each storage node.
Perform these steps on Proxy node.
- Obtain the /etc/swift/swift.conf file from the Object Storage source repository:
$ curl -o /etc/swift/swift.conf https://git.openstack.org/cgit/openstack/swift/plain/etc/swift.conf-sample?h=stable/queens
- Edit the /etc/swift/swift.conf file
[swift-hash] swift_hash_path_suffix = HASH_PATH_SUFFIX swift_hash_path_prefix = HASH_PATH_PREFIX
- Replace HASH_PATH_PREFIX and HASH_PATH_SUFFIX with unique values.
Ex – df7efae72397a5395ae7 and df7efae72390a5095ae6
[storage-policy:0] name = Policy-0 default = yes
- Copy the swift.conf file to the /etc/swift directory on each storage node.
$ chown -R root:swift /etc/swift - Do on all nodes $systemctl enable openstack-swift-proxy.service memcached.service $ systemctl start openstack-swift-proxy.service memcached.service
Perform These steps on storage nodes:
$ systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.service $ systemctl start openstack-swift-account.service openstack-swift-account-auditor.service openstack-swift-account-reaper.service openstack-swift-account-replicator.service $ systemctl enable openstack-swift-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.service $ systemctl start openstack-swift-container.service openstack-swift-container-auditor.service openstack-swift-container-replicator.service openstack-swift-container-updater.service $ systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service $ systemctl start openstack-swift-object.service openstack-swift-object-auditor.service openstack-swift-object-replicator.service openstack-swift-object-updater.service