grpclb is a gRPC load balancer for Node.js integrated with etcd for service discovery. Version 1.3.4 is the current stable release. It provides client-side round-robin load balancing via JavaScript Proxy or client pool. Key differentiators: lightweight, peer dependency with grpc avoids duplicate grpc copies, supports both dynamic and static gRPC code. Package is mature but not frequently updated.
npm install grpclbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers a gRPC server with etcd for service discovery. Uses the register function with server instance, etcd key-value pair, and TTL.
Install grpc separately: npm install grpc
Use grpc (C-based) or check if grpclb works with @grpc/grpc-js (not officially supported).
Migrate to @grpc/grpc-js; note that grpclb may not work without modifications.
Set ETCD_HOSTS env or pass etcdHosts option.
Use createClientPool for static generated code.
Ensure grpc is installed as peer dependency (npm install grpc) and not nested.
Kill the process using the port or change server port.
Start etcd server and verify ETCD_HOSTS environment variable or etcdHosts option.