重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

swift手工搭建-创新互联

controller:

10年积累的网站设计、成都网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有礼县免费网站建设让你可以放心的选择与我们合作。

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

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

创建Object Storage Service:

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

keystone endpoint-create \

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

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

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

--adminurl=http://controller:8080

all node :

mkdir -p /etc/swift

vim /etc/swift/swift.conf

[swift-hash]

swift_hash_path_prefix = xrfuniounenqjnw

swift_hash_path_suffix = fLIbertYgibbitZ

swift0节点:

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

openstack-swift-object xfsprogs xinetd

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

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

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

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

新添加一块磁盘:

/dev/sdb

fdisk /dev/sdb

mkfs.xfs /dev/sdb1

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

mkdir -p /srv/node/sdb1

mount /srv/node/sdb1

chown -R swift:swift /srv/node

vim /etc/rsyncd.conf

uid = swift

gid = swift

log file = /var/log/rsyncd.log

pid file = /var/run/rsyncd.pid

address = 10.0.1.51

[account]

max connections = 2

path = /srv/node/

read only = false

lock file = /var/lock/account.lock

[container]

max connections = 2

path = /srv/node/

read only = false

lock file = /var/lock/container.lock

[object]

max connections = 2

path = /srv/node/

read only = false

lock file = /var/lock/object.lock

vim /etc/xinetd.d/rsync

disable = no

service xinetd start

mkdir -p /var/swift/recon

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

配置 proxy-node(controller)

安装swift-proxy的相关包:

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

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

vim /etc/sysconfig/memcached

OPTIONS="-l 10.0.0.11"

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

service memcached restart

chkconfig memcached on

vim /etc/swift/proxy-server.conf

[DEFAULT]

bind_port = 8080

user = swift

[pipeline:main]

pipeline = healthcheck cache authtoken keystoneauth proxy-server

[app:proxy-server]

use = egg:swift#proxy

allow_account_management = true

account_autocreate = true

[filter:keystoneauth]

use = egg:swift#keystoneauth

operator_roles = Member,admin,swiftoperator

[filter:authtoken]

paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory

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

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

delay_auth_decision = true

# auth_* settings refer to the Keystone server

auth_protocol = http

auth_host = controller

auth_port = 35357

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

admin_tenant_name = service

admin_user = swift

admin_password = swift

[filter:cache]

use = egg:swift#memcache

[filter:catch_errors]

use = egg:swift#catch_errors

[filter:healthcheck]

use = egg:swift#healthcheck

构建ring:

cd /etc/swift

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

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

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

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

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

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

swift-ring-builder account.builder

swift-ring-builder container.builder

swift-ring-builder object.builder

swift-ring-builder account.builder rebalance

swift-ring-builder container.builder rebalance

swift-ring-builder object.builder rebalance

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

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

若没有scp命令,执行:

yum install -y openssh-clients

chown -R swift:swift /etc/swift

service openstack-swift-proxy restart

chkconfig openstack-swift-proxy on

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

service openstack-swift-object restart

service openstack-swift-object-replicator restart

service openstack-swift-object-updater restart

service openstack-swift-object-auditor restart

service openstack-swift-container start

service openstack-swift-container-replicator restart

service openstack-swift-container-updater restart

service openstack-swift-container-auditor restart

service openstack-swift-account restart

service openstack-swift-account-replicator restart

service openstack-swift-account-reaper restart

service openstack-swift-account-auditor restart

chkconfig openstack-swift-object on

chkconfig openstack-swift-object-replicator on

chkconfig openstack-swift-object-updater on

chkconfig openstack-swift-object-auditor on

chkconfig openstack-swift-container on

chkconfig openstack-swift-container-replicator on

chkconfig openstack-swift-container-updater on

chkconfig openstack-swift-container-auditor on

chkconfig openstack-swift-account on

chkconfig openstack-swift-account-replicator on

chkconfig openstack-swift-account-reaper on

chkconfig openstack-swift-account-auditor on

或者是一次启动:

swift-init all start

controller节点验证swift服务

source  admin-openrc.sh

swift stat

swift upload myfiles test.txt

swift upload myfiles test2.txt

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


当前标题:swift手工搭建-创新互联
网页网址:http://cqcxhl.cn/article/eohej.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP