This reverts commit 5a5cbf7274a6a50bb766ec590cf885430ed5c5d0.
This breaks on a default openstack install on Ubuntu 12.10,
revert for now until this can be cleaned up to work out of the
box.
Change-Id: I185509cc30bd28e920cdab60fc92129949bd6b0d
... | ... |
@@ -85,21 +85,19 @@ Example (Qpid): |
85 | 85 |
|
86 | 86 |
# Swift |
87 | 87 |
|
88 |
-Swift is enabled by default configured with only one replica to avoid being IO/memory intensive on a small vm. When running with only one replica the account, container and object services will run directly in screen. The others services like replicator, updaters or auditor runs in background. |
|
88 |
+Swift is not installed by default, you can enable easily by adding this to your `localrc`: |
|
89 | 89 |
|
90 |
-If you would like to disable Swift you can add this to your `localrc` : |
|
91 |
- |
|
92 |
- disable_service s-proxy s-object s-container s-account |
|
90 |
+ enable_service swift |
|
93 | 91 |
|
94 | 92 |
If you want a minimal Swift install with only Swift and Keystone you can have this instead in your `localrc`: |
95 | 93 |
|
96 | 94 |
disable_all_services |
97 |
- enable_service key mysql s-proxy s-object s-container s-account |
|
98 |
- |
|
99 |
-If you only want to do some testing of a real normal swift cluster with multiple replicas you can do so by customizing the variable `SWIFT_REPLICAS` in your `localrc` (usually to 3). |
|
95 |
+ enable_service key mysql swift |
|
100 | 96 |
|
101 |
-# Swift S3 |
|
97 |
+If you use Swift with Keystone, Swift will authenticate against it. You will need to make sure to use the Keystone URL to auth against. |
|
102 | 98 |
|
103 | 99 |
If you are enabling `swift3` in `ENABLED_SERVICES` devstack will install the swift3 middleware emulation. Swift will be configured to act as a S3 endpoint for Keystone so effectively replacing the `nova-objectstore`. |
104 | 100 |
|
105 | 101 |
Only Swift proxy server is launched in the screen session all other services are started in background and managed by `swift-init` tool. |
102 |
+ |
|
103 |
+By default Swift will configure 3 replicas (and one spare) which could be IO intensive on a small vm, if you only want to do some quick testing of the API you can choose to only have one replica by customizing the variable `SWIFT_REPLICAS` in your `localrc`. |
... | ... |
@@ -136,7 +136,7 @@ fi |
136 | 136 |
# Swift client |
137 | 137 |
# ------------ |
138 | 138 |
|
139 |
-if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then |
|
139 |
+if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then |
|
140 | 140 |
if [[ "$SKIP_EXERCISES" =~ "swift" ]] ; then |
141 | 141 |
STATUS_SWIFT="Skipped" |
142 | 142 |
else |
... | ... |
@@ -144,8 +144,7 @@ fi |
144 | 144 |
# Swift client |
145 | 145 |
# ------------ |
146 | 146 |
|
147 |
- |
|
148 |
-if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then |
|
147 |
+if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then |
|
149 | 148 |
if [[ "$SKIP_EXERCISES" =~ "swift" ]] ; then |
150 | 149 |
STATUS_SWIFT="Skipped" |
151 | 150 |
else |
... | ... |
@@ -52,7 +52,7 @@ RESELLER_ROLE=$(get_id keystone role-create --name=ResellerAdmin) |
52 | 52 |
# Services |
53 | 53 |
# -------- |
54 | 54 |
|
55 |
-if [[ "$ENABLED_SERVICES" =~ "n-api" ]] && [[ "$ENABLED_SERVICES" =~ "s-proxy" || "$ENABLED_SERVICES" =~ "swift" ]]; then |
|
55 |
+if [[ "$ENABLED_SERVICES" =~ "n-api" ]] && [[ "$ENABLED_SERVICES" =~ "swift" ]]; then |
|
56 | 56 |
NOVA_USER=$(keystone user-list | awk "/ nova / { print \$2 }") |
57 | 57 |
# Nova needs ResellerAdmin role to download images when accessing |
58 | 58 |
# swift through the s3 api. |
... | ... |
@@ -123,8 +123,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then |
123 | 123 |
fi |
124 | 124 |
|
125 | 125 |
# Swift |
126 |
- |
|
127 |
-if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then |
|
126 |
+if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then |
|
128 | 127 |
SWIFT_USER=$(get_id keystone user-create \ |
129 | 128 |
--name=swift \ |
130 | 129 |
--pass="$SERVICE_PASSWORD" \ |
... | ... |
@@ -191,7 +190,7 @@ if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then |
191 | 191 |
fi |
192 | 192 |
|
193 | 193 |
# S3 |
194 |
-if [[ "$ENABLED_SERVICES" =~ "n-obj" || "$ENABLED_SERVICES" =~ "swift3" ]]; then |
|
194 |
+if [[ "$ENABLED_SERVICES" =~ "n-obj" || "$ENABLED_SERVICES" =~ "swift" ]]; then |
|
195 | 195 |
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then |
196 | 196 |
S3_SERVICE=$(get_id keystone service-create \ |
197 | 197 |
--name=s3 \ |
... | ... |
@@ -566,9 +566,6 @@ $option = $value |
566 | 566 |
# **ceilometer** returns true if any service enabled start with **ceilometer** |
567 | 567 |
# **glance** returns true if any service enabled start with **g-** |
568 | 568 |
# **quantum** returns true if any service enabled start with **q-** |
569 |
-# **swift** returns true if any service enabled start with **s-** |
|
570 |
-# For backward compatibility if we have **swift** in ENABLED_SERVICES all the |
|
571 |
-# **s-** services will be enabled. This will be deprecated in the future. |
|
572 | 569 |
# |
573 | 570 |
# Uses global ``ENABLED_SERVICES`` |
574 | 571 |
# is_service_enabled service [service ...] |
... | ... |
@@ -581,8 +578,6 @@ function is_service_enabled() { |
581 | 581 |
[[ ${service} == "ceilometer" && ${ENABLED_SERVICES} =~ "ceilometer-" ]] && return 0 |
582 | 582 |
[[ ${service} == "glance" && ${ENABLED_SERVICES} =~ "g-" ]] && return 0 |
583 | 583 |
[[ ${service} == "quantum" && ${ENABLED_SERVICES} =~ "q-" ]] && return 0 |
584 |
- [[ ${service} == "swift" && ${ENABLED_SERVICES} =~ "s-" ]] && return 0 |
|
585 |
- [[ ${service} == s-* && ${ENABLED_SERVICES} =~ "swift" ]] && return 0 |
|
586 | 584 |
done |
587 | 585 |
return 1 |
588 | 586 |
} |
... | ... |
@@ -146,7 +146,7 @@ function configure_keystone() { |
146 | 146 |
cp -p $FILES/default_catalog.templates $KEYSTONE_CATALOG |
147 | 147 |
|
148 | 148 |
# Add swift endpoints to service catalog if swift is enabled |
149 |
- if is_service_enabled s-proxy; then |
|
149 |
+ if is_service_enabled swift; then |
|
150 | 150 |
echo "catalog.RegionOne.object_store.publicURL = http://%SERVICE_HOST%:8080/v1/AUTH_\$(tenant_id)s" >> $KEYSTONE_CATALOG |
151 | 151 |
echo "catalog.RegionOne.object_store.adminURL = http://%SERVICE_HOST%:8080/" >> $KEYSTONE_CATALOG |
152 | 152 |
echo "catalog.RegionOne.object_store.internalURL = http://%SERVICE_HOST%:8080/v1/AUTH_\$(tenant_id)s" >> $KEYSTONE_CATALOG |
... | ... |
@@ -56,11 +56,10 @@ SWIFT_LOOPBACK_DISK_SIZE=${SWIFT_LOOPBACK_DISK_SIZE:-1000000} |
56 | 56 |
SWIFT_PARTITION_POWER_SIZE=${SWIFT_PARTITION_POWER_SIZE:-9} |
57 | 57 |
|
58 | 58 |
# Set ``SWIFT_REPLICAS`` to configure how many replicas are to be |
59 |
-# configured for your Swift cluster. By default we are configuring |
|
60 |
-# only one replica since this is way less CPU and memory intensive. If |
|
61 |
-# you are planning to test swift replication you may want to set this |
|
62 |
-# up to 3. |
|
63 |
-SWIFT_REPLICAS=${SWIFT_REPLICAS:-1} |
|
59 |
+# configured for your Swift cluster. By default the three replicas would need a |
|
60 |
+# bit of IO and Memory on a VM you may want to lower that to 1 if you want to do |
|
61 |
+# only some quick testing. |
|
62 |
+SWIFT_REPLICAS=${SWIFT_REPLICAS:-3} |
|
64 | 63 |
SWIFT_REPLICAS_SEQ=$(seq ${SWIFT_REPLICAS}) |
65 | 64 |
|
66 | 65 |
# Set ``OBJECT_PORT_BASE``, ``CONTAINER_PORT_BASE``, ``ACCOUNT_PORT_BASE`` |
... | ... |
@@ -360,26 +359,13 @@ function start_swift() { |
360 | 360 |
sudo systemctl start xinetd.service |
361 | 361 |
fi |
362 | 362 |
|
363 |
- # By default with only one replica we are launching the proxy, |
|
364 |
- # container, account and object server in screen in foreground and |
|
365 |
- # other services in background. If we have SWIFT_REPLICAS set to something |
|
366 |
- # greater than one we first spawn all the swift services then kill the proxy |
|
367 |
- # service so we can run it in foreground in screen. ``swift-init ... |
|
368 |
- # {stop|restart}`` exits with '1' if no servers are running, ignore it just |
|
369 |
- # in case |
|
363 |
+ # First spawn all the swift services then kill the |
|
364 |
+ # proxy service so we can run it in foreground in screen. |
|
365 |
+ # ``swift-init ... {stop|restart}`` exits with '1' if no servers are running, |
|
366 |
+ # ignore it just in case |
|
370 | 367 |
swift-init --run-dir=${SWIFT_DATA_DIR}/run all restart || true |
371 |
- if [[ ${SWIFT_REPLICAS} == 1 ]];then |
|
372 |
- todo="object container account" |
|
373 |
- fi |
|
374 |
- for type in proxy ${todo};do |
|
375 |
- swift-init --run-dir=${SWIFT_DATA_DIR}/run ${type} stop || true |
|
376 |
- done |
|
377 |
- screen_it s-proxy "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v" |
|
378 |
- if [[ ${SWIFT_REPLICAS} == 1 ]];then |
|
379 |
- for type in object container account;do |
|
380 |
- screen_it s-${type} "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONFIG_DIR}/${type}-server/1.conf -v" |
|
381 |
- done |
|
382 |
- fi |
|
368 |
+ swift-init --run-dir=${SWIFT_DATA_DIR}/run proxy stop || true |
|
369 |
+ screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v" |
|
383 | 370 |
} |
384 | 371 |
|
385 | 372 |
# stop_swift() - Stop running processes (non-screen) |
... | ... |
@@ -427,7 +427,7 @@ if is_service_enabled rabbit; then |
427 | 427 |
read_password RABBIT_PASSWORD "ENTER A PASSWORD TO USE FOR RABBIT." |
428 | 428 |
fi |
429 | 429 |
|
430 |
-if is_service_enabled s-proxy; then |
|
430 |
+if is_service_enabled swift; then |
|
431 | 431 |
# If we are using swift3, we can default the s3 port to swift instead |
432 | 432 |
# of nova-objectstore |
433 | 433 |
if is_service_enabled swift3;then |
... | ... |
@@ -664,12 +664,12 @@ install_novaclient |
664 | 664 |
git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH |
665 | 665 |
|
666 | 666 |
# glance, swift middleware and nova api needs keystone middleware |
667 |
-if is_service_enabled key g-api n-api s-proxy; then |
|
667 |
+if is_service_enabled key g-api n-api swift; then |
|
668 | 668 |
# unified auth system (manages accounts/tokens) |
669 | 669 |
install_keystone |
670 | 670 |
fi |
671 | 671 |
|
672 |
-if is_service_enabled s-proxy; then |
|
672 |
+if is_service_enabled swift; then |
|
673 | 673 |
install_swiftclient |
674 | 674 |
install_swift |
675 | 675 |
if is_service_enabled swift3; then |
... | ... |
@@ -726,10 +726,10 @@ echo_summary "Configuring OpenStack projects" |
726 | 726 |
configure_keystoneclient |
727 | 727 |
configure_novaclient |
728 | 728 |
setup_develop $OPENSTACKCLIENT_DIR |
729 |
-if is_service_enabled key g-api n-api s-proxy; then |
|
729 |
+if is_service_enabled key g-api n-api swift; then |
|
730 | 730 |
configure_keystone |
731 | 731 |
fi |
732 |
-if is_service_enabled s-proxy; then |
|
732 |
+if is_service_enabled swift; then |
|
733 | 733 |
configure_swift |
734 | 734 |
configure_swiftclient |
735 | 735 |
if is_service_enabled swift3; then |
... | ... |
@@ -913,7 +913,7 @@ if is_service_enabled g-reg; then |
913 | 913 |
init_glance |
914 | 914 |
|
915 | 915 |
# Store the images in swift if enabled. |
916 |
- if is_service_enabled s-proxy; then |
|
916 |
+ if is_service_enabled swift; then |
|
917 | 917 |
iniset $GLANCE_API_CONF DEFAULT default_store swift |
918 | 918 |
iniset $GLANCE_API_CONF DEFAULT swift_store_auth_address $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ |
919 | 919 |
iniset $GLANCE_API_CONF DEFAULT swift_store_user $SERVICE_TENANT_NAME:glance |
... | ... |
@@ -972,7 +972,7 @@ fi |
972 | 972 |
# Storage Service |
973 | 973 |
# --------------- |
974 | 974 |
|
975 |
-if is_service_enabled s-proxy; then |
|
975 |
+if is_service_enabled swift; then |
|
976 | 976 |
echo_summary "Configuring Swift" |
977 | 977 |
init_swift |
978 | 978 |
fi |
... | ... |
@@ -1119,7 +1119,7 @@ fi |
1119 | 1119 |
# Only run the services specified in ``ENABLED_SERVICES`` |
1120 | 1120 |
|
1121 | 1121 |
# Launch Swift Services |
1122 |
-if is_service_enabled s-proxy; then |
|
1122 |
+if is_service_enabled swift; then |
|
1123 | 1123 |
echo_summary "Starting Swift" |
1124 | 1124 |
start_swift |
1125 | 1125 |
fi |
... | ... |
@@ -21,7 +21,7 @@ fi |
21 | 21 |
# ``disable_service`` functions in ``localrc``. |
22 | 22 |
# For example, to enable Swift add this to ``localrc``: |
23 | 23 |
# enable_service swift |
24 |
-ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,s-proxy,s-account,s-object,s-container,horizon,rabbit,tempest,mysql |
|
24 |
+ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql |
|
25 | 25 |
|
26 | 26 |
# Set the default Nova APIs to enable |
27 | 27 |
NOVA_ENABLED_APIS=ec2,osapi_compute,metadata |