Anyone tried a non-sticky SASL configuration with multiple memcached
servers? The authentication fails.
This is the context we define:

<Manager
className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:memcached-server:11212,n2:memcached-server:
11213"
sticky="false"
sessionBackupAsync="false"
lockingMode="auto"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
memcachedProtocol="binary"
username="memcached"
password="password"
/>

Looking at this code snippet in MemcachedSessionService it seems the
connection builder is at fault in case the node ids are encoded.

protected ConnectionFactory createConnectionFactory(final
MemcachedNodesManager memcachedNodesManager,
final ConnectionType connectionType, final Statistics
statistics ) {
if (PROTOCOL_BINARY.equals( _memcachedProtocol )) {
if (connectionType.isSASL()) {
// FIXME: CF with AuthDescriptor is only used if
nodeIdIsNotEncodedInSessionId.
// Shouldn't the AuthDescriptor also be used if !
nodeIdIsNotEncodedInSessionId?
return
memcachedNodesManager.isEncodeNodeIdInSessionId()
? new
SuffixLocatorBinaryConnectionFactory( memcachedNodesManager,

memcachedNodesManager.getSessionIdFormat(), statistics,
_operationTimeout )
:
new
ConnectionFactoryBuilder().setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
.setAuthDescriptor(new AuthDescriptor(new
String[]{"PLAIN"},
new PlainCallbackHandler(_username,
_password)))
.setOpTimeout(_operationTimeout).build();

Search Discussions

  • Martin Grotzke at Feb 29, 2012 at 9:52 am
    Hi Angelo,

    you're right, there's a piece missing to support this. I'll look into
    this as soon as I have time, alternatively you can submit a pull request.

    I've also just accepted issue #124.

    Cheers,
    Martin

    On 02/29/2012 02:03 AM, Angelo Obreja wrote:
    Anyone tried a non-sticky SASL configuration with multiple memcached
    servers? The authentication fails.
    This is the context we define:

    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:memcached-server:11212,n2:memcached-server:
    11213"
    sticky="false"
    sessionBackupAsync="false"
    lockingMode="auto"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    memcachedProtocol="binary"
    username="memcached"
    password="password"
    />

    Looking at this code snippet in MemcachedSessionService it seems the
    connection builder is at fault in case the node ids are encoded.

    protected ConnectionFactory createConnectionFactory(final
    MemcachedNodesManager memcachedNodesManager,
    final ConnectionType connectionType, final Statistics
    statistics ) {
    if (PROTOCOL_BINARY.equals( _memcachedProtocol )) {
    if (connectionType.isSASL()) {
    // FIXME: CF with AuthDescriptor is only used if
    nodeIdIsNotEncodedInSessionId.
    // Shouldn't the AuthDescriptor also be used if !
    nodeIdIsNotEncodedInSessionId?
    return
    memcachedNodesManager.isEncodeNodeIdInSessionId()
    ? new
    SuffixLocatorBinaryConnectionFactory( memcachedNodesManager,

    memcachedNodesManager.getSessionIdFormat(), statistics,
    _operationTimeout )
    :
    new
    ConnectionFactoryBuilder().setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
    .setAuthDescriptor(new AuthDescriptor(new
    String[]{"PLAIN"},
    new PlainCallbackHandler(_username,
    _password)))
    .setOpTimeout(_operationTimeout).build();
    --
    Dennis Brakhane, Martin Grotzke und Ole Langbehn GbR
    Breitenfelder Str. 13c, 20251 Hamburg
  • Angelo Obreja at Feb 29, 2012 at 7:01 pm
    Yes, I think it's better to follow this under issue #124 -
    http://code.google.com/p/memcached-session-manager/issues/detail?id=124
    Btw, I posted there a few things I've tried and it seems to work fine,
    but I would like you to take a closer look because you know better all
    the implications of the change.

    Thank you,
    Angelo
    On Feb 29, 1:52 am, Martin Grotzke wrote:
    Hi Angelo,

    you're right, there's a piece missing to support this. I'll look into
    this as soon as I have time, alternatively you can submit a pull request.

    I've also just accepted issue #124.

    Cheers,
    Martin

    On 02/29/2012 02:03 AM, Angelo Obreja wrote:








    Anyone tried a non-sticky SASL configuration with multiple memcached
    servers? The authentication fails.
    This is the context we define:
    <Manager
    className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:memcached-server:11212,n2:memcached-server:
    11213"
    sticky="false"
    sessionBackupAsync="false"
    lockingMode="auto"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    memcachedProtocol="binary"
    username="memcached"
    password="password"
    />
    Looking at this code snippet in MemcachedSessionService it seems the
    connection builder is at fault in case the node ids are encoded.
    protected ConnectionFactory createConnectionFactory(final
    MemcachedNodesManager memcachedNodesManager,
    final ConnectionType connectionType, final Statistics
    statistics ) {
    if (PROTOCOL_BINARY.equals( _memcachedProtocol )) {
    if (connectionType.isSASL()) {
    // FIXME: CF with AuthDescriptor is only used if
    nodeIdIsNotEncodedInSessionId.
    // Shouldn't the AuthDescriptor also be used if !
    nodeIdIsNotEncodedInSessionId?
    return
    memcachedNodesManager.isEncodeNodeIdInSessionId()
    ? new
    SuffixLocatorBinaryConnectionFactory( memcachedNodesManager,
    memcachedNodesManager.getSessionIdFormat(), statistics,
    _operationTimeout )
    :
    new
    ConnectionFactoryBuilder().setProtocol(ConnectionFactoryBuilder.Protocol.BI NARY)
    .setAuthDescriptor(new AuthDescriptor(new
    String[]{"PLAIN"},
    new PlainCallbackHandler(_username,
    _password)))
    .setOpTimeout(_operationTimeout).build();
    --
    Dennis Brakhane, Martin Grotzke und Ole Langbehn GbR
    Breitenfelder Str. 13c, 20251 Hamburg

    signature.asc
    < 1KViewDownload

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmemcached-session-manager @
categoriesmemcached
postedFeb 29, '12 at 8:05a
activeFeb 29, '12 at 7:01p
posts3
users2
websitememcached.org

2 users in discussion

Angelo Obreja: 2 posts Martin Grotzke: 1 post

People

Translate

site design / logo © 2022 Grokbase