zookeeper sasl authentication issue
Asked Answered
S

2

6

I am trying to have setup SASL authentication for my zookeeper for Kafka. I followed all the steps mentioned in below link

https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication

Below is my server_jaas.conf file kept in /home directory

Server {
   org.apache.kafka.common.security.plain.PlainLoginModule required
   username="admin"
   password="admin-secret"
   user_admin="admin-secret"
};

Below is my java.env file configuration

SERVER_JVMFLAGS="-Djava.security.auth.login.config=/home/server_jaas.conf"

Below is the error I get

2017-08-01 16:49:40,774 [myid:] - ERROR [main:ServerCnxnFactory@199] - No JAAS configuration section named 'Server' was foundin '/home/server_jaas.conf'.
2017-08-01 16:49:40,774 [myid:] - ERROR [main:ZooKeeperServerMain@64] - Unexpectked exception, exiting abnormally
java.io.IOException: No JAAS configuration section named 'Server' was foundin '/home/server_jaas.conf'.
    at org.apache.zookeeper.server.ServerCnxnFactory.configureSaslLogin(ServerCnxnFactory.java:200)
    at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:82)
    at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:117)
    at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:87)
    at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:53)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Sakovich answered 1/8, 2017 at 15:5 Comment(1)
@Igor were you ever able to figure out what the problem was? I ran into the same issue and have been banging my head for quite a while now.Ido
L
1

Try adding ; to the end of your server definition

Server {
   org.apache.kafka.common.security.plain.PlainLoginModule required
   username="admin"
   password="admin-secret"
   user_admin="admin-secret";
};
Lofty answered 13/12, 2017 at 16:15 Comment(0)
F
0

The content of config file could be like this:

Server {
   org.apache.kafka.common.security.plain.PlainLoginModule required
   username="admin"
   password="admin-secret"
   user_admin="admin-secret";
};

and make sure the location of /home/server_jaas.conf is correct.

I got the same exception since I gave a wrong location of this config file.

Faliscan answered 23/1, 2018 at 7:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.