In Ibbb430fb1dbf66942168e0cb52d990ab6a2eb8d7, we are adding
etcd3 as a new base service. We should drop zookeeper
and use etcd3 as the backend.
Since cinder is the first service for this tooz+etcd3 DLM
scenario and cinder uses eventlet we have cannnot use the
grpc based driver in tooz. So new CINDER_COORDINATION_URL
that defaults to the etcd3's grpc HTTP gateway based
tooz backend.
We need to hold this change until the tooz change (see
Depends-On) is available in a tooz release.
Depends-On: I6184ed193482dad9643ccb2b97133d4957485408
Change-Id: Ia187e1a86413edf25b909b6bb57e84fb4930a696
2 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,36 +0,0 @@ |
1 |
-# |
|
2 |
-# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP |
|
3 |
-# |
|
4 |
-# Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
-# you may not use this file except in compliance with the License. |
|
6 |
-# You may obtain a copy of the License at |
|
7 |
-# |
|
8 |
-# http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
-# |
|
10 |
-# Unless required by applicable law or agreed to in writing, software |
|
11 |
-# distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
|
13 |
-# implied. |
|
14 |
-# See the License for the specific language governing permissions and |
|
15 |
-# limitations under the License. |
|
16 |
-# |
|
17 |
- |
|
18 |
-# Modified from http://packages.ubuntu.com/saucy/zookeeperd |
|
19 |
-NAME=zookeeper |
|
20 |
-ZOOCFGDIR=/etc/zookeeper/conf |
|
21 |
- |
|
22 |
-# seems, that log4j requires the log4j.properties file to be in the classpath |
|
23 |
-CLASSPATH="$ZOOCFGDIR:/usr/share/java/jline.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/netty.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-log4j12.jar:/usr/share/java/zookeeper.jar" |
|
24 |
- |
|
25 |
-ZOOCFG="$ZOOCFGDIR/zoo.cfg" |
|
26 |
-ZOO_LOG_DIR=/var/log/zookeeper |
|
27 |
-USER=$NAME |
|
28 |
-GROUP=$NAME |
|
29 |
-PIDDIR=/var/run/$NAME |
|
30 |
-PIDFILE=$PIDDIR/$NAME.pid |
|
31 |
-SCRIPTNAME=/etc/init.d/$NAME |
|
32 |
-JAVA=/usr/bin/java |
|
33 |
-ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain" |
|
34 |
-ZOO_LOG4J_PROP="INFO,ROLLINGFILE" |
|
35 |
-JMXLOCALONLY=false |
|
36 |
-JAVA_OPTS="" |
37 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,69 +0,0 @@ |
1 |
-# |
|
2 |
-# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP |
|
3 |
-# |
|
4 |
-# Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
-# you may not use this file except in compliance with the License. |
|
6 |
-# You may obtain a copy of the License at |
|
7 |
-# |
|
8 |
-# http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
-# |
|
10 |
-# Unless required by applicable law or agreed to in writing, software |
|
11 |
-# distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
|
13 |
-# implied. |
|
14 |
-# See the License for the specific language governing permissions and |
|
15 |
-# limitations under the License. |
|
16 |
-# |
|
17 |
- |
|
18 |
-# From http://packages.ubuntu.com/saucy/zookeeperd |
|
19 |
- |
|
20 |
-# ZooKeeper Logging Configuration |
|
21 |
-# |
|
22 |
- |
|
23 |
-# Format is "<default threshold> (, <appender>)+ |
|
24 |
- |
|
25 |
-log4j.rootLogger=${zookeeper.root.logger} |
|
26 |
- |
|
27 |
-# Example: console appender only |
|
28 |
-# log4j.rootLogger=INFO, CONSOLE |
|
29 |
- |
|
30 |
-# Example with rolling log file |
|
31 |
-#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE |
|
32 |
- |
|
33 |
-# Example with rolling log file and tracing |
|
34 |
-#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE |
|
35 |
- |
|
36 |
-# |
|
37 |
-# Log INFO level and above messages to the console |
|
38 |
-# |
|
39 |
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender |
|
40 |
-log4j.appender.CONSOLE.Threshold=INFO |
|
41 |
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout |
|
42 |
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n |
|
43 |
- |
|
44 |
-# |
|
45 |
-# Add ROLLINGFILE to rootLogger to get log file output |
|
46 |
-# Log DEBUG level and above messages to a log file |
|
47 |
-log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender |
|
48 |
-log4j.appender.ROLLINGFILE.Threshold=WARN |
|
49 |
-log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/zookeeper.log |
|
50 |
- |
|
51 |
-# Max log file size of 10MB |
|
52 |
-log4j.appender.ROLLINGFILE.MaxFileSize=10MB |
|
53 |
-# uncomment the next line to limit number of backup files |
|
54 |
-#log4j.appender.ROLLINGFILE.MaxBackupIndex=10 |
|
55 |
- |
|
56 |
-log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout |
|
57 |
-log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n |
|
58 |
- |
|
59 |
- |
|
60 |
-# |
|
61 |
-# Add TRACEFILE to rootLogger to get log file output |
|
62 |
-# Log DEBUG level and above messages to a log file |
|
63 |
-log4j.appender.TRACEFILE=org.apache.log4j.FileAppender |
|
64 |
-log4j.appender.TRACEFILE.Threshold=TRACE |
|
65 |
-log4j.appender.TRACEFILE.File=${zookeeper.log.dir}/zookeeper_trace.log |
|
66 |
- |
|
67 |
-log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout |
|
68 |
-### Notice we are including log4j's NDC here (%x) |
|
69 |
-log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L][%x] - %m%n |
3 | 2 |
deleted file mode 100644 |
... | ... |
@@ -1,74 +0,0 @@ |
1 |
-# |
|
2 |
-# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP |
|
3 |
-# |
|
4 |
-# Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
-# you may not use this file except in compliance with the License. |
|
6 |
-# You may obtain a copy of the License at |
|
7 |
-# |
|
8 |
-# http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
-# |
|
10 |
-# Unless required by applicable law or agreed to in writing, software |
|
11 |
-# distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
|
13 |
-# implied. |
|
14 |
-# See the License for the specific language governing permissions and |
|
15 |
-# limitations under the License. |
|
16 |
-# |
|
17 |
-# http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html |
|
18 |
- |
|
19 |
-# The number of milliseconds of each tick |
|
20 |
-tickTime=2000 |
|
21 |
-# The number of ticks that the initial |
|
22 |
-# synchronization phase can take |
|
23 |
-initLimit=10 |
|
24 |
-# The number of ticks that can pass between |
|
25 |
-# sending a request and getting an acknowledgement |
|
26 |
-syncLimit=5 |
|
27 |
-# the directory where the snapshot is stored. |
|
28 |
-dataDir=/var/lib/zookeeper |
|
29 |
-# Place the dataLogDir to a separate physical disc for better performance |
|
30 |
-# dataLogDir=/disk2/zookeeper |
|
31 |
- |
|
32 |
-# the port at which the clients will connect |
|
33 |
-clientPort=2181 |
|
34 |
- |
|
35 |
-# Maximum number of clients that can connect from one client |
|
36 |
-maxClientCnxns=60 |
|
37 |
- |
|
38 |
-# specify all zookeeper servers |
|
39 |
-# The fist port is used by followers to connect to the leader |
|
40 |
-# The second one is used for leader election |
|
41 |
- |
|
42 |
-server.0=127.0.0.1:2888:3888 |
|
43 |
- |
|
44 |
-# To avoid seeks ZooKeeper allocates space in the transaction log file in |
|
45 |
-# blocks of preAllocSize kilobytes. The default block size is 64M. One reason |
|
46 |
-# for changing the size of the blocks is to reduce the block size if snapshots |
|
47 |
-# are taken more often. (Also, see snapCount). |
|
48 |
-#preAllocSize=65536 |
|
49 |
- |
|
50 |
-# Clients can submit requests faster than ZooKeeper can process them, |
|
51 |
-# especially if there are a lot of clients. To prevent ZooKeeper from running |
|
52 |
-# out of memory due to queued requests, ZooKeeper will throttle clients so that |
|
53 |
-# there is no more than globalOutstandingLimit outstanding requests in the |
|
54 |
-# system. The default limit is 1,000.ZooKeeper logs transactions to a |
|
55 |
-# transaction log. After snapCount transactions are written to a log file a |
|
56 |
-# snapshot is started and a new transaction log file is started. The default |
|
57 |
-# snapCount is 10,000. |
|
58 |
-#snapCount=1000 |
|
59 |
- |
|
60 |
-# If this option is defined, requests will be will logged to a trace file named |
|
61 |
-# traceFile.year.month.day. |
|
62 |
-#traceFile= |
|
63 |
- |
|
64 |
-# Leader accepts client connections. Default value is "yes". The leader machine |
|
65 |
-# coordinates updates. For higher update throughput at thes slight expense of |
|
66 |
-# read throughput the leader can be configured to not accept clients and focus |
|
67 |
-# on coordination. |
|
68 |
-#leaderServes=yes |
|
69 |
- |
|
70 |
-# Autopurge every hour to avoid using lots of disk in bursts |
|
71 |
-# Order of the next 2 properties matters. |
|
72 |
-# autopurge.snapRetainCount must be before autopurge.purgeInterval. |
|
73 |
-autopurge.snapRetainCount=3 |
|
74 |
-autopurge.purgeInterval=1 |
|
75 | 1 |
\ No newline at end of file |
... | ... |
@@ -363,11 +363,10 @@ function configure_cinder { |
363 | 363 |
iniset $CINDER_CONF DEFAULT os_privileged_user_tenant "$SERVICE_PROJECT_NAME" |
364 | 364 |
iniset $CINDER_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT" |
365 | 365 |
|
366 |
- # Set the backend url according to the configured dlm backend |
|
367 |
- if is_dlm_enabled; then |
|
368 |
- if [[ "$(dlm_backend)" == "zookeeper" ]]; then |
|
369 |
- iniset $CINDER_CONF coordination backend_url "zookeeper://${SERVICE_HOST}:2181" |
|
370 |
- fi |
|
366 |
+ if [[ ! -z "$CINDER_COORDINATION_URL" ]]; then |
|
367 |
+ iniset $CINDER_CONF coordination backend_url "$CINDER_COORDINATION_URL" |
|
368 |
+ elif is_service_enabled etcd3; then |
|
369 |
+ iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:2379" |
|
371 | 370 |
fi |
372 | 371 |
} |
373 | 372 |
|
374 | 373 |
deleted file mode 100644 |
... | ... |
@@ -1,111 +0,0 @@ |
1 |
-#!/bin/bash |
|
2 |
-# |
|
3 |
-# lib/dlm |
|
4 |
-# |
|
5 |
-# Functions to control the installation and configuration of software |
|
6 |
-# that provides a dlm (and possibly other functions). The default is |
|
7 |
-# **zookeeper**, and is going to be the only backend supported in the |
|
8 |
-# devstack tree. |
|
9 |
- |
|
10 |
-# Dependencies: |
|
11 |
-# |
|
12 |
-# - ``functions`` file |
|
13 |
- |
|
14 |
-# ``stack.sh`` calls the entry points in this order: |
|
15 |
-# |
|
16 |
-# - is_dlm_enabled |
|
17 |
-# - install_dlm |
|
18 |
-# - configure_dlm |
|
19 |
-# - cleanup_dlm |
|
20 |
- |
|
21 |
-# Save trace setting |
|
22 |
-_XTRACE_DLM=$(set +o | grep xtrace) |
|
23 |
-set +o xtrace |
|
24 |
- |
|
25 |
- |
|
26 |
-# Defaults |
|
27 |
-# -------- |
|
28 |
- |
|
29 |
-# <define global variables here that belong to this project> |
|
30 |
- |
|
31 |
-# Set up default directories |
|
32 |
-ZOOKEEPER_DATA_DIR=$DEST/data/zookeeper |
|
33 |
-ZOOKEEPER_CONF_DIR=/etc/zookeeper |
|
34 |
- |
|
35 |
- |
|
36 |
-# Entry Points |
|
37 |
-# ------------ |
|
38 |
-# |
|
39 |
-# NOTE(sdague): it is expected that when someone wants to implement |
|
40 |
-# another one of these out of tree, they'll implement the following |
|
41 |
-# functions: |
|
42 |
-# |
|
43 |
-# - dlm_backend |
|
44 |
-# - install_dlm |
|
45 |
-# - configure_dlm |
|
46 |
-# - cleanup_dlm |
|
47 |
- |
|
48 |
-# This should be declared in the settings file of any plugin or |
|
49 |
-# service that needs to have a dlm in their environment. |
|
50 |
-function use_dlm { |
|
51 |
- enable_service $(dlm_backend) |
|
52 |
-} |
|
53 |
- |
|
54 |
-# A function to return the name of the backend in question, some users |
|
55 |
-# are going to need to know this. |
|
56 |
-function dlm_backend { |
|
57 |
- echo "zookeeper" |
|
58 |
-} |
|
59 |
- |
|
60 |
-# Test if a dlm is enabled (defaults to a zookeeper specific check) |
|
61 |
-function is_dlm_enabled { |
|
62 |
- [[ ,${ENABLED_SERVICES}, =~ ,"$(dlm_backend)", ]] && return 0 |
|
63 |
- return 1 |
|
64 |
-} |
|
65 |
- |
|
66 |
-# cleanup_dlm() - Remove residual data files, anything left over from previous |
|
67 |
-# runs that a clean run would need to clean up |
|
68 |
-function cleanup_dlm { |
|
69 |
- # NOTE(sdague): we don't check for is_enabled here because we |
|
70 |
- # should just delete this regardless. Some times users updated |
|
71 |
- # their service list before they run cleanup. |
|
72 |
- sudo rm -rf $ZOOKEEPER_DATA_DIR |
|
73 |
-} |
|
74 |
- |
|
75 |
-# configure_dlm() - Set config files, create data dirs, etc |
|
76 |
-function configure_dlm { |
|
77 |
- if is_dlm_enabled; then |
|
78 |
- sudo cp $FILES/zookeeper/* $ZOOKEEPER_CONF_DIR |
|
79 |
- sudo sed -i -e 's|.*dataDir.*|dataDir='$ZOOKEEPER_DATA_DIR'|' $ZOOKEEPER_CONF_DIR/zoo.cfg |
|
80 |
- # clean up from previous (possibly aborted) runs |
|
81 |
- # create required data files |
|
82 |
- sudo rm -rf $ZOOKEEPER_DATA_DIR |
|
83 |
- sudo mkdir -p $ZOOKEEPER_DATA_DIR |
|
84 |
- # restart after configuration, there is no reason to make this |
|
85 |
- # another step, because having data files that don't match the |
|
86 |
- # zookeeper running is just going to cause tears. |
|
87 |
- restart_service zookeeper |
|
88 |
- fi |
|
89 |
-} |
|
90 |
- |
|
91 |
-# install_dlm() - Collect source and prepare |
|
92 |
-function install_dlm { |
|
93 |
- if is_dlm_enabled; then |
|
94 |
- pip_install_gr_extras tooz zookeeper |
|
95 |
- if is_ubuntu; then |
|
96 |
- install_package zookeeperd |
|
97 |
- elif is_fedora; then |
|
98 |
- install_package zookeeper |
|
99 |
- else |
|
100 |
- die $LINENO "Don't know how to install zookeeper on this platform" |
|
101 |
- fi |
|
102 |
- fi |
|
103 |
-} |
|
104 |
- |
|
105 |
-# Restore xtrace |
|
106 |
-$_XTRACE_DLM |
|
107 |
- |
|
108 |
-# Tell emacs to use shell-script-mode |
|
109 |
-## Local variables: |
|
110 |
-## mode: shell-script |
|
111 |
-## End: |
... | ... |
@@ -573,7 +573,6 @@ source $TOP_DIR/lib/swift |
573 | 573 |
source $TOP_DIR/lib/neutron |
574 | 574 |
source $TOP_DIR/lib/ldap |
575 | 575 |
source $TOP_DIR/lib/dstat |
576 |
-source $TOP_DIR/lib/dlm |
|
577 | 576 |
source $TOP_DIR/lib/etcd3 |
578 | 577 |
source $TOP_DIR/lib/os_brick |
579 | 578 |
|
... | ... |
@@ -772,10 +771,6 @@ set_systemd_override DefaultLimitNOFILE ${ULIMIT_NOFILE} |
772 | 772 |
install_rpc_backend |
773 | 773 |
restart_rpc_backend |
774 | 774 |
|
775 |
-# NOTE(sdague): dlm install is conditional on one being enabled by configuration |
|
776 |
-install_dlm |
|
777 |
-configure_dlm |
|
778 |
- |
|
779 | 775 |
if is_service_enabled $DATABASE_BACKENDS; then |
780 | 776 |
install_database |
781 | 777 |
fi |