Remove swift
Change-Id: I12179451a10bffe03d7eae571bb0361cafbbb74e
This commit is contained in:
@@ -40,10 +40,6 @@ if ! yum repolist enabled epel | grep -q epel; then
|
||||
yum install -y https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm || \
|
||||
exit_abort "Failed to install EPEL repository"
|
||||
fi
|
||||
if ! yum repolist enabled openstack-icehouse | grep -q openstack-icehouse; then
|
||||
yum install -y https://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm || \
|
||||
exit_abort "Failed to install RDO repository"
|
||||
fi
|
||||
|
||||
|
||||
########################################
|
||||
@@ -53,8 +49,7 @@ echo "Ensure that the required packages are installed..."
|
||||
yum -y install \
|
||||
libffi-devel libgcc-devel gcc python-devel python-lxml libxslt-devel \
|
||||
libxml2-devel openssl-devel MySQL-python mysql-server python-pip redis \
|
||||
openstack-swift openstack-swift-proxy openstack-swift-account openstack-swift-container \
|
||||
openstack-swift-object memcached rsync xinetd openstack-utils xfsprogs rabbitmq-server || \
|
||||
rabbitmq-server || \
|
||||
exit_abort "Failed to install the required rpm packages"
|
||||
|
||||
service iptables stop
|
||||
@@ -142,97 +137,6 @@ cp -f $ROOT_DIR/tools/setup/websocket_server.py /usr/bin/websocket_server
|
||||
chmod +x /usr/bin/websocket_server
|
||||
|
||||
|
||||
########################################
|
||||
# Setup Swift
|
||||
########################################
|
||||
# configure rsync daemon
|
||||
cat << EOF > /etc/rsyncd.conf
|
||||
uid = swift
|
||||
gid = swift
|
||||
log file = /var/log/rsyncd.log
|
||||
pid file = /var/run/rsyncd.pid
|
||||
address =0.0.0.0
|
||||
|
||||
[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
|
||||
EOF
|
||||
|
||||
sed -i "s/\(^ *disable =\) yes/\1 no/" /etc/xinetd.d/rsync
|
||||
|
||||
# mount a loopback device for Swift storage node
|
||||
umount /srv/node/part1 > /dev/null 2>&1
|
||||
rm -fr /srv/node/part1
|
||||
mkdir -p /srv/node/part1
|
||||
rm -fr /srv/swift-disk
|
||||
dd if=/dev/zero of=/srv/swift-disk bs=1GB count=10 || exit_abort "(Swift setup) Failed to create a dummy file"
|
||||
mkfs.xfs /srv/swift-disk || exit_abort "(Swift setup) Failed to make a XFS file system"
|
||||
if ! grep -q /srv/node/part1 /etc/fstab; then
|
||||
echo "/srv/swift-disk /srv/node/part1 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab
|
||||
fi
|
||||
mount /srv/node/part1 || exit_abort "(Swift setup) Failed to mount a loopback device"
|
||||
chown -R swift:swift /srv/node
|
||||
|
||||
# configure swift.conf
|
||||
openstack-config --set /etc/swift/swift.conf swift-hash swift_hash_path_suffix realapplicationcentrickernel
|
||||
|
||||
# configure account-server.conf
|
||||
openstack-config --set /etc/swift/account-server.conf DEFAULT bind_ip 127.0.0.1
|
||||
openstack-config --set /etc/swift/account-server.conf DEFAULT user swift
|
||||
openstack-config --set /etc/swift/account-server.conf DEFAULT devices /srv/node
|
||||
|
||||
# configure container-server.conf
|
||||
openstack-config --set /etc/swift/container-server.conf DEFAULT bind_ip 127.0.0.1
|
||||
openstack-config --set /etc/swift/container-server.conf DEFAULT user swift
|
||||
openstack-config --set /etc/swift/container-server.conf DEFAULT devices /srv/node
|
||||
|
||||
# configure object-server.conf
|
||||
openstack-config --set /etc/swift/object-server.conf DEFAULT bind_ip 127.0.0.1
|
||||
openstack-config --set /etc/swift/object-server.conf DEFAULT user swift
|
||||
openstack-config --set /etc/swift/object-server.conf DEFAULT devices /srv/node
|
||||
|
||||
# configure proxy-server.conf
|
||||
openstack-config --set /etc/swift/proxy-server.conf DEFAULT bind_ip 0.0.0.0
|
||||
openstack-config --set /etc/swift/proxy-server.conf DEFAULT workers 1
|
||||
openstack-config --set /etc/swift/proxy-server.conf DEFAULT user swift
|
||||
openstack-config --set /etc/swift/proxy-server.conf pipeline:main pipeline "healthcheck cache tempauth proxy-server"
|
||||
openstack-config --set /etc/swift/proxy-server.conf filter:tempauth use egg:swift#tempauth
|
||||
openstack-config --set /etc/swift/proxy-server.conf filter:tempauth user_rack_admin "admin .admin"
|
||||
|
||||
# resister ring files
|
||||
cd /etc/swift
|
||||
swift-ring-builder account.builder create 18 1 1
|
||||
swift-ring-builder container.builder create 18 1 1
|
||||
swift-ring-builder object.builder create 18 1 1
|
||||
swift-ring-builder account.builder add z0-127.0.0.1:6002/part1 100
|
||||
swift-ring-builder container.builder add z0-127.0.0.1:6001/part1 100
|
||||
swift-ring-builder object.builder add z0-127.0.0.1:6000/part1 100
|
||||
swift-ring-builder account.builder rebalance
|
||||
swift-ring-builder container.builder rebalance
|
||||
swift-ring-builder object.builder rebalance
|
||||
chown -R swift:swift /etc/swift
|
||||
|
||||
# check if the services work
|
||||
service memcached restart || exit_abort "Failed to start memcached"
|
||||
service xinetd restart || exit_abort "Failed to start xinetd"
|
||||
swift-init main start || exit_abort "Failed to start the main Swift services"
|
||||
swift-init rest start || exit_abort "Failed to start the rest of the Swift services"
|
||||
|
||||
|
||||
########################################
|
||||
# Prepare for Save as Snapshot
|
||||
########################################
|
||||
|
||||
@@ -33,6 +33,8 @@ api() {
|
||||
|
||||
proxy() {
|
||||
rackapi_ip=$(echo $META | jq -r '.rackapi_ip')
|
||||
gid=$(echo $META | jq -r '.gid')
|
||||
pid=$(echo $META | jq -r '.pid')
|
||||
sed -i '/^sql_connection/d' $RACK_CONF
|
||||
echo "sql_connection = mysql://root:password@${rackapi_ip}/rack?charset=utf8" >> $RACK_CONF
|
||||
rack-api --config-file $RACK_CONF &
|
||||
@@ -40,9 +42,9 @@ proxy() {
|
||||
websocket_server -d --bind-ipaddress 0.0.0.0 --bind-port 8888 --logfile /var/log/rack/ipc.log &
|
||||
service redis start || { echo "Error: redis could not start."; exit 1; }
|
||||
service rabbitmq-server start || { echo "Error: rabbitmq-server could not start."; exit 1; }
|
||||
service memcached start || { echo "Error: memcached could not start."; exit 1; }
|
||||
service xinetd start || { echo "Error: xinetd could not start."; exit 1; }
|
||||
swift-init main start && swift-init rest start || { echo "Error: Swift services could not start."; exit 1; }
|
||||
curl ${rackapi_ip}:8088/v1/groups/${gid}/processes/${pid} -X PUT \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"process\": {\"app_status\": \"ACTIVE\"}}"
|
||||
}
|
||||
|
||||
# main
|
||||
|
||||
Reference in New Issue
Block a user