Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clearwater-etcd/usr/bin/clearwater-etcdctl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Default the etcd version to the latest supported etcd version.
etcd_version=3.1.7
etcd_version=3.2.17
. /etc/clearwater/config

# Work out the IP address to contact etcd on. Look first for
Expand All @@ -15,4 +15,4 @@ if [ -z "$target_ip" ]; then
fi

# Run the real etcdctl.
/usr/share/clearwater/clearwater-etcd/$etcd_version/etcdctl -C $target_ip:4000 "$@"
/usr/share/clearwater/clearwater-etcd/$etcd_version/etcdctl -C http://$target_ip:4000 "$@"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to change? Does it work with all versions? I assume you've tested the 3.x ones - I wonder if we should be just removing the 2.x one entirely.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure, but I assume it's related to the following section from the upgrade documentation

Change in --listen-peer-urls and --listen-client-urls
3.2 now rejects domains names for --listen-peer-urls and --listen-client-urls (3.1 only prints out warnings), since domain name is invalid for network interface binding. Make sure that those URLs are properly formated as scheme://IP:port.

I've checked it works against 3.1.7, but I couldn't be bothered to check with 2.2.5 (partly because I was pretty sure it would do and partly because I wasn't sure why I cared). Any idea what the last CC version we shipped with 2.2.5 was? V10?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, I'm going to remove support for 2.2.5

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ fi
# write to the pidfile without fear that another etcd process will start
/usr/share/clearwater/bin/ent_log.py "etcd" CL_ETCD_STARTED
echo $$ > $PIDFILE
exec /usr/share/clearwater/clearwater-etcd/2.2.5/etcd $@ >> /var/log/clearwater-etcd/clearwater-etcd.log 2>&1
exec /usr/share/clearwater/clearwater-etcd/3.2.17/etcd $@ >> /var/log/clearwater-etcd/clearwater-etcd.log 2>&1
rm $PIDFILE
/usr/share/clearwater/bin/ent_log.py "etcd" CL_ETCD_EXITED
8 changes: 4 additions & 4 deletions debian/clearwater-etcd.init.d
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ USER=$NAME
LOG_FILE=/var/log/clearwater-etcd/clearwater-etcd-initd.log

# Default the etcd version to the latest supported etcd version.
etcd_version=3.1.7
etcd_version=3.2.17
. /etc/clearwater/config

DAEMON=/usr/share/clearwater/clearwater-etcd/$etcd_version/etcd
Expand Down Expand Up @@ -122,7 +122,7 @@ etcdctl_wrapper() {

# Exit if the package is not installed
if [ ! -x "$DAEMON" ]; then
log_info "Invalid etcd version: valid versions are 3.1.7 (recommended) and 2.2.5"
log_info "Invalid etcd version: valid versions are 3.2.17 (recommended) and 3.1.7"
exit 0
fi

Expand Down Expand Up @@ -234,7 +234,7 @@ setup_etcdctl_peers()
do
if [[ $server != $advertisement_ip ]]
then
ETCDCTL_PEERS="$server:4000,$ETCDCTL_PEERS"
ETCDCTL_PEERS="http://$server:4000,$ETCDCTL_PEERS"
fi
done

Expand Down Expand Up @@ -530,7 +530,7 @@ do_decommission()
# 0 if successful
# 2 on error
log_debug "Check cluster is healthy before decommissioning"
export ETCDCTL_PEERS=$advertisement_ip:4000
export ETCDCTL_PEERS=http://$advertisement_ip:4000
health=$(etcdctl_wrapper cluster-health)
if [[ $health =~ unhealthy ]]
then
Expand Down
2 changes: 1 addition & 1 deletion src/metaswitch/clearwater/etcd_tests/etcdserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from shutil import rmtree
import uuid

base_cmd = """clearwater-etcd/usr/share/clearwater/clearwater-etcd/3.1.7/etcd --debug --listen-client-urls http://{0}:4000 --advertise-client-urls http://{0}:4000 --listen-peer-urls http://{0}:2380 --initial-advertise-peer-urls http://{0}:2380 --data-dir {2} --name {1}"""
base_cmd = """clearwater-etcd/usr/share/clearwater/clearwater-etcd/3.2.17/etcd --debug --listen-client-urls http://{0}:4000 --advertise-client-urls http://{0}:4000 --listen-peer-urls http://{0}:2380 --initial-advertise-peer-urls http://{0}:2380 --data-dir {2} --name {1}"""

first_member_cmd = base_cmd + """ --initial-cluster-state new --initial-cluster {1}=http://{0}:2380"""
subsequent_member_cmd = base_cmd + """ --initial-cluster-state existing --initial-cluster {3},{1}=http://{0}:2380"""
Expand Down