Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
4.4. Configure the Object Storage Service
4.4.1. Create the Object Storage Service Identity Records Link kopierenLink in die Zwischenablage kopiert!
services
tenant. For more information, see:
keystonerc_admin
file and on which the keystone command-line utility is installed.
Procedure 4.3. Creating Identity Records for the Object Storage Service
- Set up the shell to access keystone as the administrative user:
source ~/keystonerc_admin
# source ~/keystonerc_admin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
swift
user:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with a secure password that will be used by the Object Storage service when authenticating with the Identity service. - Link the
swift
user and theadmin
role together within the context of theservices
tenant:[(keystone_admin)]# keystone user-role-add --user swift --role admin --tenant services
[(keystone_admin)]# keystone user-role-add --user swift --role admin --tenant services
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
swift
Object Storage service entry:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
swift
endpoint entry:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace IP with the IP address or fully qualified domain name of the server hosting the Object Storage Proxy service.
4.4.2. Configure the Object Storage Service Storage Nodes Link kopierenLink in die Zwischenablage kopiert!
ext4
or XFS
, and mounted under the /srv/node/
directory. All of the services that will run on a given node must be enabled, and their ports opened.
Procedure 4.4. Configuring the Object Storage Service Storage Nodes
- Format your devices using the
ext4
orXFS
filesystem. Ensure thatxattr
s are enabled. - Add your devices to the
/etc/fstab
file to ensure that they are mounted under/srv/node/
at boot time. Use theblkid
command to find your device's unique ID, and mount the device using its unique ID.Note
If usingext4
, ensure that extended attributes are enabled by mounting the filesystem with theuser_xattr
option. (InXFS
, extended attributes are enabled by default.) - Configure the firewall to open the TCP ports used by each service running on each node. By default, the account service uses port 6202, the container service uses port 6201, and the object service uses port 6200.
- Open the
/etc/sysconfig/iptables
file in a text editor. - Add an
INPUT
rule allowing TCP traffic on the ports used by the account, container, and object service. The new rule must appear before anyreject-with icmp-host-prohibited
rule:-A INPUT -p tcp -m multiport --dports 6200,6201,6202,873 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 6200,6201,6202,873 -j ACCEPT
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the changes to the
/etc/sysconfig/iptables
file. - Restart the
iptables
service for the firewall changes to take effect:systemctl restart iptables.service
# systemctl restart iptables.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Change the owner of the contents of
/srv/node/
toswift:swift
:chown -R swift:swift /srv/node/
# chown -R swift:swift /srv/node/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the
SELinux
context correctly for all directories under/srv/node/
:restorecon -R /srv
# restorecon -R /srv
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add a hash prefix to the
/etc/swift/swift.conf
file:openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_prefix \ $(openssl rand -hex 10)
# openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_prefix \ $(openssl rand -hex 10)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add a hash suffix to the
/etc/swift/swift.conf
file:openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_suffix \ $(openssl rand -hex 10)
# openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_suffix \ $(openssl rand -hex 10)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the IP address that the storage services will listen on. Run the following commands for every service on every node in your Object Storage cluster:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace NODE_IP_ADDRESS with the IP address of the node you are configuring. - Copy
/etc/swift/swift.conf
from the node you are currently configuring to all of your Object Storage service nodes.Important
The/etc/swift/swift.conf
file must be identical on all of your Object Storage service nodes. - Start the services that will run on the node:
systemctl start openstack-swift-account.service systemctl start openstack-swift-container.service systemctl start openstack-swift-object.service
# systemctl start openstack-swift-account.service # systemctl start openstack-swift-container.service # systemctl start openstack-swift-object.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the services to start at boot time:
systemctl enable openstack-swift-account.service systemctl enable openstack-swift-container.service systemctl enable openstack-swift-object.service
# systemctl enable openstack-swift-account.service # systemctl enable openstack-swift-container.service # systemctl enable openstack-swift-object.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.4.3. Configure the Object Storage Service Proxy Service Link kopierenLink in die Zwischenablage kopiert!
gets
and puts
are directed.
Note
Procedure 4.5. Configuring the Object Storage Service Proxy Service
- Update the configuration file for the proxy server with the correct authentication details for the appropriate service user:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace IP with the IP address or host name of the Identity server.
- Replace services with the name of the tenant that was created for the Object Storage service (previous examples set this to
services
). - Replace swift with the name of the service user that was created for the Object Storage service (previous examples set this to
swift
). - Replace PASSWORD with the password associated with the service user.
- Start the
memcached
andopenstack-swift-proxy
services:systemctl start memcached.service systemctl start openstack-swift-proxy.service
# systemctl start memcached.service # systemctl start openstack-swift-proxy.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the
memcached
andopenstack-swift-proxy
services to start at boot time:systemctl enable memcached.service systemctl enable openstack-swift-proxy.service
# systemctl enable memcached.service # systemctl enable openstack-swift-proxy.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Allow incoming connections to the server hosting the Object Storage proxy service. Open the
/etc/sysconfig/iptables
file in a text editor, and Add an INPUT rule allowing TCP traffic on port 8080. The new rule must appear before any INPUT rules that REJECT traffic: :-A INPUT -p tcp -m multiport --dports 8080 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 8080 -j ACCEPT
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Important
This rule allows communication from all remote hosts to the system hosting the Swift proxy on port8080
. For information regarding the creation of more restrictive firewall rules, see the Red Hat Enterprise Linux Security Guide: - Restart the
iptables
service to ensure that the change takes effect:systemctl restart iptables.service
# systemctl restart iptables.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.4.4. Object Storage Service Rings Link kopierenLink in die Zwischenablage kopiert!
4.4.5. Build Object Storage Service Ring Files Link kopierenLink in die Zwischenablage kopiert!
Ring File Parameter | Description |
---|---|
part_power
|
2partition power = partition count.
The partition is rounded up after calculation.
|
replica_count
|
The number of times that your data will be replicated in the cluster.
|
min_part_hours
|
Minimum number of hours before a partition can be moved. This parameter increases availability of data by not moving more than one copy of a given data item within that min_part_hours amount of time.
|
zone
|
Used when adding devices to rings (optional). Zones are a flexible abstraction, where each zone should be separated from other zones as possible in your deployment. You can use a zone to represent sites, cabinet, nodes, or even devices.
|
Procedure 4.6. Building Object Storage Service Ring Files
- Build one ring for each service. Provide a builder file, a partition power, a replica count, and the minimum hours between partition reassignment:
swift-ring-builder /etc/swift/object.builder create part_power replica_count min_part_hours swift-ring-builder /etc/swift/container.builder create part_power replica_count min_part_hours swift-ring-builder /etc/swift/account.builder create part_power replica_count min_part_hours
# swift-ring-builder /etc/swift/object.builder create part_power replica_count min_part_hours # swift-ring-builder /etc/swift/container.builder create part_power replica_count min_part_hours # swift-ring-builder /etc/swift/account.builder create part_power replica_count min_part_hours
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - When the rings are created, add devices to the account ring:
swift-ring-builder /etc/swift/account.builder add zX-SERVICE_IP:6202/dev_mountpt part_count
# swift-ring-builder /etc/swift/account.builder add zX-SERVICE_IP:6202/dev_mountpt part_count
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace X with the corresponding integer of a specified zone (for example,
z1
would correspond to Zone One). - Replace SERVICE_IP with the IP on which the account, container, and object services should listen. This IP should match the
bind_ip
value set during the configuration of the Object Storage service storage nodes. - Replace dev_mountpt with the
/srv/node
subdirectory under which your device is mounted. - Replace part_count with the partition count you used to calculate your partition power.
Note
Repeat this step for each device (on each node in the cluster) you want added to the ring. - Add each device to both the container and object rings:
swift-ring-builder /etc/swift/container.builder add zX-SERVICE_IP:6201/dev_mountpt part_count swift-ring-builder /etc/swift/object.builder add zX-SERVICE_IP:6200/dev_mountpt part_count
# swift-ring-builder /etc/swift/container.builder add zX-SERVICE_IP:6201/dev_mountpt part_count # swift-ring-builder /etc/swift/object.builder add zX-SERVICE_IP:6200/dev_mountpt part_count
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the variables with the same ones used in the previous step.Note
Repeat these commands for each device (on each node in the cluster) you want added to the ring. - Distribute the partitions across the devices in the ring:
swift-ring-builder /etc/swift/account.builder rebalance swift-ring-builder /etc/swift/container.builder rebalance swift-ring-builder /etc/swift/object.builder rebalance
# swift-ring-builder /etc/swift/account.builder rebalance # swift-ring-builder /etc/swift/container.builder rebalance # swift-ring-builder /etc/swift/object.builder rebalance
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Check to see that you now have three ring files in the directory
/etc/swift
:ls /etc/swift/*gz
# ls /etc/swift/*gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The files should be listed as follows:/etc/swift/account.ring.gz /etc/swift/container.ring.gz /etc/swift/object.ring.gz
/etc/swift/account.ring.gz /etc/swift/container.ring.gz /etc/swift/object.ring.gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the
openstack-swift-proxy
service:systemctl restart openstack-swift-proxy.service
# systemctl restart openstack-swift-proxy.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Ensure that all files in the
/etc/swift/
directory, including those that you have just created, are owned by theroot
user and theswift
group:Important
All mount points must be owned byroot
; all roots of mounted file systems must be owned byswift
. Before running the following command, ensure that all devices are already mounted and owned byroot
.chown -R root:swift /etc/swift
# chown -R root:swift /etc/swift
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy each ring builder file to each node in the cluster, storing them under
/etc/swift/
.