Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 api is not available when etcd uses config file #12093

Closed
DenisRazinkin opened this issue Jun 29, 2020 · 5 comments
Closed

v3 api is not available when etcd uses config file #12093

DenisRazinkin opened this issue Jun 29, 2020 · 5 comments

Comments

@DenisRazinkin
Copy link

DenisRazinkin commented Jun 29, 2020

-bash-4.4# etcd --version
etcd Version: 3.4.9
Git SHA: 54ba958
Go Version: go1.12.17
Go OS/Arch: linux/amd64

There is no problem with v3 api when I start etcd with command line
-bash-4.4# etcd --data-dir=/tmp/node1 --name node1 --listen-peer-urls=http://127.0.0.1:2380 --listen-client-urls=http://127.0.0.1:2379 --initial-advertise-peer-urls=http://127.0.0.1:2380 --advertise-client-urls=http://127.0.0.1:2379

-bash-4.4# curl -L -s http://127.0.0.1:2379/v3/cluster/member/list -X POST -d '{"linearizable": false}' | jq
{
  "header": {
    "cluster_id": "2037210783374497686",
    "member_id": "13195394291058371180",
    "raft_term": "3"
  },
  "members": [
    {
      "ID": "13195394291058371180",
      "name": "node1",
      "peerURLs": [
        "http://127.0.0.1:2380"
      ],
      "clientURLs": [
        "http://127.0.0.1:2379"
      ]
    }
  ]
}

When I use config file with same parameters there is 404 error.

-bash-4.4# cat /tmp/node1/etcd.conf 
# This is the configuration file for the etcd server.

# Human-readable name for this member.
name: node1

# Path to the data directory.
data-dir: /tmp/node1/

#List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: http://127.0.0.1:2380

# List of comma separated URLs to listen on for client traffic.
listen-client-urls: http://127.0.0.1:2379

# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: http://127.0.0.1:2380

# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: http://127.0.0.1:2379

# Initial cluster configuration for bootstrapping.
initial-cluster: 

# Initial cluster state ('new' or 'existing').
initial-cluster-state: 'new'

Start etcd with:
-bash-4.4# etcd --config-file /tmp/node1/etcd.conf

Send curl http request, got 404

-bash-4.4# curl -L -s http://127.0.0.1:2379/v3/cluster/member/list -X POST -d '{"linearizable": false}'     
404 page not found
@spzala
Copy link
Member

spzala commented Sep 12, 2020

@DenisRazinkin please try enabling enable-grpc-gateway in the config file i.e. enable-grpc-gateway: true

spzala added a commit to spzala/etcd that referenced this issue Sep 14, 2020
Currently, the grpc gateway is enabled by default when run the etcd server
using command line configuration. However, when provide config through
config file, the grpc gateway is disabled by default. We should either use
the same approach or at least document this.

related #etcd-io#12093
spzala added a commit to spzala/etcd that referenced this issue Sep 14, 2020
Currently, the grpc gateway is enabled by default when run the etcd server
using command line configuration. However, when provide config through
config file, the grpc gateway is disabled by default. We should either use
the same approach or at least document this.

related #etcd-io#12093
@spzala
Copy link
Member

spzala commented Oct 8, 2020

Closing as fixed. Thanks!

@pgodfrin-nov
Copy link

Say folks, would you add this parameter to the docs please? I spent quite a few hours wondering what was missing until CyberDem0n pointed me to this issue. See patroni/patroni#1939

While you're at it, maybe a way to search the docs?

@spzala
Copy link
Member

spzala commented May 24, 2021

Updating changelog #13034 and will add in doc appropriately in the etcd.io repo https://github.com/etcd-io/website

openstack-mirroring pushed a commit to openstack-archive/tripleo-heat-templates that referenced this issue Jun 22, 2022
This patch fixes a problem with OpenStack tooz's etcd3gw
driver when it attempts to communicate with the etcd service.
The tooz driver uses etcd's grpc gateway functionality, but
starting with etcd v3.3 the grpc gateway is not enabled by
default (for wallaby, centos-8 includes etcd v3.2, but
centos-9 incudes v3.4).

Per [1], the fix involves adding a small config change to the
etcd config file.

[1] etcd-io/etcd#12093 (comment)

Normally this would be handled by puppet-etcd, but that puppet
module is *not* an opendev project, and is quite out of date.
It would take a lot of work to update puppet-etcd, with little
benefit beyond supporting [1].

The solution implemented here is to enhance the puppet_config
tasks to add the missing config after puppet-etcd finishes. The
long term solution is to replace puppet-etcd with a tripleo-ansible
role, but that's a larger effort.

This patch also removes the container_puppet_tasks that were
originally intended so tripleo could inject key/value pairs into
etcd. However, that functionality was never utilized, and is
currently broken due to it mounting etcd's database directory
in read-only mode. The container_puppet_tasks need to be removed
in order for the new puppet_config tasks to work correctly.

Resolves: rhbz#2097058
Change-Id: I3ed29a14298f4df94b8a5520615bfa85cd291346
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Jun 22, 2022
* Update tripleo-heat-templates from branch 'master'
  to 26ecf8c3b12c39328a9fb90cf3cd72c216b1ad20
  - Merge "etcd: fix service config to work with latest versions"
  - etcd: fix service config to work with latest versions
    
    This patch fixes a problem with OpenStack tooz's etcd3gw
    driver when it attempts to communicate with the etcd service.
    The tooz driver uses etcd's grpc gateway functionality, but
    starting with etcd v3.3 the grpc gateway is not enabled by
    default (for wallaby, centos-8 includes etcd v3.2, but
    centos-9 incudes v3.4).
    
    Per [1], the fix involves adding a small config change to the
    etcd config file.
    
    [1] etcd-io/etcd#12093 (comment)
    
    Normally this would be handled by puppet-etcd, but that puppet
    module is *not* an opendev project, and is quite out of date.
    It would take a lot of work to update puppet-etcd, with little
    benefit beyond supporting [1].
    
    The solution implemented here is to enhance the puppet_config
    tasks to add the missing config after puppet-etcd finishes. The
    long term solution is to replace puppet-etcd with a tripleo-ansible
    role, but that's a larger effort.
    
    This patch also removes the container_puppet_tasks that were
    originally intended so tripleo could inject key/value pairs into
    etcd. However, that functionality was never utilized, and is
    currently broken due to it mounting etcd's database directory
    in read-only mode. The container_puppet_tasks need to be removed
    in order for the new puppet_config tasks to work correctly.
    
    Resolves: rhbz#2097058
    Change-Id: I3ed29a14298f4df94b8a5520615bfa85cd291346
openstack-mirroring pushed a commit to openstack-archive/tripleo-heat-templates that referenced this issue Jun 24, 2022
This patch fixes a problem with OpenStack tooz's etcd3gw
driver when it attempts to communicate with the etcd service.
The tooz driver uses etcd's grpc gateway functionality, but
starting with etcd v3.3 the grpc gateway is not enabled by
default (for wallaby, centos-8 includes etcd v3.2, but
centos-9 incudes v3.4).

Per [1], the fix involves adding a small config change to the
etcd config file.

[1] etcd-io/etcd#12093 (comment)

Normally this would be handled by puppet-etcd, but that puppet
module is *not* an opendev project, and is quite out of date.
It would take a lot of work to update puppet-etcd, with little
benefit beyond supporting [1].

The solution implemented here is to enhance the puppet_config
tasks to add the missing config after puppet-etcd finishes. The
long term solution is to replace puppet-etcd with a tripleo-ansible
role, but that's a larger effort.

This patch also removes the container_puppet_tasks that were
originally intended so tripleo could inject key/value pairs into
etcd. However, that functionality was never utilized, and is
currently broken due to it mounting etcd's database directory
in read-only mode. The container_puppet_tasks need to be removed
in order for the new puppet_config tasks to work correctly.

Resolves: rhbz#2097058
Change-Id: I3ed29a14298f4df94b8a5520615bfa85cd291346
(cherry picked from commit 796f6a5)
@robinchrist
Copy link

This is still missing in the docs @spzala - can we please add it to https://github.com/etcd-io/website?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants