Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-285

Memcached connection disconnects in case of single node server instance.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.8
    • Component/s: Dependencies
    • Security Level: Public
    • Labels:

      Description

      When I tried to establish a Memcached Connection with a single node server - either 1.8.1 or 2.0.1, following errors were received :

      2013-04-16 18:27:01.247 INFO net.spy.memcached.MemcachedConnection: Added

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      to connect queue
      Created a MemcachedClient with port 11211
      2013-04-16 18:27:01.251 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@1ffb3754
      2013-04-16 18:27:01.263 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000001cbc.
      2013-04-16 18:27:01.266 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=2, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:27:01.267 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=2, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 1.
      2013-04-16 18:27:01.268 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:27:01.268 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: add Key: Emp0000000001cbc Flags: 0 Exp: 0 Data Length: 52
      Deepti Exception 1 java.util.concurrent.ExecutionException: java.util.concurrent.CancellationException: Cancelled
      2013-04-16 18:27:01.269 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000002cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:03.772 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000003cbc.
      2013-04-16 18:27:05.271 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=2, #iq=0, topRop=null, topWop=Cmd: add Key: Emp0000000002cbc Flags: 0 Exp: 0 Data Length: 52, toWrite=0, interested=0}

      2013-04-16 18:27:05.273 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@30b42a7e
      2013-04-16 18:27:05.275 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=2, #Wops=0, #iq=0, topRop=Cmd: add Key: Emp0000000003cbc Flags: 0 Exp: 0 Data Length: 52, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:27:05.278 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=2, #Wops=0, #iq=0, topRop=Cmd: add Key: Emp0000000003cbc Flags: 0 Exp: 0 Data Length: 52, topWop=null, toWrite=0, interested=8}

      , attempt 2.
      2013-04-16 18:27:05.279 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: add Key: Emp0000000003cbc Flags: 0 Exp: 0 Data Length: 52
      Deepti Exception 1 java.util.concurrent.ExecutionException: java.util.concurrent.CancellationException: Cancelled
      2013-04-16 18:27:05.281 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:27:05.281 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000004cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:07.783 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000005cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:10.286 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000006cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:12.788 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000007cbc.
      2013-04-16 18:27:13.281 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=4, #iq=0, topRop=null, topWop=Cmd: add Key: Emp0000000004cbc Flags: 0 Exp: 0 Data Length: 52, toWrite=0, interested=0}

      2013-04-16 18:27:13.283 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@1a23b006
      2013-04-16 18:27:13.286 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=2, #Wops=0, #iq=0, topRop=Cmd: add Key: Emp0000000007cbc Flags: 0 Exp: 0 Data Length: 52, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:27:13.289 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=2, #Wops=0, #iq=0, topRop=Cmd: add Key: Emp0000000007cbc Flags: 0 Exp: 0 Data Length: 52, topWop=null, toWrite=0, interested=8}

      , attempt 3.
      2013-04-16 18:27:13.291 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: add Key: Emp0000000007cbc Flags: 0 Exp: 0 Data Length: 52
      Deepti Exception 1 java.util.concurrent.ExecutionException: java.util.concurrent.CancellationException: Cancelled
      2013-04-16 18:27:13.292 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:27:13.293 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000008cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:15.796 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000009cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:18.298 WARN net.spy.memcached.MemcachedConnection: Could not redistribute to another node, retrying primary node for Emp0000000010cbc.
      Deepti Exception 1 java.lang.RuntimeException: Timed out waiting for operation
      2013-04-16 18:27:29.302 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=3, #iq=0, topRop=null, topWop=Cmd: add Key: Emp0000000008cbc Flags: 0 Exp: 0 Data Length: 52, toWrite=0, interested=0}

      2013-04-16 18:27:29.304 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@3bb59c1b
      2013-04-16 18:27:29.306 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:27:29.306 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 4.
      2013-04-16 18:27:29.307 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:27:59.338 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:27:59.340 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@7685dfcf
      2013-04-16 18:27:59.342 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:27:59.344 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 5.
      2013-04-16 18:27:59.346 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:28:29.376 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:28:29.378 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@606145c5
      2013-04-16 18:28:29.380 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:28:29.382 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 6.
      2013-04-16 18:28:29.384 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:28:59.414 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:28:59.416 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@15fac189
      2013-04-16 18:28:59.417 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:28:59.419 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 7.
      2013-04-16 18:28:59.420 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:29:29.451 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:29:29.453 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@6520b476
      2013-04-16 18:29:29.454 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:29:29.456 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 8.
      2013-04-16 18:29:29.457 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:29:59.485 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:29:59.487 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@3ebbe4b0
      2013-04-16 18:29:59.488 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:29:59.490 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 9.
      2013-04-16 18:29:59.491 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:30:29.521 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:30:29.523 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@14220a0c
      2013-04-16 18:30:29.524 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:30:29.526 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 10.
      2013-04-16 18:30:29.527 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:30:59.557 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:30:59.559 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@2d64ff8f
      2013-04-16 18:30:59.561 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:30:59.562 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 11.
      2013-04-16 18:30:59.564 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version
      2013-04-16 18:31:29.582 INFO net.spy.memcached.MemcachedConnection: Reconnecting

      {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      2013-04-16 18:31:29.584 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@59799a64
      2013-04-16 18:31:29.585 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      java.io.IOException: Disconnected unexpected, will reconnect.
      at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:526)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:430)
      at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:247)
      at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:915)
      2013-04-16 18:31:29.587 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening

      {QA sa=/127.0.0.1:11211, #Rops=1, #Wops=0, #iq=0, topRop=Cmd: version, topWop=null, toWrite=0, interested=8}

      , attempt 12.
      2013-04-16 18:31:29.588 WARN net.spy.memcached.protocol.ascii.AsciiMemcachedNodeImpl: Discarding partially completed op: Cmd: version

      Memcached connection is trying to re-distribute the data on other nodes in a cluster which is why the connection is not getting established.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        daschl Michael Nitschinger added a comment -

        Can you please post the code you used to initialize?

        Show
        daschl Michael Nitschinger added a comment - Can you please post the code you used to initialize?
        Hide
        deeptida Deepti Dawar added a comment -

        You can test this using the attached java file.

        Show
        deeptida Deepti Dawar added a comment - You can test this using the attached java file.
        Hide
        daschl Michael Nitschinger added a comment -

        You need to authenticate correctly in order to connect to a bucket like this:

        AuthDescriptor authDescriptor = new AuthDescriptor(new String[]

        {"PLAIN"}

        ,
        new PlainCallbackHandler("cache", "cache"));

        ConnectionFactory fact = new ConnectionFactoryBuilder()
        .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
        .setAuthDescriptor(authDescriptor)
        .build();

        MemcachedClient client = new MemcachedClient(fact, Arrays.asList(new InetSocketAddress("127.0.0.1", 11210)));

        client.set("foo", 0, "value");
        System.out.println(client.get("foo"));

        client.shutdown();

        Show
        daschl Michael Nitschinger added a comment - You need to authenticate correctly in order to connect to a bucket like this: AuthDescriptor authDescriptor = new AuthDescriptor(new String[] {"PLAIN"} , new PlainCallbackHandler("cache", "cache")); ConnectionFactory fact = new ConnectionFactoryBuilder() .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY) .setAuthDescriptor(authDescriptor) .build(); MemcachedClient client = new MemcachedClient(fact, Arrays.asList(new InetSocketAddress("127.0.0.1", 11210))); client.set("foo", 0, "value"); System.out.println(client.get("foo")); client.shutdown();
        Hide
        daschl Michael Nitschinger added a comment -

        also make sure to use binary with sasl.

        Show
        daschl Michael Nitschinger added a comment - also make sure to use binary with sasl.
        Hide
        deeptida Deepti Dawar added a comment -

        Its working fine after the authentication, but don't you think the behavior should be in sync for the single node and the 4 nodes cluster.

        Before handling the authentication, I was able to connect to only a 4 node cluster. Why is that so ?

        Show
        deeptida Deepti Dawar added a comment - Its working fine after the authentication, but don't you think the behavior should be in sync for the single node and the 4 nodes cluster. Before handling the authentication, I was able to connect to only a 4 node cluster. Why is that so ?
        Hide
        daschl Michael Nitschinger added a comment -

        This has been fixed in SPY 2.9.1, it happened because of the auth sending to moxi. this is now optional there.

        Show
        daschl Michael Nitschinger added a comment - This has been fixed in SPY 2.9.1, it happened because of the auth sending to moxi. this is now optional there.

          People

          • Assignee:
            daschl Michael Nitschinger
            Reporter:
            deeptida Deepti Dawar
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes