Bug 1263077
Summary: | add default options to etcd ExecStart in etcd.service | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Guohua Ouyang <gouyang> |
Component: | etcd | Assignee: | Jan Chaloupka <jchaloup> |
Status: | CLOSED ERRATA | QA Contact: | atomic-bugs <atomic-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | gouyang, ypu |
Target Milestone: | rc | Keywords: | Extras |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | etcd-2.2.2-3.el7_2 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-02-16 16:40:00 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Guohua Ouyang
2015-09-15 06:04:05 UTC
Hi Guohua, there is a lot of arguments that etcd supports. Which would be the primary? All of them? /etc/etcd/etcd.conf consists of environment variables which etcd reads. So this will work. However, it will duplicate what etcd already does. I suppose reading from /proc/22047/environ is not user friendly and can be done only by root. Hi Jan, I'm intending to only add those uncommented arguments in /etc/etcd/etcd.conf at first, after review the file again, I'd like to add those arguments which has URL, the list I want to see is: # [member] ETCD_NAME=default ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="http://10.66.15.25:2380" ETCD_LISTEN_CLIENT_URLS="http://10.66.15.25:2379" #[cluster] ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.66.15.25:2380" # if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..." ETCD_INITIAL_CLUSTER="default0=http://10.66.15.25:2380" ETCD_INITIAL_CLUSTER_STATE="new" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" ETCD_ADVERTISE_CLIENT_URLS="http://10.66.15.25:2379" How do you think? I see one problem. If a user decides to comment out ETCD_INITIAL_CLUSTER_STATE for example, etcd will get empty --initial-cluster-state option. It will not get set to default "new". It will need something like this: etcd ... --initial-cluster-state=${ETCD_INITIAL_CLUSTER_STATE:-new} ... The same for the remaining options. Another problem is when default values will change. This will require awareness of a packager and continuous checking default and available values. Otherwise don't see any other problem ATM. $ echo ${A:-http://localhost:2379} http://localhost:2379 works as expected as well. ah, that's a problem. users use default conf file will fail in many situation with these cluster arguments. I'd like to fall back to these uncomment out arguments, only support these I added in the example. I tested that by adding these arguments in etcd.service, it cannot run proxy mode properly with or without --advertise-client-urls set. Without --advertise-client-urls set, the error looks like below: invalid value "" for flag -advertise-client-urls: URL scheme must be http or https: With --advertise-client-urls set, etcdserver will try to set up the cluster with the advertised urls, which should not be presenting in proxy mode. etcdserver: could not get cluster response from http://10.66.15.25:2380: Get http://10.66.15.25:2380/members: dial tcp 10.66.15.25:2380: connection refused There maybe more different situations out there when proxy and cluster argument involved in. I'd like to close this request at the moment. ah, it would be safe to add "--name=${ETCD_NAME} --data-dir=${ETCD_DATA_DIR} --listen-client-urls=${ETCD_LISTEN_CLIENT_URLS}". It's helpful and looks enough to me. Checked with following steps and seems it is fixed in etcd-2.2.2-5.el7 1. check the etcd.service file # cat /usr/lib/systemd/system/etcd.service |grep ExecStart ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\"" 2. start etcd service and check the status with: # systemctl status etcd -l ● etcd.service - Etcd Server Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2016-01-08 05:41:38 EST; 10h ago Main PID: 885 (etcd) CGroup: /system.slice/etcd.service └─885 /usr/bin/etcd --name=default --data-dir=/var/lib/etcd/default.etcd --listen-client-urls=http://localhost:2379 So update this one to VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-0231.html |