Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper >> mail # user >> SASL required now?


Copy link to this message
-
Re: SASL required now?
I'm on a mac too running mountain lion, but I'm running java 1.6.  Could
that be it?

-m

On Tue, Jan 22, 2013 at 4:51 PM, Jordan Zimmerman <
[EMAIL PROTECTED]> wrote:

> FYI - I just tried your code snippet and it works fine for me:
>
> OS: MacOS X (latest)
> JDK: openjdk version "1.7.0-ea"
> ZooKeeper: 3.4.5
>
> -JZ
>
> On Jan 22, 2013, at 4:45 PM, Matthew Daumen <[EMAIL PROTECTED]> wrote:
>
> > Folks,
> >
> > I'm looking for a solution to creating an embedded zookeeper server for
> > testing.  I was using Curator's TestingServer, but after Curator 1.2.3 it
> > is broken and fails to allow me to authenticate.
> >
> > I'm working from
> >
> http://zookeeper.apache.org/doc/r3.4.5/zookeeperAdmin.html#sc_minimumConfiguration
> >
> > So, I tried this out:
> >
> >        Properties startupProperties = new Properties();
> >
> >        startupProperties.put("clientPort", 33333);
> >        startupProperties.put("dataDir", "/www/a/data/zookeeper/data");
> >        startupProperties.put("tickTime", 2000);
> >
> >        QuorumPeerConfig quorumConfiguration = new QuorumPeerConfig();
> >        try {
> >            quorumConfiguration.parseProperties(startupProperties);
> >        } catch(Exception e) {
> >            throw new RuntimeException(e);
> >        }
> >
> >        final ZooKeeperServerMain zooKeeperServer = new
> > ZooKeeperServerMain();
> >        final ServerConfig configuration = new ServerConfig();
> >        configuration.readFrom(quorumConfiguration);
> >
> >        new Thread() {
> >            public void run() {
> >                try {
> >                    zooKeeperServer.runFromConfig(configuration);
> >                } catch (IOException e) {
> >                    log.error("ZooKeeper Failed", e);
> >                }
> >            }
> >        }.start();
> >
> >            try {
> >                framework = CuratorFrameworkFactory.builder()
> >                    .connectString("localhost:33333")
> >                    .connectionTimeoutMs(60000)
> >                    .retryPolicy(new RetryNTimes(5, 10000))
> >                    .build();
> >            } catch (Exception e) {
> >                log.error("Error trying to instantiate ZK
> > TestingServer...", e);
> >            }
> >
> >            framework.start();
> >
> >
> > For some reason, when I try to connect to the server I've created using
> > localhost:3333, I get the following:
> >
> > 2013-01-22 16:19:40 | ERROR |  | Thread-13 |
> > com.macys.stella.services.async.ZookeeperTestServer | ZooKeeper Failed
> > java.io.IOException: Could not configure server because SASL
> configuration
> > did not allow the  ZooKeeper server to authenticate itself properly:
> > javax.security.auth.login.FailedLoginException: Password
> Incorrect/Password
> > Required
> > at
> >
> org.apache.zookeeper.server.ServerCnxnFactory.configureSaslLogin(ServerCnxnFactory.java:205)
> > at
> >
> org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:87)
> > at
> >
> org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:110)
> > at
> >
> com.macys.stella.services.async.ZookeeperTestServer$1.run(ZookeeperTestServer.java:52)
> > 2013-01-22 16:19:40 | INFO  |  | RMI TCP Connection(2)-127.0.0.1 |
> > com.netflix.curator.framework.imps.CuratorFrameworkImpl | Starting
> > 2013-01-22 16:19:40 | ERROR |  | RMI TCP
> > Connection(2)-127.0.0.1-EventThread |
> com.netflix.curator.ConnectionState |
> > Authentication failed
> > 2013-01-22 16:19:40 | INFO  |  | RMI TCP
> > Connection(2)-127.0.0.1-EventThread |
> > com.netflix.curator.framework.state.ConnectionStateManager | State
> change:
> > CONNECTED
> >
> > This is followed by a lot of log entries like this:
> > 2013-01-22 16:19:43 | ERROR |  | RMI TCP
> > Connection(2)-127.0.0.1-EventThread |
> com.netflix.curator.ConnectionState |
> > Authentication failed
> > 2013-01-22 16:19:44 | ERROR |  | RMI TCP
> > Connection(2)-127.0.0.1-EventThread |
> com.netflix.curator.ConnectionState |