Git Product home page Git Product logo

jetcd's People

Contributors

adohe avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar excpt0r avatar fanminshi avatar giri-vsr avatar heyitsanthony avatar hongchaodeng avatar horizonzy avatar igorperikov avatar ilyasyoy avatar jcferretti avatar johnshajiang avatar lburgazzoli avatar liangyuanpeng avatar lukasz-antoniak avatar oscerd avatar oza avatar pan3793 avatar pfwang80s avatar rmarian avatar skyao avatar stupidhod avatar sudohackin avatar tsonglew avatar tunefun avatar vorburger avatar xiang90 avatar yb172 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jetcd's Issues

Ability for client conn to set arbitrary gRPC metadata / HTTP2 request headers

I think it'd be useful for the client to be able to set custom metadata (e.g. HTTP2 request headers) that would be part of the remote call. Basically, a way for the client to set gRPC metadata. It could be abstracted supported something like:

Map<String, String> requestHeaders = new HashMap<>(); requestHeaders.put("someKaey", "someValue"); EtcdClient client = EtcdClientBuilder.newBuilder().endpoints("localhost:4004").requestHeaders(requestHeaders).build();

[design]: add internal package to hide our implementation details

I would like to add a internal package such as "com.coreos.jetcd.internal" and move some implementation classes like EtcdKVImpl to it.

And we should document that all the classes in package internal are our internal implementation detail and should not be used directly.

Then We can update them freely.

Using SSL

Has anyone managed to get a java etcd client to use SSL, and if so, how?
I have generated self-signed certificates (ca, server, and client) that work fine with etcdctl (with etcd3) but cannot get it to work with netty-tcnative from java. I always get the following:
io.netty.handler.ssl.OpenSslEngine - SSL_read failed: OpenSSL error: error:10000412:SSL routines:OPENSSL_internal:SSLV3_ALERT_BAD_CERTIFICATE

JDK version

One question, which JDK version should we support in jetcd?

java8? or java 7?

Running `mvn package` on master fails

I just checked out master and ran mvn package and it appears seven tests are failing:

Failed tests:
EtcdAuthClientTest.testRoleAdd:59 » Execution io.grpc.StatusRuntimeException: ...
EtcdAuthClientTest.testUserAdd:75 » Execution io.grpc.StatusRuntimeException: ...
EtcdClusterClientTest.testListCluster:32 » Execution io.grpc.StatusRuntimeExce...
EtcdLeaseTest.testGrant:43 » Execution io.grpc.StatusRuntimeException: UNAVAIL...
MaintenanceTest.testAlarmList:46 » Execution io.grpc.StatusRuntimeException: U...
MaintenanceTest.testDefragment:84 » Execution io.grpc.StatusRuntimeException: ...
MaintenanceTest.testStatusMember:35 » Execution io.grpc.StatusRuntimeException...

Tests run: 37, Failures: 7, Errors: 0, Skipped: 15

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.076 s
[INFO] Finished at: 2016-12-17T16:01:27-05:00
[INFO] Final Memory: 40M/666M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project jetcd: There are test failures.

Txn.Builder has unfriendly API

I think Txn.Builder would be more user friendly if it allowed appending If/Then/Else operations rather than just replacing them. Right now you have to prepare them in some lists, then add them to builder.

the add-source config in pom.xml is error

<goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${basedir}/target/generated-sources</source> </sources> </configuration>

I think this config above is incorrect.
It must change to config like below:
<goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${basedir}/target/generated-sources/protobuf/java</source> <source>${basedir}/target/generated-sources/protobuf/grpc-java</source> </sources> </configuration>

so it can find the correct source folder.

NoSuchMethodError in grpc libraries

Cannot run following code snippet
// create client
Client client = ClientBuilder.newBuilder().endpoints("http://localhost:2379").build();
KV kvClient = client.getKVClient();

ByteSequence key = ByteSequence.fromString("test_key");
ByteSequence value = ByteSequence.fromString("test_value");

// put the key-value
kvClient.put(key, value).get();
// get the CompletableFuture
CompletableFuture getFuture = kvClient.get(key);
// get the value from CompletableFuture
RangeResponse response = getFuture.get();
// delete the key
DeleteRangeResponse deleteRangeResponse = kvClient.delete(key).get();

it throws :

Caused by: io.grpc.StatusRuntimeException: UNKNOWN
at io.grpc.Status.asRuntimeException(Status.java:540)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: io.netty.handler.codec.http2.Http2Connection$Endpoint.maxStreams(II)V
at io.grpc.netty.FixedHttp2ConnectionDecoder$FrameReadListener.applyLocalSettings(FixedHttp2ConnectionDecoder.java:416)
at io.grpc.netty.FixedHttp2ConnectionDecoder$FrameReadListener.onSettingsAckRead(FixedHttp2ConnectionDecoder.java:390)
at io.grpc.netty.FixedHttp2ConnectionDecoder$PrefaceFrameListener.onSettingsAckRead(FixedHttp2ConnectionDecoder.java:660)
at io.netty.handler.codec.http2.Http2InboundFrameLogger$1.onSettingsAckRead(Http2InboundFrameLogger.java:86)
at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readSettingsFrame(DefaultHttp2FrameReader.java:522)
at io.netty.handler.codec.http2.DefaultHttp2FrameReader.processPayloadState(DefaultHttp2FrameReader.java:263)
at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readFrame(DefaultHttp2FrameReader.java:160)
at io.netty.handler.codec.http2.Http2InboundFrameLogger.readFrame(Http2InboundFrameLogger.java:41)
at io.grpc.netty.FixedHttp2ConnectionDecoder.decodeFrame(FixedHttp2ConnectionDecoder.java:119)
at io.netty.handler.codec.http2.Http2ConnectionHandler$FrameDecoder.decode(Http2ConnectionHandler.java:353)
at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:224)
at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:413)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
... 1 more

Although test cases are running without throwing errors. This error is fixed in grpc version 1.4.0. Need to update the dependency .

Discuss wrap vs enhance

I see the EtcdKV interface and impl are wrapping the generated gRPC clients with some helper utilities. At least for simple things like put and delete, I'd like to discuss if these should wrap, or sit to the side? For example.

generatedClient.put(EtcdUtil.putRequest(key, value));

This way users can still easily choose their interaction model(blocking, future, async), but still get the benefit of a nicer builder and handy defaults.

I expect there to be recipes as well for common multi-step interactions, and those very well may need to wrap, but the items so far seem capable of living to the side as helpers.

Thoughts?

discuss watch client

Hi, as discussed in PR #40 , we should discuss about the goals of etcd watch client.

As my idea, etcd watch is a client to manage watch requests.
Goals:

  1. Request watch operation, watch client create watch request for client with key, option(revision, delete only, put only and end key) and register callback for watch request.
  2. Notification, when watch client receive event from etcd server, it will call registered callback.
  3. Resume, when the watch client disconnect with etcd server, it will automatically resume all the watch requests and get notification from the latest received revision.
  4. Cancel watch request, the etcd client shound cancel watch request when client request and filter all the notification after user request canceled.

Hope for your ideas about watch client, @hongchaodeng @sijie @xiang90 @adohe .

dns discovery

In @jurmous etcd4j's client, there were a simple dns srv discovery util to get a list of etcd instances, would it make sense to port it here ?

define etcdException

We should hide the exception throw directly from gRPC. So we can have better defined errorCode and status for easier error handling.

LeaseGrpc and KVGrpc cannot be generated from proto

com.coreos.jetcd.api.KVGrpc and com.coreos.jetcd.api.LeaseGrpc cannot be generated from auth.proto, kv.proto and rpc.proto by protoc-3.0.0-win32.
I used the latest version of master, if any configuration missed?

[discuss] API implementation visibility/packages

The package com.coreos.jetcd contains both the interface definition and the related implementations that cane be instantiated as they are public and have a public constructor so I think it would be nice to do eithe make the visibility of the implemntation classes as package scope or move them to com.coreos.jetcd.internal.impl so at least the name mark them as non public.

Thoughts ?

[discuss] delay channel creation/authentication

If I properly understood etcd set-ups channels and eventually authentication on constructors (Client, KVImpl, etc) but that may be a little bit early so it would be nice to have an option to delay it to later stage i.e. when the first request is made.

Does it make sense ?

integration: improve integration test framework

Currently, all tests are running against one etcd cluster. This is bad because ordering of how tests case are being run can affect the correctness of the test; A test failure might cause by operations done to the shared cluster from another test.

We need a better test framework that allows each test to spawn its own etcd cluster and runs against it. In this way, all tests don't need to share a test etcd cluster and are way more self contained.

Release for Maven / sbt consumption

Is jetcd released in some Maven repo? The 'releases' tab in GitHub shows 0.

I am fine by this - can use mvn install -DskipTests - but this StackOverflow entry might benefit from official comments.

cannot initialize Client

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface com.coreos.jetcd.Client, but class was expected

Client interfaces

I'm wondering if it could make sense to enhance client interface with convenient methods i.e:

  • Options should not be mandatory:
ListenableFuture<PutResponse> put(ByteString key, ByteString value);
  • Leverage java 8 functional interfaces (if project will be moved to java 8 of course):
void put(
   ByteString key, ByteString value, 
   PutOption option, 
   Consumer<PutResponse> onResponse, Consumer<Throwable> onError);

void put(
   ByteString key, ByteString value, 
   Consumer<PutResponse> onResponse, Consumer<Throwable> onError);

void put(
   ByteString key, ByteString value, 
   Consumer<PutResponse> onResponse); throws an RuntimeException in case of error

Update grpc version to 1.0.0-pre2?

hi, now we are using grpc version 0.15.0, and the new version of grpc is 1.0.0.pre2。

should we update to this version now? One strong reason is that in this version protobuf has been update to release version 3.0.0 and netty is udpate to 3.1.7-final with some bug fixing.

I have to say that in 1.0.0-pre2 (includes pre1) there are some big changes we have to face:

  1. In the generated code from .proto files, all the client interfaces has been moved such as

public static interface KV {}
public static interface KVBlockingClient {}
public static interface KVFutureClient {}

PS: in 0.15.0, these interfaces are marked as Deprecated.
2. The stub class is now changed to be "final"

Now in the client we have only one choice :
public static class KVStub extends io.grpc.stub.AbstractStub{}
And in 1.0.0-pre2, this class is marked in final class.

So if we want to do some unit test to mock the special error case, we have to introduce something like powermock to mock final class.

Should we update it now or later?

testKeepAliveOnceStreamCloseOnSuccess() fails 50% of time.

50% of time testKeepAliveOnceStreamCloseOnSuccess() blocks on this.responseObserverRef.get().onNext(lrp);

 public void testKeepAliveOnceStreamCloseOnSuccess()
     throws ExecutionException, InterruptedException {
   CompletableFuture<com.coreos.jetcd.lease.LeaseKeepAliveResponse> lrpFuture = this.leaseCli
       .keepAliveOnce(LEASE_ID);
   LeaseKeepAliveResponse lrp = LeaseKeepAliveResponse
       .newBuilder()
       .setID(LEASE_ID)
       .build();
   this.responseObserverRef.get().onNext(lrp);

   lrpFuture.get();
   verify(this.requestStreamObserverMock, timeout(100).times(1)).onCompleted();
 }

For some reason, onNext() doesn't return.

watch event lost

you can reproduce this bug as such steps:

  1. First, add watch for "/test1", then add watch for "/test2", the watch for "/test2" is added later than "/test1"
  2. set value for "/test2", you can receive the PUT watch event
  3. set value for "/test1", I think we should receive the PUT event, but it's lost

Watch does not work well

When I using code below to start watch a key, but failed with an exception

WatchOption watchOption = WatchOption.DEFAULT;
try {
	watcher = watchClient.watch(key, watchOption, new WatchCallback() {
		@Override
		public void onWatch(EtcdHeader header, List<WatchEvent> events) {
			System.out.println("onWatch() called");
		}

		@Override
		public void onResuming() {
		}
	}).get();
} catch (InterruptedException | ExecutionException e) {
	logger.error("Error watch leader", e);
} catch (Exception e) {
	logger.error("Unexpected exception", e);
}

Exception:

May 10, 2017 10:14:38 AM io.grpc.internal.SerializingExecutor$TaskRunner run
SEVERE: Exception while executing runnable io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessageRead@6d32cbca
java.util.NoSuchElementException: No value present
	at java.util.Optional.get(Optional.java:135)
	at com.coreos.jetcd.EtcdWatchImpl.getResumeWatchOptionWithWatcher(EtcdWatchImpl.java:298)
	at com.coreos.jetcd.EtcdWatchImpl.resumeWatchers(EtcdWatchImpl.java:251)
	at com.coreos.jetcd.EtcdWatchImpl.resume(EtcdWatchImpl.java:107)
	at com.coreos.jetcd.EtcdWatchImpl.access$400(EtcdWatchImpl.java:32)
	at com.coreos.jetcd.EtcdWatchImpl$1.onError(EtcdWatchImpl.java:139)
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:428)
	at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:514)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:431)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessageRead.runInContext(ClientCallImpl.java:499)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
	at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

the root cause is:

  private WatchOption getResumeWatchOptionWithWatcher(Watcher watcher) {
    WatchOption oldOption = watcher.getWatchOption();
    return WatchOption.newBuilder().withNoDelete(oldOption.isNoDelete())
        .withNoPut(oldOption.isNoPut())
        .withPrevKV(oldOption.isPrevKV())
        .withProgressNotify(oldOption.isProgressNotify())
        .withRange(oldOption.getEndKey().get())                  // THIS LINE
        .withRevision(watcher.getLastRevision() + 1)
        .withResuming(true)
        .build();
  }

wish u to give a solution, thanks

rework Lease API

  • add tests to grant()
  • add tests to revoke()
  • add tests to keepAlive()
  • add timeToLive() API with tests
  • add tests keepAliveOnce()

Review/test Auth API

  • authEnable()
  • authDisable()
  • userAdd()
  • userDelete()
  • userChangePassword()
  • userGet()
  • userList()
  • userGrantRole()
  • userRevokeRole()
  • roleAdd()
  • roleGrantPermission()
  • roleGet()
  • roleList()
  • roleRevokePermission()
  • roleDelete()

jetcd should return custom response over grpc response

In order to remove grpc and guava dependency, all the responses that jetcd returns shouldn't be a direct message type from grpc because the grpc message contains ByteString field which is a type from protobuf Library. Then user needs to import Guava/Protobuf library and can cause Guava/Protobuf version conflicts.

project name about jetcd

There is another java project named jetcd on github and it is a java client for etcd v2.

Do we change to another name? like jetcd3?

jetcd error

Hello,
I am trying to use jetcd. However, it needs a lot of dependency jar files. I have downloaded/included all slf4j-1.7.25, protobuf-java-3.2.0, grpc-java-1.0.0,netty-4.1.9.Final JAR files. But, still when running the java program, I am getting "Exception in thread "main" java.lang.NoClassDefFoundError: .io/netty/handler/codec/BinaryHeaders". I am not sure what else need to be included. Is there a list of dependency jars (tree of jars) for jetcd?
Thanks!

There is an exception for adding two watcher

Exception info as below:

Exception while executing runnable io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessageRead@7f9132bb
java.util.NoSuchElementException: No value present
at java.util.Optional.get(Optional.java:135)
at com.coreos.jetcd.WatchImpl.getResumeWatchOptionWithWatcher(WatchImpl.java:299)
at com.coreos.jetcd.WatchImpl.resumeWatchers(WatchImpl.java:252)
at com.coreos.jetcd.WatchImpl.resume(WatchImpl.java:108)
at com.coreos.jetcd.WatchImpl.access$400(WatchImpl.java:33)
at com.coreos.jetcd.WatchImpl$1.onError(WatchImpl.java:140)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:428)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:514)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:431)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessageRead.runInContext(ClientCallImpl.java:499)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)

You can reproduce ti as such steps:

  1. Build a Client : ClientBuilder.newBuilder().endpoints() .
  2. Get watcher client: watchClient = client.getWatchClient()
  3. add two watchers for "/test1" and "/test2" as below:
    watcher = watchClient.watch(key, WatchOption.DEFAULT, new Watch.WatchCallback() {
    @OverRide
    public void onWatch(Header header, List list) {
    System.out.println("onWatch");
    }
    @OverRide
    public void onResuming() {
    System.out.println("onResuming");
    }
    }).get();
  4. Put value for "/test1", you can receive the PUT Watch event successfully.
  5. If you delete "/test1" or put value for "/test2", you can receive exception as above.

Could you locate and fix this issue as soon as possible ? Thanks a lot!

Review/test Maintenance API

  • manual testing Alarm()
  • manual testing alarmDisarm()
  • manual testing Status()
  • manual testing Defragment()
  • manual testing Snapshot()

edit: no need to add Hash() because etcd go client doesn't have it.

How to do service discovery with jetcd?

I'm trying to implement a micro service demo using etcd as service registry center. Assume I have deployed three etcd nodes, which are 192.168.99.11:2379, 192.168.99.22:2379 and 192.168.99.33:2379, along with a service process deployed on each node.

The service process on each node is listening on port 9999 and registered in the etcd cluster with keys /etcd3/foo/192.168.99.11:9999, /etcd3/foo/192.168.99.22:9999 and /etcd3/foo/192.168.99.33:9999.

My question is how to use java gRPC and jetcd to discover the list of three service nodes and do rpc call with round robin load balancing. I've tried many ways only to find the NameResolver really confuses me and EtcdKV doesn't support get with prefix. I can't get the service list from key /etcd3/foo/ without get with prefix. However, I can get the service list from key /etcd3/foo/ on command line using etcdctl get --prefix /etcd3/foo/.

Better show me some sample codes. It's kinda urgent. Thanks in advance!

No way to use leases?

Hello,

Am I correct in assuming there is no actual way to use EtcdLeaseImpl at the moment or have I missed something?

Test failures on initial build

Hello,

I'm prototyping etcd to run our local service discovery.

I'm running Debian 8.0, and using the official Quay Docker image to run etcd.

I've started the docker single instance cluster using:

docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
 --name etcd quay.io/coreos/etcd etcd \
 -name etcd0 \
 -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
 -initial-advertise-peer-urls http://${HostIP}:2380 \
 -listen-peer-urls http://0.0.0.0:2380 \
 -initial-cluster-token etcd-cluster-1 \
 -initial-cluster etcd0=http://${HostIP}:2380 \
 -initial-cluster-state new

If I clone the latest coreos/jetcd and run mvn package, I get a test failure:

Tests run: 34, Failures: 2, Errors: 0, Skipped: 3, Time elapsed: 28.542 sec <<< FAILURE! - in TestSuite
testListCluster(com.coreos.jetcd.EtcdClusterClientTest)  Time elapsed: 0.013 sec  <<< FAILURE!
java.lang.AssertionError: Members: 1 expected [3] but found [1]
	at com.coreos.jetcd.EtcdClusterClientTest.testListCluster(EtcdClusterClientTest.java:33)

Is this a known issue?

Also, if I try to run it again, I get that same error, plus a new one:

testGetSortedPrefix(com.coreos.jetcd.EtcdKVTest)  Time elapsed: 0.034 sec  <<< FAILURE!
java.lang.AssertionError: expected [3] but found [4]
	at com.coreos.jetcd.EtcdKVTest.testGetSortedPrefix(EtcdKVTest.java:115)

So as a secondary issue, there may be a need to setup the environment properly.

Thank you,
Dustin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.