技术标签: apache spark HBase kerberos
面对Kerberos启用Hadoop群集的一个问题。
我们正在尝试在与Kafka(直接流)和HBase交互的纱线群集上运行流媒体作业。
不知何故,我们无法在集群模式下连接到HBase。我们使用keytab登录到HBase。
这就是我们要做的:
spark-submit --master yarn-cluster --keytab "dev.keytab" --principal "[email protected]" --conf "spark.executor.extraJavaOptions=-Dlog4j.configuration=log4j_executor_conf.properties -XX:+UseG1GC" --conf "spark.driver.extraJavaOptions=-Dlog4j.configuration=log4j_driver_conf.properties -XX:+UseG1GC" --conf spark.yarn.stagingDir=hdfs:///tmp/spark/ --files "job.properties,log4j_driver_conf.properties,log4j_executor_conf.properties" service-0.0.1-SNAPSHOT.jar job.properties
连接到HBase:
def getHbaseConnection(properties: SerializedProperties): (Connection, UserGroupInformation) = {
val config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", HBASE_ZOOKEEPER_QUORUM_VALUE);
config.set("hbase.zookeeper.property.clientPort", 2181);
config.set("hadoop.security.authentication", "kerberos");
config.set("hbase.security.authentication", "kerberos");
config.set("hbase.cluster.distributed", "true");
config.set("hbase.rpc.protection", "privacy");
config.set("hbase.regionserver.kerberos.principal", “hbase/[email protected]”);
config.set("hbase.master.kerberos.principal", “hbase/[email protected]”);
UserGroupInformation.setConfiguration(config);
var ugi: UserGroupInformation = null;
if (SparkFiles.get(properties.keytab) != null
&& (new java.io.File(SparkFiles.get(properties.keytab)).exists)) {
ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(properties.kerberosPrincipal,
SparkFiles.get(properties.keytab));
} else {
ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(properties.kerberosPrincipal,
properties.keytab);
}
val connection = ConnectionFactory.createConnection(config);
return (connection, ugi);
}
我们连接到HBase:…。
foreachRDD { rdd =>
if (!rdd.isEmpty()) {
//var ugi: UserGroupInformation = Utils.getHbaseConnection(properties)._2
rdd.foreachPartition { partition =>
val connection = Utils.getHbaseConnection(propsObj)._1
val table = …
partition.foreach { json =>
}
table.put(puts)
table.close()
connection.close()
}
}
}
keytab文件没有被复制到纱线登台/临时目录,我们没有在sparkfiles中获得。
错误是:
This server is in the failed servers list: myserver.test.com/120.111.25.45:60020
RpcRetryingCaller{globalStartTime=1497943263013, pause=100, retries=5}, org.apache.hadoop.hbase.ipc.FailedServerException: This server is in the failed servers list: myserver.test.com/120.111.25.45:60020
RpcRetryingCaller{globalStartTime=1497943263013, pause=100, retries=5}, org.apache.hadoop.hbase.ipc.FailedServerException: This server is in the failed servers list: myserver.test.com/120.111.25.45:60020 at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:147)
at org.apache.hadoop.hbase.client.HTable.get(HTable.java:935)
环境搭建及接口调用 一、基础环境搭建 1.节点基础网络配置 2.配置 SSH 免密码登录 3.安装 JDK、Scala 4.配置完全分布式的 Hadoop 5.配置完全分布式的 HBase 6.配置 StandAlone 模式的 Spark 7.安装和配置 MySQL 8.Hbase操作 二、存储接口设计及使用说明 1.存储接口设计 2.存储数据请求标准json格式 3.存储接口调用 4.存储返回...
大数据云平台 平台部署 1.Hadoop平台 2.HDFS 3.Hbase数据库 4.Hive 5.MapReduce Hbase表结构设计 1.Hbase简介 2.Hbase设计 存储与查询接口设计 1.存储接口设计 2.查询接口设计 后台数据仓库设计 数据仓库设计 涉及范围 Linux系统环境搭建 Hadoop + Spark + Hbase 平台部署 Hbase表结构设计 数据存储及查询接口...
1.字符串转化成date类型要用parse,date转为固定格式的string要用format 2.String newStr = oldStr.replaceAll("\"",""); //这个是把所有的 " 都去掉. 3.spark本地运行的时候一定要记得setMaster("local") 4.用到i...
需要配置hbase-site.xml: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> hbase.rootdir hdfs://主机1(zhz1...
记一次HbaseClient的bug: ①本地测试可正常连接,HbaseClient版本和Ambari版本一致,可正常写入 ②打jar包在集群生产环境下运行,log日志显式发现ConnectionFactory.createConnection(conf); 此处一直等待,ConnectionFactory.createConnection 无法获取connection 且不报错,最后返...
zeppelin配置hbase解释器 准备:集群搭建,免密登录,时间同步,hbase确认跑通 1:将hbase相关jar包导入到zepplin目录下 cp /usr/local/hbase/lib/hbase-* /usr/local/zeppelin/interpreter/hbase/ 2:配置zepplin下conf的相关配置文件 vi /usr/local/hbase/conf/zeppe...
spoon下载安装地址:http://www.pentaho.com/download 选择 Download Windows ,只有windows 版的才是spoon,下载解压后即可使用,无需安装。 spoon是纯java编写的,所以使用前必需安装java的jdk包 下载地址:http://www.oracle.com/technetwork/java/javase/download...
退出safemode模式 再运行程序 DataNucleus是一个中间件,实现了jpa接口,使连接Hbase很容易,对model里的实体类进行映射(@Entity,@Id…),dataNucleus进行封装。就像Hibernate,那样对sql语句进行封装。 在myeclipse/eclipse里用Datanuclues时要先装一个datanucleus的插件,安装方法为: 插件下载...
spoon下载安装地址:http://www.pentaho.com/download 选择 Download Windows ,只有windows 版的才是spoon,下载解压后即可使用,无需安装。 spoon是纯java编写的,所以使用前必需安装java的jdk包 下载地址:http://www.oracle.com/technetwork/java/javase/download...
摄像头的8种颜色:橙、黄、绿、紫、灰、蓝、棕、白 分别对应双绞线的8种颜色:橙白、橙、绿白、蓝、蓝白、绿、棕白、棕 简化一点用网线的568B顺序分别对接就是:橙白(接橙色)、橙(接黄色)、绿白(接绿色)、蓝(接紫色)、蓝白(接灰色)、绿(接蓝色)、棕白(接棕色)、棕(接白色) 568A标准:绿白,绿,橙白,蓝,蓝白,橙,棕白,棕 橙绿蓝棕 排列好,先4-6交叉,再1-3、2-6 RJ-4...
I'm trying to suppress IE's default handling of Ctrl+O. I've got a onKeyDown handler which get's called, but even though I call event.cancelBubble and return false, the default File|Open command still...
Recently i've picked up Oracle SQL, Right now i'm trying to write a function that later will be used in a view to generate a list. but for now im stuck on the function itself... The function makes use...
I have a problem regarding of creating table. I want to do this: But I got this: I have tried everything and I'm realize that I have problem with the looping. I've tried to put @endforeach before <...
I have a WPF 3D application (C# .NET 4.0) that has a lot of 3D geometries. Now I need to color these geometries by applying a texture. The source for the texture is one large .PNG file like the follow...
after filling the inputs in the view and clicking the submit button, the records gets saved just fine if I use Firefox. The same goes for IE if I'm quick enough. But when I wait 10 seconds, the POST d...