Implement Swift Containers

Known bugs/TODOs at this time of this patch update:

https://bugs.launchpad.net/kolla/+bug/1477990
https://bugs.launchpad.net/kolla/+bug/1477993

Implements: Blueprint swift-container
Closes-bug: #1477992
Co-Authored-By: Paul Bourke <paul.bourke@oracle.com>
Change-Id: I031f88a7cd1867104fef12df6ab3ffcc06cb65d6
This commit is contained in:
James McCarthy 2015-07-15 16:00:23 +01:00 committed by Paul Bourke
parent 6b1f9714c7
commit 5e28eb8496
93 changed files with 1051 additions and 163 deletions

7
compose/swift-proxy.yml Normal file
View File

@ -0,0 +1,7 @@
swiftproxyserver:
image: kollaglue/centos-rdo-swift-proxy-server:latest
name: swiftproxyserver
restart: always
net: host
env_file:
- openstack.env

73
compose/swift-storage.yml Normal file
View File

@ -0,0 +1,73 @@
swiftdata:
image: kollaglue/centos-rdo-swift-data:latest
name: swiftdata
swiftobjectserver:
image: kollaglue/centos-rdo-swift-object-server:latest
name: swiftobjectserver
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata
swiftobjectauditor:
image: kollaglue/centos-rdo-swift-object-auditor:latest
name: swiftobjectauditor
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata
swiftobjectexpirer:
image: kollaglue/centos-rdo-swift-object-expirer:latest
name: swiftobjectexpirer
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata
swiftobjectreplicator:
image: kollaglue/centos-rdo-swift-object-replicator:latest
name: swiftobjectreplicator
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata
swiftobjectupdater:
image: kollaglue/centos-rdo-swift-object-updater:latest
name: swiftobjectupdater
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata
swiftcontainerserver:
image: kollaglue/centos-rdo-swift-container-server:latest
name: swiftcontainerserver
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata
swiftaccountserver:
image: kollaglue/centos-rdo-swift-account-server:latest
name: swiftaccountserver
restart: always
net: host
env_file:
- openstack.env
volumes_from:
- swiftdata

View File

@ -1,8 +1,11 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
RUN yum -y install \
openstack-swift-account \
&& yum clean all
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-account-server/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-account-server/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-account-server/start.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-account/config-external.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-account/config-internal.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-account/start.sh

View File

@ -1,8 +1,8 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum -y install openstack-utils openstack-swift && yum clean all
RUN yum -y install openstack-swift && yum clean all
COPY config-swift.sh build-swift-ring.py /opt/kolla/
# These will come after we sort out start time config
RUN mkdir /opt/swift
config-swift.sh /opt/swift/config-swift.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-base/build-swift-ring.py

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-base/config-swift.sh

View File

@ -1,8 +1,11 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
RUN yum -y install \
openstack-swift-container \
&& yum clean all
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-container-server/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-container-server/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-container-server/start.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-container/config-external.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-container/config-internal.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-container/start.sh

View File

@ -0,0 +1,13 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
# NOTE(pbourke): This is emulating the Swift "all-in-one" setups where there are 3 disks/partitions
# on which to mirror data. This is extremely inefficient and is really only to prove everything
# works in an AIO setup. For production deploys the Ansible provisioned setup should be used.
VOLUME [ "/srv/node/sdb1" ]
VOLUME [ "/srv/node/sdb2" ]
VOLUME [ "/srv/node/sdb3" ]
# Command needed to start the data container.
# Note: data containers do not need to be persistent.
CMD ["/bin/true"]

View File

@ -1,8 +1,7 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%%
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-object-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY ./start.sh /start.sh
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-auditor/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-auditor/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-auditor/start.sh

View File

@ -0,0 +1,8 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum -y install \
openstack-swift-object \
&& yum clean all
COPY config-swift-object.sh /opt/kolla/

View File

@ -0,0 +1 @@
../../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-base/config-swift-object.sh

View File

@ -0,0 +1,12 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-object-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum -y install \
openstack-swift-proxy \
openstack-swift-container \
&& yum clean all
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-expirer/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-expirer/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-expirer/start.sh

View File

@ -0,0 +1,7 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-object-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-replicator/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-replicator/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-replicator/start.sh

View File

@ -0,0 +1,7 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-object-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-server/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-server/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-server/start.sh

View File

@ -0,0 +1,7 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-object-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY start.sh /
COPY config-internal.sh config-external.sh /opt/kolla/
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../../../tools/build-docker-image

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-updater/config-external.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-updater/config-internal.sh

View File

@ -0,0 +1 @@
../../../../../docker/common/swift/swift-object-updater/start.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-object/config-external.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-object/config-internal.sh

View File

@ -1 +0,0 @@
../../../../common/swift/swift-object/start.sh

View File

@ -1,6 +1,8 @@
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%swift-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum -y install openstack-swift-proxy && yum clean all
COPY ./start.sh /start.sh
COPY config-internal.sh config-external.sh /opt/kolla/

View File

@ -1 +1 @@
../../../../common/swift/swift-proxy-server/config-external.sh
../../../../../docker/common/swift/swift-proxy-server/config-external.sh

View File

@ -1 +1 @@
../../../../common/swift/swift-proxy-server/config-internal.sh
../../../../../docker/common/swift/swift-proxy-server/config-internal.sh

View File

@ -1 +1 @@
../../../../common/swift/swift-proxy-server/start.sh
../../../../../docker/common/swift/swift-proxy-server/start.sh

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/account-server.conf ]]; then
cp /opt/kolla/swift/account-server.conf /etc/swift/
chown swift: /etc/swift/account-server.conf
chmod 0640 /etc/swift/account-server.conf
fi

View File

@ -0,0 +1,54 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-account-server"
ARGS="/etc/swift/account-server.conf --verbose"
. /opt/kolla/config-swift.sh
check_required_vars \
SWIFT_ACCOUNT_SVC_BIND_IP \
SWIFT_ACCOUNT_SVC_BIND_PORT \
SWIFT_ACCOUNT_SVC_DEVICES \
SWIFT_ACCOUNT_SVC_MOUNT_CHECK \
SWIFT_ACCOUNT_SVC_RING_DEVICES \
SWIFT_ACCOUNT_SVC_RING_HOSTS \
SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS \
SWIFT_ACCOUNT_SVC_RING_NAME \
SWIFT_ACCOUNT_SVC_RING_PART_POWER \
SWIFT_ACCOUNT_SVC_RING_REPLICAS \
SWIFT_ACCOUNT_SVC_RING_WEIGHTS \
SWIFT_ACCOUNT_SVC_RING_ZONES \
SWIFT_DIR \
SWIFT_USER
exec $CMD $ARGS
cfg=/etc/swift/account-server.conf
# [DEFAULT]
crudini --set $cfg DEFAULT bind_ip "${SWIFT_ACCOUNT_SVC_BIND_IP}"
crudini --set $cfg DEFAULT bind_port "${SWIFT_ACCOUNT_SVC_BIND_PORT}"
crudini --set $cfg DEFAULT user "${SWIFT_USER}"
crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}"
crudini --set $cfg DEFAULT devices "${SWIFT_ACCOUNT_SVC_DEVICES}"
crudini --set $cfg DEFAULT mount_check "${SWIFT_ACCOUNT_SVC_MOUNT_CHECK}"
# Create swift user and group if they don't exist
id -u swift &>/dev/null || useradd --user-group swift
# Ensure proper ownership of the mount point directory structure
chown -R swift:swift /srv/node
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_ACCOUNT_SVC_RING_NAME} \
-p ${SWIFT_ACCOUNT_SVC_RING_PART_POWER} \
-r ${SWIFT_ACCOUNT_SVC_RING_REPLICAS} \
-m ${SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_ACCOUNT_SVC_RING_HOSTS} \
-w ${SWIFT_ACCOUNT_SVC_RING_WEIGHTS} \
-d ${SWIFT_ACCOUNT_SVC_RING_DEVICES} \
-z ${SWIFT_ACCOUNT_SVC_RING_ZONES}
exec $CMD $ARGS

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-account-server"
ARGS="/etc/swift/account-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
exec $CMD $ARGS

View File

@ -1,10 +0,0 @@
#!/bin/bash
SOURCE="/opt/kolla/swift-account/swift.conf"
TARGET="/etc/swift/swift.conf"
OWNER="swift"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -1,29 +0,0 @@
#!/bin/bash
check_required_vars KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_TOKEN \
SWIFT_ADMIN_PASSWORD
fail_unless_db
fail_unless_os_service_running keystone
if ! [ "$SWIFT_DB_PASSWORD" ]; then
SWIFT_DB_PASSWORD=$(openssl rand -hex 15)
export SWIFT_DB_PASSWORD
fi
sh /opt/swift/config-swift.sh account-server
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME};
GRANT ALL PRIVILEGES ON swift* TO
'${SWIFT_DB_USER}'@'%' IDENTIFIED BY '${SWIFT_DB_PASSWORD}'
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}
/bin/keystone user-role-add --user ${SWIFT_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/swift-engine

View File

@ -0,0 +1,93 @@
#!/usr/bin/env python
# Copyright 2015 Paul Bourke
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This script is a simple wrapper used to create and rebalance Swift ring files.
"""
import argparse
import subprocess
import sys
def setup_args():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--ring-file",
required=True,
help="Path to ring file")
parser.add_argument("-p", "--part-power",
required=True,
help="Part power")
parser.add_argument("-r", "--num-replicas",
required=True,
help="Number of replicas")
parser.add_argument("-m", "--min-part-hours",
required=True,
help="Min part hours")
parser.add_argument("-H", "--hosts",
required=True,
help="Hosts in the ring, comma delimited")
parser.add_argument("-w", "--weights",
required=True,
help="Weight of each host, comma delimited")
parser.add_argument("-d", "--devices",
required=True,
help="Device on each host, comma delimited")
parser.add_argument("-z", "--zones",
required=True,
help="Zone of each host, comma delimited")
return parser.parse_args()
def run_cmd(cmd):
print(' '.join(cmd))
subprocess.call(cmd)
def run(args):
hosts = args.hosts.split(',')
weights = args.weights.split(',')
zones = args.zones.split(',')
devices = args.devices.split(',')
if not (len(hosts) == len(weights) == len(zones) == len(devices)):
print('Error: an equal amount of hosts, devices, weights, '
'and zones are required')
sys.exit(1)
run_cmd(['/usr/bin/swift-ring-builder',
args.ring_file,
'create',
args.part_power,
args.num_replicas,
args.min_part_hours])
for i in xrange(len(hosts)):
run_cmd(['/usr/bin/swift-ring-builder',
args.ring_file,
'add',
'z{}-{}/{}'.format(zones[i], hosts[i], devices[i]),
weights[i]])
run_cmd(['/usr/bin/swift-ring-builder', args.ring_file, 'rebalance'])
def main():
args = setup_args()
run(args)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,9 @@
#!/bin/bash
. /opt/kolla/kolla-common.sh
check_required_vars SWIFT_HASH_PATH_SUFFIX
cfg=/etc/swift/swift.conf
crudini --set $cfg swift-hash swift_hash_path_suffix "${SWIFT_HASH_PATH_SUFFIX}"

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/container-server.conf ]]; then
cp /opt/kolla/swift/container-server.conf /etc/swift/
chown swift: /etc/swift/container-server.conf
chmod 0640 /etc/swift/container-server.conf
fi

View File

@ -0,0 +1,52 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-container-server"
ARGS="/etc/swift/container-server.conf --verbose"
. /opt/kolla/config-swift.sh
check_required_vars \
SWIFT_CONTAINER_SVC_BIND_IP \
SWIFT_CONTAINER_SVC_BIND_PORT \
SWIFT_CONTAINER_SVC_DEVICES \
SWIFT_CONTAINER_SVC_MOUNT_CHECK \
SWIFT_CONTAINER_SVC_RING_DEVICES \
SWIFT_CONTAINER_SVC_RING_HOSTS \
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \
SWIFT_CONTAINER_SVC_RING_NAME \
SWIFT_CONTAINER_SVC_RING_PART_POWER \
SWIFT_CONTAINER_SVC_RING_REPLICAS \
SWIFT_CONTAINER_SVC_RING_WEIGHTS \
SWIFT_CONTAINER_SVC_RING_ZONES \
SWIFT_DIR \
SWIFT_USER
cfg=/etc/swift/container-server.conf
# [DEFAULT]
crudini --set $cfg DEFAULT bind_ip "${SWIFT_CONTAINER_SVC_BIND_IP}"
crudini --set $cfg DEFAULT bind_port "${SWIFT_CONTAINER_SVC_BIND_PORT}"
crudini --set $cfg DEFAULT user "${SWIFT_USER}"
crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}"
crudini --set $cfg DEFAULT devices "${SWIFT_CONTAINER_SVC_DEVICES}"
crudini --set $cfg DEFAULT mount_check "${SWIFT_CONTAINER_SVC_MOUNT_CHECK}"
# Create swift user and group if they don't exist
id -u swift &>/dev/null || useradd --user-group swift
# Ensure proper ownership of the mount point directory structure
chown -R swift:swift /srv/node
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_CONTAINER_SVC_RING_NAME} \
-p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \
-r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \
-m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \
-w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \
-d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \
-z ${SWIFT_CONTAINER_SVC_RING_ZONES}
exec $CMD $ARGS

View File

@ -1,8 +1,9 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-container-server"
ARGS=""
ARGS="/etc/swift/container-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh

View File

@ -1,10 +0,0 @@
#!/bin/bash
SOURCE="/opt/kolla/swift-container/swift.conf"
TARGET="/etc/swift/swift.conf"
OWNER="swift"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -1,29 +0,0 @@
#!/bin/bash
check_required_vars KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_TOKEN \
SWIFT_ADMIN_PASSWORD
fail_unless_db
fail_unless_os_service_running keystone
if ! [ "$SWIFT_DB_PASSWORD" ]; then
SWIFT_DB_PASSWORD=$(openssl rand -hex 15)
export SWIFT_DB_PASSWORD
fi
sh /opt/swift/config-swift.sh container
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME};
GRANT ALL PRIVILEGES ON swift* TO
'${SWIFT_DB_USER}'@'%' IDENTIFIED BY '${SWIFT_DB_PASSWORD}'
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}
/bin/keystone user-role-add --user ${SWIFT_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/swift-container-server

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /opt/kolla/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-object-auditor"
ARGS="/etc/swift/object-server.conf --verbose"
. /opt/kolla/config-swift.sh
. /opt/kolla/config-swift-object.sh
exec $CMD $ARGS

View File

@ -1,8 +1,9 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-engine"
ARGS=""
CMD="/usr/bin/swift-object-auditor"
ARGS="/etc/swift/object-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh

View File

@ -0,0 +1,72 @@
#!/bin/bash
. /opt/kolla/kolla-common.sh
check_required_vars \
SWIFT_CONTAINER_SVC_RING_DEVICES \
SWIFT_CONTAINER_SVC_RING_HOSTS \
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \
SWIFT_CONTAINER_SVC_RING_NAME \
SWIFT_CONTAINER_SVC_RING_PART_POWER \
SWIFT_CONTAINER_SVC_RING_REPLICAS \
SWIFT_CONTAINER_SVC_RING_WEIGHTS \
SWIFT_CONTAINER_SVC_RING_ZONES \
SWIFT_DIR \
SWIFT_OBJECT_SVC_BIND_IP \
SWIFT_OBJECT_SVC_BIND_PORT \
SWIFT_OBJECT_SVC_DEVICES \
SWIFT_OBJECT_SVC_MOUNT_CHECK \
SWIFT_OBJECT_SVC_PIPELINE \
SWIFT_OBJECT_SVC_RING_DEVICES \
SWIFT_OBJECT_SVC_RING_HOSTS \
SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS \
SWIFT_OBJECT_SVC_RING_NAME \
SWIFT_OBJECT_SVC_RING_PART_POWER \
SWIFT_OBJECT_SVC_RING_REPLICAS \
SWIFT_OBJECT_SVC_RING_WEIGHTS \
SWIFT_OBJECT_SVC_RING_ZONES \
SWIFT_USER
cfg=/etc/swift/object-server.conf
crudini --set $cfg DEFAULT bind_ip "${SWIFT_OBJECT_SVC_BIND_IP}"
crudini --set $cfg DEFAULT bind_port "${SWIFT_OBJECT_SVC_BIND_PORT}"
crudini --set $cfg DEFAULT user "${SWIFT_USER}"
crudini --set $cfg DEFAULT swift_dir "${SWIFT_DIR}"
crudini --set $cfg DEFAULT devices "${SWIFT_OBJECT_SVC_DEVICES}"
crudini --set $cfg DEFAULT mount_check "${SWIFT_OBJECT_SVC_MOUNT_CHECK}"
crudini --set $cfg pipeline:main pipeline "${SWIFT_OBJECT_SVC_PIPELINE}"
# NOTE(pbourke): some services require a section in the conf, even if empty
crudini --set $cfg object-expirer
# Create swift user and group if they don't exist
id -u swift &>/dev/null || useradd --user-group swift
# Ensure proper ownership of the mount point directory structure
chown -R swift:swift /srv/node
# TODO(pbourke): does this need to be on a data vol?
mkdir -p /var/cache/swift
chown -R swift:swift /var/cache/swift
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_OBJECT_SVC_RING_NAME} \
-p ${SWIFT_OBJECT_SVC_RING_PART_POWER} \
-r ${SWIFT_OBJECT_SVC_RING_REPLICAS} \
-m ${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_OBJECT_SVC_RING_HOSTS} \
-w ${SWIFT_OBJECT_SVC_RING_WEIGHTS} \
-d ${SWIFT_OBJECT_SVC_RING_DEVICES} \
-z ${SWIFT_OBJECT_SVC_RING_ZONES}
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_CONTAINER_SVC_RING_NAME} \
-p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \
-r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \
-m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \
-w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \
-d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \
-z ${SWIFT_CONTAINER_SVC_RING_ZONES}

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /opt/kolla/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/object-expirer.conf ]]; then
cp /opt/kolla/swift/object-expirer.conf /etc/swift/
chown swift: /opt/kolla/swift/object-expirer.conf
chmod 0640 /etc/swift/object-expirer.conf
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-object-expirer"
ARGS="/etc/swift/object-server.conf --verbose"
. /opt/kolla/config-swift.sh
. /opt/kolla/config-swift-object.sh
exec $CMD $ARGS

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-object-expirer"
ARGS="/etc/swift/object-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
exec $CMD $ARGS

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /opt/kolla/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /opt/kolla/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-object-replicator"
ARGS="/etc/swift/object-server.conf --verbose"
. /opt/kolla/config-swift.sh
. /opt/kolla/config-swift-object.sh
exec $CMD $ARGS

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-object-replicator"
ARGS="/etc/swift/object-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
exec $CMD $ARGS

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /opt/kolla/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /opt/kolla/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-object-server"
ARGS="/etc/swift/object-server.conf --verbose"
. /opt/kolla/config-swift.sh
. /opt/kolla/config-swift-object.sh
exec $CMD $ARGS

View File

@ -1,8 +1,9 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-object-server"
ARGS=""
ARGS="/etc/swift/object-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh

View File

@ -0,0 +1,13 @@
#!/bin/bash
if [[ -f /opt/kolla/swift/swift.conf ]]; then
cp /opt/kolla/swift/swift.conf /etc/swift/
chown swift: /etc/swift/swift.conf
chmod 0640 /etc/swift/swift.conf
fi
if [[ -f /opt/kolla/swift/object-server.conf ]]; then
cp /opt/kolla/swift/object-server.conf /etc/swift/
chown swift: /etc/swift/object-server.conf
chmod 0640 /etc/swift/object-server.conf
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
CMD="/usr/bin/swift-object-updater"
ARGS="/etc/swift/object-server.conf --verbose"
. /opt/kolla/config-swift.sh
. /opt/kolla/config-swift-object.sh
exec $CMD $ARGS

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-object-updater"
ARGS="/etc/swift/object-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
exec $CMD $ARGS

View File

@ -1,10 +0,0 @@
#!/bin/bash
SOURCE="/opt/kolla/swift-object/swift.conf"
TARGET="/etc/swift/swift.conf"
OWNER="swift"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi

View File

@ -1,29 +0,0 @@
#!/bin/bash
check_required_vars KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_TOKEN \
SWIFT_ADMIN_PASSWORD
fail_unless_db
fail_unless_os_service_running keystone
if ! [ "$SWIFT_DB_PASSWORD" ]; then
SWIFT_DB_PASSWORD=$(openssl rand -hex 15)
export SWIFT_DB_PASSWORD
fi
sh /opt/swift/config-swift.sh engine
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${SWIFT_DB_NAME};
GRANT ALL PRIVILEGES ON swift* TO
'${SWIFT_DB_USER}'@'%' IDENTIFIED BY '${SWIFT_DB_PASSWORD}'
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
/bin/keystone user-create --name ${SWIFT_KEYSTONE_USER} --pass ${SWIFT_ADMIN_PASSWORD}
/bin/keystone role-create --name ${SWIFT_KEYSTONE_USER}
/bin/keystone user-role-add --user ${SWIFT_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/swift-object-server

View File

@ -6,5 +6,5 @@ OWNER="swift"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
chmod 0640 $TARGET
fi

View File

@ -1,5 +1,149 @@
#!/bin/bash
sh /opt/swift/config-swift.sh proxy
set -e
exec /usr/bin/swift-proxy-server
CMD="/usr/bin/swift-proxy-server"
ARGS="/etc/swift/proxy-server.conf --verbose"
. /opt/kolla/config-swift.sh
check_required_vars \
SWIFT_ACCOUNT_SVC_RING_DEVICES \
SWIFT_ACCOUNT_SVC_RING_HOSTS \
SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS \
SWIFT_ACCOUNT_SVC_RING_NAME \
SWIFT_ACCOUNT_SVC_RING_PART_POWER \
SWIFT_ACCOUNT_SVC_RING_REPLICAS \
SWIFT_ACCOUNT_SVC_RING_WEIGHTS \
SWIFT_ACCOUNT_SVC_RING_ZONES \
SWIFT_ADMIN_USER \
SWIFT_CONTAINER_SVC_RING_DEVICES \
SWIFT_CONTAINER_SVC_RING_HOSTS \
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS \
SWIFT_CONTAINER_SVC_RING_NAME \
SWIFT_CONTAINER_SVC_RING_PART_POWER \
SWIFT_CONTAINER_SVC_RING_REPLICAS \
SWIFT_CONTAINER_SVC_RING_WEIGHTS \
SWIFT_CONTAINER_SVC_RING_ZONES \
SWIFT_KEYSTONE_PASSWORD \
SWIFT_KEYSTONE_USER \
SWIFT_OBJECT_SVC_RING_DEVICES \
SWIFT_OBJECT_SVC_RING_HOSTS \
SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS \
SWIFT_OBJECT_SVC_RING_NAME \
SWIFT_OBJECT_SVC_RING_PART_POWER \
SWIFT_OBJECT_SVC_RING_REPLICAS \
SWIFT_OBJECT_SVC_RING_WEIGHTS \
SWIFT_OBJECT_SVC_RING_ZONES \
SWIFT_PROXY_ACCOUNT_AUTOCREATE \
SWIFT_PROXY_AUTH_PLUGIN \
SWIFT_PROXY_BIND_IP \
SWIFT_PROXY_BIND_PORT \
SWIFT_PROXY_DELAY_AUTH_DECISION \
SWIFT_PROXY_DIR \
SWIFT_PROXY_OPERATOR_ROLES \
SWIFT_PROXY_PASSWORD \
SWIFT_PROXY_PIPELINE_MAIN \
SWIFT_PROXY_PROJECT_DOMAIN_ID \
SWIFT_PROXY_PROJECT_NAME \
SWIFT_PROXY_SIGNING_DIR \
SWIFT_PROXY_USER_DOMAIN_ID \
SWIFT_PROXY_USERNAME \
SWIFT_USER
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
crux user-create --update \
-n "${SWIFT_KEYSTONE_USER}" \
-p "${SWIFT_KEYSTONE_PASSWORD}" \
-t "${ADMIN_TENANT_NAME}" \
-r admin
crux endpoint-create --remove-all \
-n swift -t object-store \
-I "http://${SWIFT_API_SERVICE_HOST}:8080/v1/AUTH_%(tenant_id)s'" \
-P "http://${PUBLIC_IP}:8080/v1/AUTH_%(tenant_id)s" \
-A "http://${SWIFT_API_SERVICE_HOST}:8080'"
cfg=/etc/swift/proxy-server.conf
crudini --set $cfg DEFAULT bind_port "${SWIFT_PROXY_BIND_PORT}"
crudini --set $cfg DEFAULT user "${SWIFT_USER}"
crudini --set $cfg DEFAULT swift_dir "${SWIFT_PROXY_DIR}"
crudini --set $cfg DEFAULT bind_ip "${SWIFT_PROXY_BIND_IP}"
crudini --set $cfg pipeline:main pipeline "${SWIFT_PROXY_PIPELINE_MAIN}"
crudini --set $cfg app:proxy-server account_autocreate "${SWIFT_PROXY_ACCOUNT_AUTOCREATE}"
crudini --del $cfg filter:keystone
crudini --set $cfg filter:keystoneauth use egg:swift#keystoneauth
crudini --set $cfg filter:keystoneauth operator_roles "${SWIFT_PROXY_OPERATOR_ROLES}"
crudini --set $cfg filter:container_sync use egg:swift#container_sync
crudini --set $cfg filter:bulk use egg:swift#bulk
crudini --set $cfg filter:ratelimit use egg:swift#ratelimit
crudini --set $cfg filter:authtoken auth_uri \
"http://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_PUBLIC_SERVICE_PORT}/"
crudini --set $cfg filter:authtoken auth_url \
"http://${KEYSTONE_PUBLIC_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/"
crudini --set $cfg filter:authtoken auth_host "${KEYSTONE_PUBLIC_SERVICE_HOST}"
crudini --set $cfg filter:authtoken auth_port "${KEYSTONE_ADMIN_SERVICE_PORT}"
crudini --set $cfg filter:authtoken admin_tenant_name "${ADMIN_TENANT_NAME}"
crudini --set $cfg filter:authtoken admin_user "${SWIFT_KEYSTONE_USER}"
crudini --set $cfg filter:authtoken admin_password "${SWIFT_KEYSTONE_PASSWORD}"
crudini --set $cfg filter:authtoken delay_auth_decision "${SWIFT_PROXY_DELAY_AUTH_DECISION}"
crudini --set $cfg filter:authtoken signing_dir "${SWIFT_PROXY_SIGNING_DIR}"
crudini --set $cfg filter:cache memcache_servers "${PUBLIC_IP}:11211"
crudini --set $cfg filter:gatekeeper use egg:swift#gatekeeper
crudini --set $cfg filter:slo use egg:swift#slo
crudini --set $cfg filter:dlo use egg:swift#dlo
# Create swift user and group if they don't exist
id -u swift &>/dev/null || useradd --user-group swift
# TODO(pbourke): should these go into the Dockerfile instead?
# TODO(pbourke): do we need a data vol for these?
mkdir -p ${SWIFT_PROXY_SIGNING_DIR}
chown swift: ${SWIFT_PROXY_SIGNING_DIR}
chmod 0700 ${SWIFT_PROXY_SIGNING_DIR}
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_OBJECT_SVC_RING_NAME} \
-p ${SWIFT_OBJECT_SVC_RING_PART_POWER} \
-r ${SWIFT_OBJECT_SVC_RING_REPLICAS} \
-m ${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_OBJECT_SVC_RING_HOSTS} \
-w ${SWIFT_OBJECT_SVC_RING_WEIGHTS} \
-d ${SWIFT_OBJECT_SVC_RING_DEVICES} \
-z ${SWIFT_OBJECT_SVC_RING_ZONES}
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_ACCOUNT_SVC_RING_NAME} \
-p ${SWIFT_ACCOUNT_SVC_RING_PART_POWER} \
-r ${SWIFT_ACCOUNT_SVC_RING_REPLICAS} \
-m ${SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_ACCOUNT_SVC_RING_HOSTS} \
-w ${SWIFT_ACCOUNT_SVC_RING_WEIGHTS} \
-d ${SWIFT_ACCOUNT_SVC_RING_DEVICES} \
-z ${SWIFT_ACCOUNT_SVC_RING_ZONES}
python /opt/kolla/build-swift-ring.py \
-f ${SWIFT_CONTAINER_SVC_RING_NAME} \
-p ${SWIFT_CONTAINER_SVC_RING_PART_POWER} \
-r ${SWIFT_CONTAINER_SVC_RING_REPLICAS} \
-m ${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS} \
-H ${SWIFT_CONTAINER_SVC_RING_HOSTS} \
-w ${SWIFT_CONTAINER_SVC_RING_WEIGHTS} \
-d ${SWIFT_CONTAINER_SVC_RING_DEVICES} \
-z ${SWIFT_CONTAINER_SVC_RING_ZONES}
exec $CMD $ARGS

View File

@ -1,8 +1,9 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/swift-proxy-server"
ARGS=""
ARGS="/etc/swift/proxy-server.conf --verbose"
# Loading common functions.
source /opt/kolla/kolla-common.sh

View File

@ -510,31 +510,134 @@ In order for each service to function, there is a minimum set of required variab
RABBITMQ_PASS
RABBITMQ_USER
# Swift-account
# Swift-account-server
KEYSTONE_ADMIN_SERVICE_HOST
KEYSTONE_ADMIN_TOKEN
SWIFT_ADMIN_PASSWORD
SWIFT_ACCOUNT_SVC_BIND_IP
SWIFT_ACCOUNT_SVC_BIND_PORT
SWIFT_ACCOUNT_SVC_DEVICES
SWIFT_ACCOUNT_SVC_MOUNT_CHECK
SWIFT_ACCOUNT_SVC_RING_DEVICES
SWIFT_ACCOUNT_SVC_RING_HOSTS
SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS
SWIFT_ACCOUNT_SVC_RING_NAME
SWIFT_ACCOUNT_SVC_RING_PART_POWER
SWIFT_ACCOUNT_SVC_RING_REPLICAS
SWIFT_ACCOUNT_SVC_RING_WEIGHTS
SWIFT_ACCOUNT_SVC_RING_ZONES
SWIFT_DIR
SWIFT_USER
# Swift-base
SWIFT_HASH_PATH_SUFFIX
# Swift-container-server
SWIFT_CONTAINER_SVC_BIND_IP
SWIFT_CONTAINER_SVC_BIND_PORT
SWIFT_CONTAINER_SVC_DEVICES
SWIFT_CONTAINER_SVC_MOUNT_CHECK
SWIFT_CONTAINER_SVC_RING_DEVICES
SWIFT_CONTAINER_SVC_RING_HOSTS
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS
SWIFT_CONTAINER_SVC_RING_NAME
SWIFT_CONTAINER_SVC_RING_PART_POWER
SWIFT_CONTAINER_SVC_RING_REPLICAS
SWIFT_CONTAINER_SVC_RING_WEIGHTS
SWIFT_CONTAINER_SVC_RING_ZONES
SWIFT_DIR
SWIFT_USER
# Swift-object-auditor
None
# Swift-container
# Swift-object-base
KEYSTONE_ADMIN_SERVICE_HOST
KEYSTONE_ADMIN_TOKEN
SWIFT_ADMIN_PASSWORD
SWIFT_CONTAINER_SVC_RING_DEVICES
SWIFT_CONTAINER_SVC_RING_HOSTS
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS
SWIFT_CONTAINER_SVC_RING_NAME
SWIFT_CONTAINER_SVC_RING_PART_POWER
SWIFT_CONTAINER_SVC_RING_REPLICAS
SWIFT_CONTAINER_SVC_RING_WEIGHTS
SWIFT_CONTAINER_SVC_RING_ZONES
SWIFT_DIR
SWIFT_OBJECT_SVC_BIND_IP
SWIFT_OBJECT_SVC_BIND_PORT
SWIFT_OBJECT_SVC_DEVICES
SWIFT_OBJECT_SVC_MOUNT_CHECK
SWIFT_OBJECT_SVC_PIPELINE
SWIFT_OBJECT_SVC_RING_DEVICES
SWIFT_OBJECT_SVC_RING_HOSTS
SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS
SWIFT_OBJECT_SVC_RING_NAME
SWIFT_OBJECT_SVC_RING_PART_POWER
SWIFT_OBJECT_SVC_RING_REPLICAS
SWIFT_OBJECT_SVC_RING_WEIGHTS
SWIFT_OBJECT_SVC_RING_ZONES
SWIFT_USER
# Swift-object
# Swift-object-expirer
KEYSTONE_ADMIN_SERVICE_HOST
KEYSTONE_ADMIN_TOKEN
SWIFT_ADMIN_PASSWORD
None
# Swift-object-replicator
None
# Swift-object-server
None
# Swift-object-updater
None
# Swift-proxy-server
None
SWIFT_ACCOUNT_SVC_RING_DEVICES
SWIFT_ACCOUNT_SVC_RING_HOSTS
SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS
SWIFT_ACCOUNT_SVC_RING_NAME
SWIFT_ACCOUNT_SVC_RING_PART_POWER
SWIFT_ACCOUNT_SVC_RING_REPLICAS
SWIFT_ACCOUNT_SVC_RING_WEIGHTS
SWIFT_ACCOUNT_SVC_RING_ZONES
SWIFT_ADMIN_USER
SWIFT_CONTAINER_SVC_RING_DEVICES
SWIFT_CONTAINER_SVC_RING_HOSTS
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS
SWIFT_CONTAINER_SVC_RING_NAME
SWIFT_CONTAINER_SVC_RING_PART_POWER
SWIFT_CONTAINER_SVC_RING_REPLICAS
SWIFT_CONTAINER_SVC_RING_WEIGHTS
SWIFT_CONTAINER_SVC_RING_ZONES
SWIFT_KEYSTONE_PASSWORD
SWIFT_KEYSTONE_USER
SWIFT_OBJECT_SVC_RING_DEVICES
SWIFT_OBJECT_SVC_RING_HOSTS
SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS
SWIFT_OBJECT_SVC_RING_NAME
SWIFT_OBJECT_SVC_RING_PART_POWER
SWIFT_OBJECT_SVC_RING_REPLICAS
SWIFT_OBJECT_SVC_RING_WEIGHTS
SWIFT_OBJECT_SVC_RING_ZONES
SWIFT_PROXY_ACCOUNT_AUTOCREATE
SWIFT_PROXY_AUTH_PLUGIN
SWIFT_PROXY_BIND_IP
SWIFT_PROXY_BIND_PORT
SWIFT_PROXY_DELAY_AUTH_DECISION
SWIFT_PROXY_DIR
SWIFT_PROXY_OPERATOR_ROLES
SWIFT_PROXY_PASSWORD
SWIFT_PROXY_PIPELINE_MAIN
SWIFT_PROXY_PROJECT_DOMAIN_ID
SWIFT_PROXY_PROJECT_NAME
SWIFT_PROXY_SIGNING_DIR
SWIFT_PROXY_USERNAME
SWIFT_PROXY_USER_DOMAIN_ID
SWIFT_USER
# Zaqar

120
tools/genenv Executable file → Normal file
View File

@ -300,10 +300,65 @@ NOVA_VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP
# Nova/Neutron
NEUTRON_SHARED_SECRET=sharedsecret
#Swift
SWIFT_DB_NAME=swift
SWIFT_DB_USER=swift
# Swift
SWIFT_ACCOUNT_SVC_BIND_IP=$PUBLIC_IP
SWIFT_ACCOUNT_SVC_BIND_PORT=6002
SWIFT_ACCOUNT_SVC_DEVICES=/srv/node
SWIFT_ACCOUNT_SVC_MOUNT_CHECK=false
SWIFT_ADMIN_USER=swift
SWIFT_API_SERVICE_HOST=$HOST_IP
SWIFT_CONTAINER_SVC_BIND_IP=$PUBLIC_IP
SWIFT_CONTAINER_SVC_BIND_PORT=6001
SWIFT_CONTAINER_SVC_DEVICES=/srv/node
SWIFT_CONTAINER_SVC_MOUNT_CHECK=false
SWIFT_DIR=/etc/swift
SWIFT_HASH_PATH_SUFFIX=$(openssl rand -hex 8)
SWIFT_KEYSTONE_PASSWORD=swift
SWIFT_KEYSTONE_USER=swift
SWIFT_OBJECT_SVC_BIND_IP=$PUBLIC_IP
SWIFT_OBJECT_SVC_BIND_PORT=6000
SWIFT_OBJECT_SVC_DEVICES=/srv/node
SWIFT_OBJECT_SVC_MOUNT_CHECK=false
SWIFT_OBJECT_SVC_PIPELINE=object-server
SWIFT_PROXY_ACCOUNT_AUTOCREATE=true
SWIFT_PROXY_AUTH_PLUGIN=password
SWIFT_PROXY_BIND_IP=$PUBLIC_IP
SWIFT_PROXY_BIND_PORT=8080
SWIFT_PROXY_DELAY_AUTH_DECISION=true
SWIFT_PROXY_DIR=/etc/swift
SWIFT_PROXY_OPERATOR_ROLES=admin,user
SWIFT_PROXY_PASSWORD=swift
SWIFT_PROXY_PIPELINE_MAIN="catch_errors gatekeeper healthcheck cache container_sync bulk ratelimit authtoken keystoneauth slo dlo proxy-server"
SWIFT_PROXY_PROJECT_DOMAIN_ID=default
SWIFT_PROXY_PROJECT_NAME=service
SWIFT_PROXY_SIGNING_DIR=/var/cache/swift
SWIFT_PROXY_USER_DOMAIN_ID=default
SWIFT_PROXY_USERNAME=swift
SWIFT_USER=swift
SWIFT_OBJECT_SVC_RING_NAME=/etc/swift/object.builder
SWIFT_OBJECT_SVC_RING_PART_POWER=10
SWIFT_OBJECT_SVC_RING_REPLICAS=3
SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS=1
SWIFT_OBJECT_SVC_RING_HOSTS="${HOST_IP}:6000,${HOST_IP}:6000,${HOST_IP}:6000"
SWIFT_OBJECT_SVC_RING_DEVICES="sdb1,sdb2,sdb3"
SWIFT_OBJECT_SVC_RING_WEIGHTS="1,1,1"
SWIFT_OBJECT_SVC_RING_ZONES="1,2,3"
SWIFT_CONTAINER_SVC_RING_NAME=/etc/swift/container.builder
SWIFT_CONTAINER_SVC_RING_PART_POWER=10
SWIFT_CONTAINER_SVC_RING_REPLICAS=3
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS=1
SWIFT_CONTAINER_SVC_RING_HOSTS="${HOST_IP}:6001,${HOST_IP}:6001,${HOST_IP}:6001"
SWIFT_CONTAINER_SVC_RING_DEVICES="sdb1,sdb2,sdb3"
SWIFT_CONTAINER_SVC_RING_WEIGHTS="1,1,1"
SWIFT_CONTAINER_SVC_RING_ZONES="1,2,3"
SWIFT_ACCOUNT_SVC_RING_NAME=/etc/swift/account.builder
SWIFT_ACCOUNT_SVC_RING_PART_POWER=10
SWIFT_ACCOUNT_SVC_RING_REPLICAS=3
SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS=1
SWIFT_ACCOUNT_SVC_RING_HOSTS="${HOST_IP}:6002,${HOST_IP}:6002,${HOST_IP}:6002"
SWIFT_ACCOUNT_SVC_RING_DEVICES="sdb1,sdb2,sdb3"
SWIFT_ACCOUNT_SVC_RING_WEIGHTS="1,1,1"
SWIFT_ACCOUNT_SVC_RING_ZONES="1,2,3"
#Zaqar
ZAQAR_KEYSTONE_USER=zaqar
@ -500,9 +555,64 @@ RABBITMQ_USER=$RABBIT_USER
RABBIT_PASSWORD=$RABBIT_PASSWORD
RABBIT_USERID=$RABBIT_USER
ROOT_HELPER=$ROOT_HELPER
SWIFT_DB_NAME=$SWIFT_DB_NAME
SWIFT_DB_USER=$SWIFT_DB_USER
SWIFT_ACCOUNT_SVC_BIND_IP=$SWIFT_ACCOUNT_SVC_BIND_IP
SWIFT_ACCOUNT_SVC_BIND_PORT=$SWIFT_ACCOUNT_SVC_BIND_PORT
SWIFT_ACCOUNT_SVC_DEVICES=$SWIFT_ACCOUNT_SVC_DEVICES
SWIFT_ACCOUNT_SVC_MOUNT_CHECK=$SWIFT_ACCOUNT_SVC_MOUNT_CHECK
SWIFT_ADMIN_USER=$SWIFT_ADMIN_USER
SWIFT_API_SERVICE_HOST=$SWIFT_API_SERVICE_HOST
SWIFT_CONTAINER_SVC_BIND_IP=$PUBLIC_IP
SWIFT_CONTAINER_SVC_BIND_PORT=$SWIFT_CONTAINER_SVC_BIND_PORT
SWIFT_CONTAINER_SVC_DEVICES=$SWIFT_CONTAINER_SVC_DEVICES
SWIFT_CONTAINER_SVC_MOUNT_CHECK=$SWIFT_CONTAINER_SVC_MOUNT_CHECK
SWIFT_DIR=$SWIFT_DIR
SWIFT_HASH_PATH_SUFFIX=$SWIFT_HASH_PATH_SUFFIX
SWIFT_KEYSTONE_PASSWORD=$SWIFT_KEYSTONE_PASSWORD
SWIFT_KEYSTONE_USER=$SWIFT_KEYSTONE_USER
SWIFT_OBJECT_SVC_BIND_IP=$SWIFT_OBJECT_SVC_BIND_IP
SWIFT_OBJECT_SVC_BIND_PORT=$SWIFT_OBJECT_SVC_BIND_PORT
SWIFT_OBJECT_SVC_DEVICES=$SWIFT_OBJECT_SVC_DEVICES
SWIFT_OBJECT_SVC_MOUNT_CHECK=$SWIFT_OBJECT_SVC_MOUNT_CHECK
SWIFT_OBJECT_SVC_PIPELINE=$SWIFT_OBJECT_SVC_PIPELINE
SWIFT_PROXY_ACCOUNT_AUTOCREATE=$SWIFT_PROXY_ACCOUNT_AUTOCREATE
SWIFT_PROXY_AUTH_PLUGIN=$SWIFT_PROXY_AUTH_PLUGIN
SWIFT_PROXY_BIND_IP=$SWIFT_PROXY_BIND_IP
SWIFT_PROXY_BIND_PORT=$SWIFT_PROXY_BIND_PORT
SWIFT_PROXY_DELAY_AUTH_DECISION=$SWIFT_PROXY_DELAY_AUTH_DECISION
SWIFT_PROXY_DIR=$SWIFT_PROXY_DIR
SWIFT_PROXY_OPERATOR_ROLES=$SWIFT_PROXY_OPERATOR_ROLES
SWIFT_PROXY_PASSWORD=$SWIFT_PROXY_PASSWORD
SWIFT_PROXY_PIPELINE_MAIN=$SWIFT_PROXY_PIPELINE_MAIN
SWIFT_PROXY_PROJECT_DOMAIN_ID=$SWIFT_PROXY_PROJECT_DOMAIN_ID
SWIFT_PROXY_PROJECT_NAME=$SWIFT_PROXY_PROJECT_NAME
SWIFT_PROXY_SIGNING_DIR=$SWIFT_PROXY_SIGNING_DIR
SWIFT_PROXY_USER_DOMAIN_ID=$SWIFT_PROXY_USER_DOMAIN_ID
SWIFT_PROXY_USERNAME=$SWIFT_PROXY_USERNAME
SWIFT_USER=$SWIFT_USER
SWIFT_OBJECT_SVC_RING_NAME=${SWIFT_OBJECT_SVC_RING_NAME}
SWIFT_OBJECT_SVC_RING_PART_POWER=${SWIFT_OBJECT_SVC_RING_PART_POWER}
SWIFT_OBJECT_SVC_RING_REPLICAS=${SWIFT_OBJECT_SVC_RING_REPLICAS}
SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS=${SWIFT_OBJECT_SVC_RING_MIN_PART_HOURS}
SWIFT_OBJECT_SVC_RING_HOSTS=${SWIFT_OBJECT_SVC_RING_HOSTS}
SWIFT_OBJECT_SVC_RING_DEVICES=${SWIFT_OBJECT_SVC_RING_DEVICES}
SWIFT_OBJECT_SVC_RING_WEIGHTS=${SWIFT_OBJECT_SVC_RING_WEIGHTS}
SWIFT_OBJECT_SVC_RING_ZONES=${SWIFT_OBJECT_SVC_RING_ZONES}
SWIFT_CONTAINER_SVC_RING_NAME=${SWIFT_CONTAINER_SVC_RING_NAME}
SWIFT_CONTAINER_SVC_RING_PART_POWER=${SWIFT_CONTAINER_SVC_RING_PART_POWER}
SWIFT_CONTAINER_SVC_RING_REPLICAS=${SWIFT_CONTAINER_SVC_RING_REPLICAS}
SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS=${SWIFT_CONTAINER_SVC_RING_MIN_PART_HOURS}
SWIFT_CONTAINER_SVC_RING_HOSTS=${SWIFT_CONTAINER_SVC_RING_HOSTS}
SWIFT_CONTAINER_SVC_RING_DEVICES=${SWIFT_CONTAINER_SVC_RING_DEVICES}
SWIFT_CONTAINER_SVC_RING_WEIGHTS=${SWIFT_CONTAINER_SVC_RING_WEIGHTS}
SWIFT_CONTAINER_SVC_RING_ZONES=${SWIFT_CONTAINER_SVC_RING_ZONES}
SWIFT_ACCOUNT_SVC_RING_NAME=${SWIFT_ACCOUNT_SVC_RING_NAME}
SWIFT_ACCOUNT_SVC_RING_PART_POWER=${SWIFT_ACCOUNT_SVC_RING_PART_POWER}
SWIFT_ACCOUNT_SVC_RING_REPLICAS=${SWIFT_ACCOUNT_SVC_RING_REPLICAS}
SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS=${SWIFT_ACCOUNT_SVC_RING_MIN_PART_HOURS}
SWIFT_ACCOUNT_SVC_RING_HOSTS=${SWIFT_ACCOUNT_SVC_RING_HOSTS}
SWIFT_ACCOUNT_SVC_RING_DEVICES=${SWIFT_ACCOUNT_SVC_RING_DEVICES}
SWIFT_ACCOUNT_SVC_RING_WEIGHTS=${SWIFT_ACCOUNT_SVC_RING_WEIGHTS}
SWIFT_ACCOUNT_SVC_RING_ZONES=${SWIFT_ACCOUNT_SVC_RING_ZONES}
TEMP_FILE=$TEMP_FILE
TENANT_NETWORK_TYPES=$TENANT_NETWORK_TYPES
TOKEN_DRIVER=$TOKEN_DRIVER