Records for easy access.
Just part of the explanation.
Install and configure the Controller node
Keystone User-create--name Swift--Pass Swiftkeystone User-role-add--user Swift--tenant Service--Role Adminkeystone Service-create--name Swift--typeObject-store--description"OpenStack Object Storage"Keystone Endpoint-Create--service-ID$ (Keystone Service-list |awk '/Object-store/{print -$}') --publicurl'http://controller:8080/v1/AUTH_% (tenant_id) s' --internalurl'http://controller:8080/v1/AUTH_% (tenant_id) s' --adminurl http://controller:8080 \--region Regionone
Yum Install openstack-swift-proxy python-swiftclient python-keystone-auth-token python-keystonemiddleware Memcached-y
Get configuration files from GitHub
Curl-o/etc/swift/proxy-server.conf https://raw.githubusercontent.com/openstack/swift/stable/juno/ Etc/proxy-server.conf-sample
/etc/swift/proxy-server.conf
[Default]bind_port=8080User=Swiftswift_dir=/etc/Swift
[Pipeline:main]pipeline= Authtoken Cache Healthcheck Keystoneauth proxy-logging proxy-Server
[App:proxy-server]allow_account_management=trueaccount_autocreate=true
[Filter:keystoneauth]use=Egg:swift#keystoneauthoperator_roles=Admin,_member_ #用户管理, as well as the users used
[Filter:authtoken]paste.filter_factory=Keystonemiddleware.auth_token:filter_factoryauth_uri= http://controller:5000/v2.0Identity_uri = http://controller:35357Admin_tenant_name =Serviceadmin_user=Swiftadmin_password=swiftdelay_auth_decision=true
[Filter:cache]memcache_servers=127.0.0.1:11211
Install and configure the storage nodes
Includes 2 block devices, add 2 drives, SDB, SDC
Fdisk partition SDB1, SDC1
Yum Install xfsprogs rsync
mkfs.xfs/dev//dev/sdc1mkdir -p/srv/node/sdb1 #创建挂载点 mkdir -p/srv/node /sdc1
/etc/fstab starting an automatic mount point
/DEV/SDB1/SRV/NODE/SDB1 XFS noatime,nodiratime,nobarrier,logbufs=802/dev/sdc1/srv/ NODE/SDC1 XFS noatime,nodiratime,nobarrier,logbufs=802
Mount -a #读取配置文件并挂载 mount /srv/node/sdb1Mount /SRV/NODE/SDC1
/etc/rsyncd.conf Synchronization Service
UID =Swiftgid=Swiftlogfile=/var/log/Rsyncd.logpidfile=/var/run/rsyncd.pidaddress=192.168.23.12[Account]max Connections=2Path=/srv/node/Read only=falseLockfile=/var/lock/Account.lock[container]max Connections=2Path=/srv/node/Read only=falseLockfile=/var/lock/container.lock[Object]max Connections=2Path=/srv/node/Read only=falseLockfile=/var/lock/Object. Lock
Yum Install openstack-swift-account openstack-swift-container openstack-swift-object -y
Get account, container, object config file:
Curl-o/etc/swift/account-server.conf https://Raw.githubusercontent.com/openstack/swift/stable/juno /etc/account-server.conf-sample-o/etc/swift/container-server.conf https:// Raw.githubusercontent.com/openstack/swift/stable/juno/etc/container-server.conf-sample-o/etc/ swift/Object-server.conf https://raw.githubusercontent.com/openstack/swift/stable/juno/ Etc/object-server.conf-sample
/etc/swift/account-server.conf
=6002==/etc/=/srv/= Healthcheck Recon account-Server
=/var/cache/swift
/etc/swift/container-server.conf
=6001==/etc/=/srv/node
= Healthcheck Recon container-Server
=/var/cache/swift
/etc/swift/object-server.conf
=6001==/etc/=/srv/node
= Healthcheck Recon container-Server
=/var/cache/swift
Folder permissions:
chown -R swift:swift/srv/nodemkdir -p/var/cache/Swiftchown -R Swift:swift/var/cache/swift
Create Initial RingsController
Cd/etc/swift Creating a ring
Swift-ring-builder Account.builder CreateTen 3 1Swift-ring-builder Account.builder Add r1z1-192.168.23.12:6002/sdb1#添加存储区Swift-ring-builder Account.builder Add r1z1-192.168.23.12:6002/sdc1 -Swift-ring-Builder Account.builder #查看环swift-ring-Builder Account.builder Rebalance #负载均衡环swift-ring-builder Container.builder CreateTen 3 1Swift-ring-builder Container.builder Add r1z1-192.168.23.12:6001/sdb1 -Swift-ring-builder Container.builder Add r1z1-192.168.23.12:6001/sdc1 -Swift-ring-Builder Container.builderswift-ring-Builder Container.builder Rebalanceswift-ring-builderObject. Builder CreateTen 3 1Swift-ring-builderObject. Builder Add r1z1-192.168.23.12:6000/sdb1 -Swift-ring-builderObject. Builder Add r1z1-192.168.23.12:6000/sdc1 -Swift-ring-builderObject. Builderswift-ring-builderObject. Builder rebalance
Distribute Ring configuration Files
Copy the account.ring.gz, container.ring.gz, and object.ring.gz files to the/etc/swift directory on each storage node and Any additional nodes running the Proxy service.
SCP object. ring.gz [email protected]192.168. 23.12:/etc/swift/
Finalize InstallationController
Curl-o/etc/swift/swift.conf https://raw.githubusercontent.com/openstack/swift/stable/juno/etc/ Swift.conf-sample #swift. conf
[swift-= yippee #HASH前缀
= Yippee #HASH后缀
[Storage-policy:0= policy-0= yes
Copy the swift.conf file to The/etc/swift directory on each storage node and any additional nodes running the proxy servi Ce.
SCP object. ring.gz [email protected]192.168. 23.12:/etc/swift/
All nodes
Folder permissions:
chown -R swift:swift/etc/swift
On the controller node and any other nodes running the proxy service
Systemctl Enable openstack-swift-proxy.service memcached.servicesystemctl start OpenStack- Swift-proxy.service Memcached.service
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.servicesystemctl Enable OpenStack-swift-container.service Openstack-swift-container-auditor.service Openstack-swift-container-replicator.service openstack-swift-container-updater.servicesystemctl start OpenStack-swift-container.service Openstack-swift-container-auditor.service Openstack-swift-container-replicator.service openstack-swift-container-Updater.servicesystemctl Enable OpenStack-swift-Object. Service openstack-swift-Object-auditor.service openstack-swift-Object-replicator.service openstack-swift-Object-updater.servicesystemctl start OpenStack-swift-Object. Service openstack-swift-Object-auditor.service openstack-swift-Object-replicator.service openstack-swift-Object-updater.service
Failed to create container problems when restarting, and the container is missing, three services are not started, the port is occupied;
swift-init all STARTNETSTAT–TNLPkill –9 xxx #删除对应pidswift init all restart
The SWIFT installation is now complete.
OpenStack Learning (vii): Swift Configuration and use