- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用运行 Azure HDInsight 按需群集 (3.6) 的 Azure 数据工厂 (v1) 在 Hive 中执行一些数据转换。
由于 HDInsight On Demand 群集在空闲一段时间后被破坏,并且我希望/需要保留有关 Hive 表的元数据(例如分区),因此我还使用 Azure SQL Server 数据库配置了外部 Hive 元存储。
现在,我希望将所有生产数据存储在一个单独的存储帐户上,而不是一个“默认”帐户,其中数据工厂和 HDInsight 还为日志记录和其他运行时数据创建容器。
所以我有以下资源:
数据工厂除外,其位置为North Europe
,所有资源都在同一位置West Europe
,这应该没问题(HDInsight 群集必须与要使用的任何存储帐户位于同一位置)。所有与数据工厂相关的部署都是使用 DataFactoryManagementClient 完成的API。
示例 Hive 脚本(在数据工厂中作为 HiveActivity 部署)如下所示:
CREATE TABLE IF NOT EXISTS example_table (
deviceId string,
createdAt timestamp,
batteryVoltage double,
hardwareVersion string,
softwareVersion string,
)
PARTITIONED BY (year string, month string) -- year and month from createdAt
CLUSTERED BY (deviceId) INTO 256 BUCKETS
STORED AS ORC
LOCATION 'wasb://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f0939f9e8491999e9582b09194949984999f9e919c83849f82919795de929c9f92de939f8295de87999e949f8783de9e9584" rel="noreferrer noopener nofollow">[email protected]</a>/example_table'
TBLPROPERTIES ('transactional'='true');
INSERT INTO TABLE example_table PARTITIONS (year, month) VALUES ("device1", timestamp "2018-01-22 08:57:00", 2.7, "hw1.32.2", "sw0.12.3");
遵循文档 here和 here ,这应该相当简单:只需将新的存储帐户添加为附加链接服务(使用 additionalLinkedServiceNames
属性)。
但是,当 Hive 脚本尝试访问存储在该帐户上的表时,这会导致以下异常:
IllegalStateException Error getting FileSystem for wasb : org.apache.hadoop.fs.azure.AzureException: org.apache.hadoop.fs.azure.KeyProviderException: ExitCodeException exitCode=2: Error reading S/MIME message
139827842123416:error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data:a_d2i_fp.c:247:
139827842123416:error:0D0D106E:asn1 encoding routines:B64_READ_ASN1:decode error:asn_mime.c:192:
139827842123416:error:0D0D40CB:asn1 encoding routines:SMIME_read_ASN1:asn1 parse error:asn_mime.c:517:
Some googling told me当 key 提供程序未正确配置时会发生这种情况(即抛出异常,因为它尝试解密 key ,即使 key 未加密)。手动设置后fs.azure.account.keyprovider.<storage_name>.blob.core.windows.net
至org.apache.hadoop.fs.azure.SimpleKeyProvider
它似乎适用于读取数据并将数据“简单”写入表,但当元存储参与时(创建表,添加新分区,...)再次失败:
ERROR exec.DDLTask: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Got exception: org.apache.hadoop.fs.azure.AzureException com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:783)
at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4434)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:316)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
[...]
at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
Caused by: MetaException(message:Got exception: org.apache.hadoop.fs.azure.AzureException com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result$create_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:38593)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result$create_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:38561)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$create_table_with_environment_context_result.read(ThriftHiveMetastore.java:38487)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_create_table_with_environment_context(ThriftHiveMetastore.java:1103)
at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.create_table_with_environment_context(ThriftHiveMetastore.java:1089)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table_with_environment_context(HiveMetaStoreClient.java:2203)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.create_table_with_environment_context(SessionHiveMetaStoreClient.java:99)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:736)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:724)
[...]
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:178)
at com.sun.proxy.$Proxy5.createTable(Unknown Source)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:777)
... 24 more
我再次尝试用谷歌搜索,但没有找到可用的东西。我认为这可能与以下事实有关:元存储服务与 Hive 分开运行,并且由于某种原因无法访问配置的存储帐户 key ...但说实话,我认为这一切都应该可以工作无需手动修改 Hadoop/Hive 配置。
所以,我的问题是:我做错了什么以及这应该如何工作?
最佳答案
您需要确保还将 hadoop-azure.jar 和 azure-storage-5.4.0.jar 添加到 hadoop-env.sh 中的 Hadoop 类路径导出中。
导出HADOOP_CLASSPATH=/usr/lib/hadoop-client/hadoop-azure.jar:/usr/lib/hadoop-client/lib/azure-storage-5.4.0.jar:$HADOOP_CLASSPATH
您将需要通过核心站点中的以下参数添加存储 key 。fs.azure.account.key.{storageaccount}.blob.core.windows.net
创建数据库和表时,您需要使用存储帐户和用户 ID 指定位置创建表 {表名}...位置“wasbs://{container}@{storageaccount}.blob.core.windows.net/{filepath}”
如果尝试上述操作后仍然存在问题,请检查存储帐户是 V1 还是 V2。我们遇到了一个问题,V2 存储帐户不适用于我们的 HDP 版本。
关于azure - 如何使用附加 Azure Blob 存储上的外部 Metastore 创建/访问 Hive 表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48384813/
我正在尝试按照文档Unity Catalog在Azure数据库中设置Unity Catalog,但在Databricks上找不到“Create Metastore”。我该怎么办?
当我尝试在具有HiveContext的Jar上运行spark-submit时,出现以下错误。 Spark-defaults.conf中的 spark.sql.hive.metastore.versio
这可能是一个非常基本的问题,所以请原谅我的无知。 我知道 hive 将在开箱即用(hive tar.bin 提取)vanilla 设置中使用两个元存储。就我而言,我有配置单元 0.14。 derby
环境:spark2.11 hive2.2 hadoop2.8.2 hive shell 运行成功!并且没有错误或警告。 但是当运行application.sh时,启动失败 /usr/local/spa
我正在使用带有两个节点的 apache Spark 版本 2.0.0 的独立集群,并且尚未安装 hive。在创建数据帧时出现以下错误。 from pyspark import SparkContext
我需要直接从 Metasore 执行一些 SQL 查询(如 here)。 PS:SHOW/DESCRIBE 命令不够。 如何启用从它作为数据库访问,或者 Metastore 的数据库名称是什么? ..
是否可以在单独的节点上设置Hive Metastore和Hive Server2服务?我知道,HDP ambari会迫使您将这两者与webhcat一起设置在同一节点上,但是其他供应商(例如Cloude
This question already has answers here: How to connect Spark SQL to remote Hive metastore (via thrif
我在Apache Hadoop分布式集群中添加了Hive。而不是在本地目录中创建metastore,我想在HDFS中创建metastore。但是,我在hive-site.xml中的设置似乎无效。我收到
序言:我是 hadoop/hive 的新手。已经安装了独立的 hadoop,现在正在尝试让 hive 工作。我不断收到有关初始化 Metastore 的错误,似乎无法弄清楚如何解决。 (hadoop
我可以使用以下程序获取本地 mysql 元存储设置中的元存储表信息以及配置单元。 import java.sql.Connection; import java.sql.DriverManager;
为了通过 Apache Drill 访问配置单元,我已经启动了 Metastore 作为服务。 为了将它用作 hive-site.xml 中的元存储,我已将 hive.metastore.uris 参
我在配置单元数据库中收到以下错误: Caused by: ERROR XSDB6: Another instance of Derby may have already booted the data
我正在尝试进入 hive shell,但出现以下错误: ubuntu@group-3-vm1:~$ cd $HIVE_HOME ubuntu@group-3-vm1:~/software/hive-1
我使用的是 sqoop 1.4.2 版本。我正在尝试将 sqoop Metastore 从默认的 hsqldb 更改为 mysql。 我在 sqoop-site.xml 文件中配置了以下属性。
使用 AWS EMR on the 5.2.1 version 作为数据处理环境,当处理一个巨大的 JSON 文件,这个文件具有复杂的 schema 和许多嵌套字段时,Hive 无法处理它并且错误如下
我正在开发Spark SQL应用程序,但有几个问题: 我读到Spark-SQL在封面下使用Hive metastore?这是真的?我说的是一个纯粹的Spark-SQL应用程序,该应用程序未显式连接到任
我已经开始在 hive 命令上失败,如下所示: Logging initialized using configuration in file:/usr/local/someuser/hive/con
如何停止我开始使用的 Hive Metastore 服务: hive --service metastore 没有kill命令? 最佳答案 如果您在伪集群中运行它。即单节点集群,您可以通过在同一终端中
这个问题在这里已经有了答案: How to connect Spark SQL to remote Hive metastore (via thrift protocol) with no hive-
我是一名优秀的程序员,十分优秀!