S
S
Sland Show2019-01-27 01:06:26
Docker
Sland Show, 2019-01-27 01:06:26

How to run etcd as a separate service using docker?

Hello.
Executed the following script on my machine in the console:

docker run -d -p 2379:2379 -p 2380:2380 -p 4001:4001 quay.io/coreos/etcd
. Got image etcd.
The question is as follows. Can I run etcd as a separate REST service and just poke it? If yes, how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sland Show, 2019-01-27
@SlandShow

I was forwarding the wrong ports.
The container is launched in the terminal window.
If we open another terminal window and look through docker ps, we get:

CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                              NAMES
1cf15da0a83a        quay.io/coreos/etcd:v3.0.16   "/usr/local/bin/etcd…"   5 minutes ago       Up 5 minutes        0.0.0.0:2379->2379/tcp, 2380/tcp   etcd

You can also put something in etcd and get a response:
Answer -
{"action":"set","node":{"key":"/mykey","value":"this is awesome","modifiedIndex":4,"createdIndex":4}}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question