记一次云计算测试实验-openstack-icehouse-安装swift

----------------------- controller : ---------------------------------

source admin-openrc.sh

keystone user-create --name=swift --pass=000000 [email protected]

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

keystone role-create --name=SwiftOperator

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

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/v2/AUTH_%(tenant_id)s" \

--internalurl="http:/controller:8080/v2/AUTH_%(tenant_id)s" \

--adminurl="http://controller:8080/v2/AUTH_%(tenant_id)s"

----------------------- controller & compute : ---------------------------------

mkdir -p /etc/swift

echo "[swift-hash]" >> /etc/swift/swift.conf

echo "swift_hash_path_suffix = fLIbertYgibbitZ" >> /etc/swift/swift.conf

----------------------- compute : ---------------------------------

yum -y install openstack-swift openstack-swift-account openstack-swift-container openstack-swift-object xfsprogs xinetd rsync

cat /pro /part

(这里为sda6,根据自己情况)

mkfs.xfs -i size=1024 -f /dev/sda6

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

mkdir -p /srv/node

mount /dev/sda6 /srv/node

chown -R swift:swift /srv/node

vi /etc/rsyncd.conf

uid = swift

gid = swift

log file = /var/log/rsyncd.log

pid file = /var/run/rsyncd.pid

address = 127.0.0.1

[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

vi /etc/xinetd.d/rsync

disable = no

flags = IPv4

service xinetd start

chkconfig xinetd on

mkdir -p /var/swift/recon

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

----------------------- controller : ---------------------------------

yum install openstack-swift-proxy memcached python-swiftclient

openstack-config --set /etc/swift/proxy-server.conf DEFAULT bind_port 8080

openstack-config --set /etc/swift/proxy-server.conf DEFAULT workers 8

openstack-config --set /etc/swift/proxy-server.conf DEFAULT user swift

openstack-config --set /etc/swift/proxy-server.conf DEFAULT log_name proxy

openstack-config --set /etc/swift/proxy-server.conf DEFAULT log_level DEBUG

openstack-config --set /etc/swift/proxy-server.conf DEFAULT log_facility LOG_LOCAL0

openstack-config --set /etc/swift/proxy-server.conf pipeline:main pipeline healthcheck\ cache\ authtoken\ keystone\ proxy-server

openstack-config --set /etc/swift/proxy-server.conf app:proxy-server use egg:swift#proxy

openstack-config --set /etc/swift/proxy-server.conf app:proxy-server allow_account_management true

openstack-config --set /etc/swift/proxy-server.conf app:proxy-server account_autocreate true

openstack-config --set /etc/swift/proxy-server.conf filter:cache use egg:swift#memcache

openstack-config --set /etc/swift/proxy-server.conf filter:cache memcache_servers 127.0.0.1:11211

openstack-config --set /etc/swift/proxy-server.conf filter:catch_errors use egg:swift#catch_errors

openstack-config --set /etc/swift/proxy-server.conf filter:healthcheck use egg:swift#healthcheck

openstack-config --set /etc/swift/proxy-server.conf filter:keystone use egg:swift#keystoneauth

openstack-config --set /etc/swift/proxy-server.conf filter:keystone operator_roles admin,\ SwiftOperator,\ _member_

openstack-config --set /etc/swift/proxy-server.conf filter:keystone is_admin true

openstack-config --set /etc/swift/proxy-server.conf filter:keystone cache swift.cache

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken signing_dir /tmp/keystone-signing-swift

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken auth_protocol http

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken auth_host controller

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken auth_port 35357

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken admin_tenant_name service

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken admin_user swift

openstack-config --set /etc/swift/proxy-server.conf filter:authtoken admin_password 000000

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-192.168.100.20:6002R192.168.100.20:6005/sda6 100

swift-ring-builder container.builder add z1-192.168.100.20:6001R192.168.100.20:6004/sda6 100

swift-ring-builder object.builder add z1-192.168.100.20:6000R192.168.100.20:6003/sda6 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

拷贝 /etc/swift 中的 account.ring.gz、container.ring.gz 和 object.ring.gz 文件到存储(计算)节点 /etc/swift/ 下:

[[email protected] swift]# cp *.gz /var/ftp

compute :

yum install ftp

cd /etc/swift/

ftp controller

Name (controller:root): anonymous

Password:

ftp> ls

ftp> get account.ring.gz

ftp> get container.ring.gz

ftp> get object.ring.gz

ftp> bye

controller :

chown -R swift:swift /etc/swift

service openstack-swift-proxy start

chkconfig openstack-swift-proxy on

----------------------- compute : ---------------------------------

sed -i ‘s/^bind_ip.*/#bind_ip = /g‘ /etc/swift/account-server.conf

sed -i ‘s/^bind_ip.*/#bind_ip = /g‘ /etc/swift/container-server.conf

sed -i ‘s/^bind_ip.*/#bind_ip = /g‘ /etc/swift/object-server.conf

mv /etc/swift/account-server.conf /etc/swift/account-server/1.conf

mv /etc/swift/container-server.conf /etc/swift/container-server/1.conf

mv /etc/swift/object-server.conf /etc/swift/object-server/1.conf

openstack-config --set /etc/swift/account-server/1.conf DEFAULT bind_port 6002

openstack-config --set /etc/swift/account-server/1.conf DEFAULT workers 2

openstack-config --set /etc/swift/account-server/1.conf DEFAULT user swift

openstack-config --set /etc/swift/account-server/1.conf DEFAULT devices /srv/node/

openstack-config --set /etc/swift/account-server/1.conf DEFAULT mount_check false

openstack-config --set /etc/swift/account-server/1.conf DEFAULT log_name swift-account

openstack-config --set /etc/swift/account-server/1.conf DEFAULT log_facility LOG_LOCAL1

openstack-config --set /etc/swift/account-server/1.conf DEFAULT log_level DEBUG

openstack-config --set /etc/swift/account-server/1.conf account-replicator vm_test_mode no

openstack-config --set /etc/swift/container-server/1.conf DEFAULT bind_port 6001

openstack-config --set /etc/swift/container-server/1.conf DEFAULT workers 2

openstack-config --set /etc/swift/container-server/1.conf DEFAULT user swift

openstack-config --set /etc/swift/container-server/1.conf DEFAULT devices /srv/node/

openstack-config --set /etc/swift/container-server/1.conf DEFAULT mount_check false

openstack-config --set /etc/swift/container-server/1.conf DEFAULT log_name swift-container

openstack-config --set /etc/swift/container-server/1.conf DEFAULT log_facility LOG_LOCAL1

openstack-config --set /etc/swift/container-server/1.conf DEFAULT log_level DEBUG

openstack-config --set /etc/swift/container-server/1.conf account-replicator vm_test_mode no

openstack-config --set /etc/swift/object-server/1.conf DEFAULT bind_port 6000

openstack-config --set /etc/swift/object-server/1.conf DEFAULT workers 2

openstack-config --set /etc/swift/object-server/1.conf DEFAULT user swift

openstack-config --set /etc/swift/object-server/1.conf DEFAULT devices /srv/node/

openstack-config --set /etc/swift/object-server/1.conf DEFAULT mount_check false

openstack-config --set /etc/swift/object-server/1.conf DEFAULT log_name swift-object

openstack-config --set /etc/swift/object-server/1.conf account-replicator vm_test_mode no

echo "local1.* /var/log/swift/storage1.log" >> /etc/rsyslog.d/10-swift.conf

mkdir -p /var/log/swift

chown -R swift:swift /var/log/swift

service rsyslog restart

chown -R swift:swift /var/swift

chown -R swift:swift /var/cache/swift

swift-init object-server start

swift-init object-replicator start

swift-init object-updater start

swift-init object-auditor start

swift-init container-server start

swift-init container-replicator start

swift-init container-updater start

swift-init container-auditor start

swift-init account-server start

swift-init account-replicator start

swift-init account-auditor start

vi /etc/rc.local

/usr/bin/swift-init object-server start

/usr/bin/swift-init object-replicator start

/usr/bin/swift-init object-updater start

/usr/bin/swift-init object-auditor start

/usr/bin/swift-init container-server start

/usr/bin/swift-init container-replicator start

/usr/bin/swift-init container-updater start

/usr/bin/swift-init container-auditor start

/usr/bin/swift-init account-server start

/usr/bin/swift-init account-replicator start

/usr/bin/swift-init account-auditor start

这时 web界面刷新后可以看到

多了一个存储。

这个可以提供给javaee   安卓开发做存储用

到这里,openstack的iaas基本就这样了。

如果有朋友有什么多的或者什么技术交流,可以再交流一下。

时间: 2024-10-10 09:05:32

记一次云计算测试实验-openstack-icehouse-安装swift的相关文章

记一次云计算测试实验-openstack-icehouse-compute节点-安装neutron

现在在compute完成一下比较轻松的操作 yum install openstack-neutron-ml2 openstack-neutron-openvswitch -y openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http

记一次云计算测试实验-openstack-icehouse-compute节点-安装nova

yum install openstack-nova-compute -y openstack-config --set /etc/nova/nova.conf database connection mysql://nova:[email protected]/nova openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone openstack-config --set /etc/nova/nova.c

记一次云计算测试实验-openstack-icehouse-环境初始化

为了方便实验的进行. 将镜像文件使用winscp上传到controller节点的/opt. 配置本地源. compute节点采用ftp源. centos6.5镜像文件自己准备即可.6.3到6.6之间都可以的 既然做了云计算实验,那我就默认是你懂得Linux基础了.所以什么命令找不到了路径不存在了之类的,有些文件名字请根据自己实际情况,下面内容仅供参考.没学过Linux不要轻易做云计算实验,要不你会发现还是vmware省事. 也可以采用阿里镜像的网络源,记得添加epel源. iaas资源镜像下载

记一次云计算测试实验-openstack-icehouse-环境介绍

统一centos6.5 minimal 一台浪潮服务器,8g内存,2t硬盘,raid1,controller节点 一台浪潮服务器,8g内存,3t硬盘,raid5,compute节点 因为thinkserver的噪音比这两天小浪潮的大的多,所以本着做实验的原则,选择性能不是太高的. 一台DCRS-5750 一台DCFW-1800-E3000  (可以在实验中不用.自选)

记一次云计算测试实验-openstack-icehouse-安装keystone

mysql -uroot -p000000 CREATE DATABASE keystone; CREATE DATABASE glance; CREATE DATABASE nova; CREATE DATABASE neutron; CREATE DATABASE cinder; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY '000000'; GRANT ALL PRIVILEGES O

记一次云计算测试实验-openstack-icehouse-安装glance

source admin-openrc.sh yum install openstack-glance python-glanceclient -y openstack-config --set /etc/glance/glance-api.conf database connection mysql://glance:[email protected]/glance openstack-config --set /etc/glance/glance-registry.conf database

记一次云计算测试实验-openstack-icehouse-安装nova

cd source admin-openrc.sh yum install -y openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient openstack-config --set /etc/nova/nova.conf database c

记一次云计算测试实验-openstack-icehouse-安装neutron

现在,我们回到controller节点 source admin-openrc.sh keystone user-create --name neutron --pass 000000 --email [email protected] keystone user-role-add --user neutron --tenant service --role admin keystone service-create --name neutron --type network --descrip

记一次云计算测试实验-openstack-icehouse-安装dashboard

来到controller节点,完成这个重要的操作. yum install -y memcached python-memcached mod_wsgi openstack-dashboard vi /etc/openstack-dashboard/local_settings TIME_ZONE = "Asia/Shanghai" ALLOWED_HOSTS = ['*'] OPENSTACK_HOST = "controller" setsebool -P ht