0

I am using https://github.com/microsoft/etcd3 for etcd3 NodeJS client, but it is by default taking default port 2379 or 2380 for gRPC. But I am running multiple etcd docker container instances. How to create multiple clients based on multiple ports.

Thanks.

code veda
  • 87
  • 1
  • 6
  • https://github.com/stianeikeland/node-etcd | https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/configuration.md . Found 2 resources, examples also included. Hope this is helpful. – ValeriF21 Jan 16 '21 at 00:52
  • Well, thanks for your reply. The first link is about version2 I tried that at first place and about second link, I don't find info about node.js client – code veda Jan 16 '21 at 15:57

1 Answers1

0

I think you can provide a single or array of hosts when you construct the client. See the following for hosts and a slightly more involved reference for configuring grpcOptions:

https://microsoft.github.io/etcd3/interfaces/ioptions.html#hosts

https://microsoft.github.io/etcd3/interfaces/ioptions.html#grpcoptions

So use values other than localhost and 2379:

const client = new Etcd3(options = { hosts: '127.0.0.1:2379' });
code veda
  • 87
  • 1
  • 6
DazWilkin
  • 32,823
  • 5
  • 47
  • 88