我可以使用OpenTSDB连接到kerberos HBase。我列出了我为连接到kerberos HBase所做的配置更改。
1)配置更改 'opentsdb.conf' ,请在运行tsdb命令时确保该文件在路径中。
'opentsdb.conf'
tsd.network.port = 4242 tsd.storage.hbase.zk_basedir = /hbase-secure tsd.storage.hbase.zk_quorum = ZKhostname1,ZKhostname2,ZKhostname3 hbase.security.auth.enable=true hbase.security.authentication=kerberos hbase.kerberos.regionserver.principal=hbase/hostname@FORSYS.LAN hbase.sasl.clientconfig=Client
2)为了避免类路径/ JVM问题,我已经完成了所有的classpath和jvm配置 'tsdb' 文件位于 '/home/user/opentsdb-2.3.0/build'
'tsdb'
'/home/user/opentsdb-2.3.0/build'
# Add the src dir so we can find logback.xml CLASSPATH="$CLASSPATH:$abs_srcdir/src:/usr/hdp/2.4.2.0-258/zookeeper/lib/:/usr/hdp/2.4.2.0-258/zookeeper/:/etc/hadoop/2.4.2.0-258/0/:/usr/hdp/2.4.2.0-258/hbase/:/etc/hbase/2.4.2.0-258/0/:/home/user/phoenix-4.4.0-HBase-1.1-client.jar" JVMARGS=${JVMARGS-'-Djava.security.krb5.conf=/etc/krb5.conf -Dhbase.security.authentication=kerberos -Dhbase.kerberos.regionserver.principal=hbase/hostname@FORSYS.LAN -Dhbase.rpc.protection=authentication -Dhbase.sasl.clientconfig=Client -Djava.security.auth.login.config=/home/user/opentsdb-jaas.conf -enableassertions -enablesystemassertions'}
3)opentsdb-jaas.conf文件
Client { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=false useTicketCache=true; }
4)用于运行opentsdb tsd实例的命令,请注意我们可以覆盖一些配置的属性 'opentsdb.conf' 在命令行上。
./build/tsdb tsd --port=4242 --staticroot=/home/user/opentsdb-2.3.0/build/staticroot --cachedir=/home/user/opentsdb-2.3.0/build/cache-dir --zkquorum=ZKhostname1:2181,ZKhostname2:2181,ZKhostname3:2181
你可能会发现 以下步骤 有用。两个数据库都从Java客户端连接到HBase,尽管OpenTSDB中的Java客户端可能不同。