Hi Param,

I wanted to enable SASL support on memcached instance running on my mac. 
Can you please share steps to on how to set username and password for SASL 
enabled memcached instance running on my mac. 

I followed homebew to install latest memcached.

brew install memcached --with-sasl-pwdb

Warning: memcached-1.4.34_1 already installed


After installation I followed your above command but it says internal 
passwd is disabled. Can you please help here! Thanks
 memcached -u nishant -m 1024 -p 8010 -S -B binary -vvv

INFO: MEMCACHED_SASL_PWDB not specified. Internal passwd database disabled

Initialized SASL.


On Friday, 15 August 2014 10:34:32 UTC-7, para...@gmail.com wrote:
>
> Hi All,
>
> I am using Spymemcached and my memcached server is running with SASL 
> support enabled. At memcached client initalization code, there is a NPE 
> coming:
>
> Exception Stacktrace for the same is :
>
>
> Exception in thread "main" java.lang.NullPointerException
>     at net.spy.memcached.MemcachedClient.addObserver(MemcachedClient.java:
> 2482)
>     at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:280)
>     at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:219)
>
> Looks like it's failing even before it connects to Memcached server. Is 
> there any other configuration I need to specify in my code for connecting?
>
> The command used to start memcached server is:
>
> memcached -u nobody -m 1024 -p 8010 -S -B binary -vvv
> Initialized SASL.
>
>
> Here's the test code I am using:
>
> public class MemcachedTest {
>     public static void main(String[] args) {
>         AuthDescriptor ad = new AuthDescriptor(new String[] { "PLAIN" },
>                 new PlainCallbackHandler(
>                         "memc...@example.com <javascript:>", "memcached"
> ));
>         ConnectionFactory connFactory = new ConnectionFactoryBuilder()
>                 .setProtocol(ConnectionFactoryBuilder.Protocol.BINARY)
>                 .setAuthDescriptor(ad).build();
>
>         List<InetSocketAddress> servers = AddrUtil
>                 .getAddresses("localhost:8010");
>         MemcachedClient cacheClient = null;
>         try {
>             cacheClient = new MemcachedClient(connFactory, servers);
>             cacheClient.set("foo", 50000, "bar");
>             System.out.println("From cachelandia: " + cacheClient.get(
> "foo"));
>         } catch (IOException iox) {
>             iox.printStackTrace();
>
>         }
>     }
> }
>
>
> Any pointer on how this issue can be resolved will be really helpful.
>
> Thanks!
> Param
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to