swift手工搭建

前端之家收集整理的这篇文章主要介绍了swift手工搭建前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

controller:@H_301_1@


@H_301_1@

keystone user-create --name=swift --pass=swift --email=swift@example.com@H_301_1@

keystone user-role-add --user=swift --tenant=service --role=admin@H_301_1@


@H_301_1@

创建Object Storage Service:@H_301_1@

keystone service-create --name=swift --type=object-store --description="OpenStack Object Storage"@H_301_1@

keystone endpoint-create \@H_301_1@

--service-id=$(keystone service-list | awk '/ object-store / {print $2}') \@H_301_1@

--publicurl='http://controller:8080/v1/AUTH_%(tenant_id)s' \@H_301_1@

--internalurl='http://controller:8080/v1/AUTH_%(tenant_id)s' \@H_301_1@

--adminurl=http://controller:8080@H_301_1@


@H_301_1@

all node :@H_301_1@

mkdir -p /etc/swift@H_301_1@


@H_301_1@

vim /etc/swift/swift.conf@H_301_1@


@H_301_1@

[swift-hash]@H_301_1@

swift_hash_path_prefix = xrfunIoUnenqjnw@H_301_1@

swift_hash_path_suffix = fLIbertYgibbitZ@H_301_1@


@H_301_1@

swift0节点:@H_301_1@

yum install openstack-swift-account openstack-swift-container \@H_301_1@

openstack-swift-object xfsprogs xinetd@H_301_1@


@H_301_1@


@H_301_1@


@H_301_1@

配置object,container ,account 的配置文件@H_301_1@

openstack-config --set /etc/swift/account-server.conf DEFAULT bind_ip 10.0.0.51@H_301_1@

openstack-config --set /etc/swift/container-server.conf DEFAULT bind_ip 10.0.0.51@H_301_1@

openstack-config --set /etc/swift/object-server.conf DEFAULT bind_ip 10.0.0.51@H_301_1@


@H_301_1@

添加一块磁盘:@H_301_1@


@H_301_1@

/dev/sdb@H_301_1@


@H_301_1@

fdisk /dev/sdb@H_301_1@

mkfs.xfs /dev/sdb1@H_301_1@

echo "/dev/sdb1 /srv/node/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab@H_301_1@

mkdir -p /srv/node/sdb1@H_301_1@

mount /srv/node/sdb1@H_301_1@

chown -R swift:swift /srv/node@H_301_1@


@H_301_1@

vim /etc/rsyncd.conf@H_301_1@


@H_301_1@

uid = swift@H_301_1@

gid = swift@H_301_1@

log file = /var/log/rsyncd.log@H_301_1@

pid file = /var/run/rsyncd.pid@H_301_1@

address = 10.0.1.51@H_301_1@


@H_301_1@

[account]@H_301_1@

max connections = 2@H_301_1@

path = /srv/node/@H_301_1@

read only = false@H_301_1@

lock file = /var/lock/account.lock@H_301_1@


@H_301_1@

[container]@H_301_1@

max connections = 2@H_301_1@

path = /srv/node/@H_301_1@

read only = false@H_301_1@

lock file = /var/lock/container.lock@H_301_1@


@H_301_1@

[object]@H_301_1@

max connections = 2@H_301_1@

path = /srv/node/@H_301_1@

read only = false@H_301_1@

lock file = /var/lock/object.lock@H_301_1@


@H_301_1@

vim /etc/xinetd.d/rsync@H_301_1@


@H_301_1@

disable = no@H_301_1@


@H_301_1@

service xinetd start@H_301_1@


@H_301_1@

mkdir -p /var/swift/recon@H_301_1@

chown -R swift:swift /var/swift/recon@H_301_1@


@H_301_1@


@H_301_1@

配置 proxy-node(controller)@H_301_1@


@H_301_1@

安装swift-proxy的相关包:@H_301_1@

yum install openstack-swift-proxy memcached python-swiftclient python-keystone-auth-token@H_301_1@


@H_301_1@

//按照官方的文档,没有python-keystone-auth-token,变成安装 python-keystoneclient@H_301_1@


@H_301_1@

vim /etc/sysconfig/memcached@H_301_1@

OPTIONS="-l 10.0.0.11"@H_301_1@


@H_301_1@

启动memcached的服务,加入开机启动@H_301_1@


@H_301_1@

service memcached restart@H_301_1@

chkconfig memcached on@H_301_1@


@H_301_1@

vim /etc/swift/proxy-server.conf@H_301_1@


@H_301_1@

[DEFAULT]@H_301_1@

bind_port = 8080@H_301_1@

user = swift@H_301_1@

[pipeline:main]@H_301_1@

pipeline = healthcheck cache authtoken keystoneauth proxy-server@H_301_1@

[app:proxy-server]@H_301_1@

use = egg:swift#proxy@H_301_1@

allow_account_management = true@H_301_1@

account_autocreate = true@H_301_1@

[filter:keystoneauth]@H_301_1@

use = egg:swift#keystoneauth@H_301_1@

operator_roles = Member,admin,swiftoperator@H_301_1@

[filter:authtoken]@H_301_1@

paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory@H_301_1@


@H_301_1@

# Delaying the auth decision is required to support token-less@H_301_1@

# usage for anonymous referrers ('.r:*').@H_301_1@

delay_auth_decision = true@H_301_1@

# auth_* settings refer to the Keystone server@H_301_1@

auth_protocol = http@H_301_1@

auth_host = controller@H_301_1@

auth_port = 35357@H_301_1@

# the service tenant and swift username and password created in Keystone@H_301_1@

admin_tenant_name = service@H_301_1@

admin_user = swift@H_301_1@

admin_password = swift@H_301_1@

[filter:cache]@H_301_1@

use = egg:swift#memcache@H_301_1@

[filter:catch_errors]@H_301_1@

use = egg:swift#catch_errors@H_301_1@

[filter:healthcheck]@H_301_1@

use = egg:swift#healthcheck@H_301_1@


@H_301_1@

构建ring:@H_301_1@

cd /etc/swift@H_301_1@

swift-ring-builder account.builder create 18 3 1@H_301_1@

swift-ring-builder container.builder create 18 3 1@H_301_1@

swift-ring-builder object.builder create 18 3 1@H_301_1@


@H_301_1@

swift-ring-builder account.builder add z1-10.0.0.51:6002R10.0.0.51:6005/sdb1 100@H_301_1@

swift-ring-builder container.builder add z1-10.0.0.51:6001R10.0.0.51:6004/sdb1 100@H_301_1@

swift-ring-builder object.builder add z1-10.0.0.51:6000R10.0.0.51:6003/sdb1 100@H_301_1@


@H_301_1@

swift-ring-builder account.builder@H_301_1@

swift-ring-builder container.builder@H_301_1@

swift-ring-builder object.builder@H_301_1@


@H_301_1@

swift-ring-builder account.builder rebalance@H_301_1@

swift-ring-builder container.builder rebalance@H_301_1@

swift-ring-builder object.builder rebalance@H_301_1@


@H_301_1@

拷贝所有的ring.tar.gz文件到storage node@H_301_1@


@H_301_1@

scp *ring.gz root@10.0.0.51:/etc/swift@H_301_1@


@H_301_1@

若没有scp命令,执行:@H_301_1@

yum install -y openssh-clients@H_301_1@


@H_301_1@

chown -R swift:swift /etc/swift@H_301_1@


@H_301_1@

service openstack-swift-proxy restart@H_301_1@

chkconfig openstack-swift-proxy on@H_301_1@


@H_301_1@


@H_301_1@

启动对象存储节点的服务,加入到开机启动@H_301_1@


@H_301_1@

service openstack-swift-object restart@H_301_1@

service openstack-swift-object-replicator restart@H_301_1@

service openstack-swift-object-updater restart@H_301_1@

service openstack-swift-object-auditor restart@H_301_1@


@H_301_1@

service openstack-swift-container start@H_301_1@

service openstack-swift-container-replicator restart@H_301_1@

service openstack-swift-container-updater restart@H_301_1@

service openstack-swift-container-auditor restart@H_301_1@


@H_301_1@

service openstack-swift-account restart@H_301_1@

service openstack-swift-account-replicator restart@H_301_1@

service openstack-swift-account-reaper restart@H_301_1@

service openstack-swift-account-auditor restart@H_301_1@


@H_301_1@


@H_301_1@

chkconfig openstack-swift-object on@H_301_1@

chkconfig openstack-swift-object-replicator on@H_301_1@

chkconfig openstack-swift-object-updater on@H_301_1@

chkconfig openstack-swift-object-auditor on@H_301_1@


@H_301_1@

chkconfig openstack-swift-container on@H_301_1@

chkconfig openstack-swift-container-replicator on@H_301_1@

chkconfig openstack-swift-container-updater on@H_301_1@

chkconfig openstack-swift-container-auditor on@H_301_1@


@H_301_1@

chkconfig openstack-swift-account on@H_301_1@

chkconfig openstack-swift-account-replicator on@H_301_1@

chkconfig openstack-swift-account-reaper on@H_301_1@

chkconfig openstack-swift-account-auditor on@H_301_1@


@H_301_1@

或者是一次启动:@H_301_1@


@H_301_1@

swift-init all start@H_301_1@


@H_301_1@

controller节点验证swift服务@H_301_1@


@H_301_1@

source admin-openrc.sh@H_301_1@


@H_301_1@

swift stat@H_301_1@

swift upload myfiles test.txt@H_301_1@

swift upload myfiles test2.txt@H_301_1@

猜你在找的Swift相关文章