预建 Spark 2.1.0 在启动 spark-shell 时创建 metastore_db 文件夹和 derby.log
Prebuilt Spark 2.1.0 creates metastore_db folder and derby.log when launching spark-shell
我刚刚从 Spark 2.0.2 升级到 Spark 2.1.0(通过下载 Hadoop 2.7 及更高版本的预构建版本)。没有安装 Hive。
启动 spark-shell 后,会在启动位置创建 metastore_db/
文件夹和 derby.log
文件,以及一堆警告日志(未打印)在以前的版本中)。
对调试日志的仔细检查表明 Spark 2.1.0 试图初始化 HiveMetastoreConnection
:
17/01/13 09:14:44 INFO HiveUtils: Initializing HiveMetastoreConnection version 1.2.1 using Spark classes.
Spark 2.0.2 的类似调试日志未显示 HiveMetastoreConnection
的任何初始化。
这是有意为之的行为吗?这可能与 spark.sql.warehouse.dir
现在是会话之间共享的静态配置这一事实有关吗?我没有安装 Hive,如何避免这种情况?
提前致谢!
来自 Spark 2.1.0 documentation pages:
When not configured by the hive-site.xml, the context automatically
creates metastore_db in the current directory and creates a directory
configured by spark.sql.warehouse.dir, which defaults to the directory
spark-warehouse in the current directory that the Spark application is
started. Note that the hive.metastore.warehouse.dir property in
hive-site.xml is deprecated since Spark 2.0.0. Instead, use
spark.sql.warehouse.dir to specify the default location of database in
warehouse.
因为你没有安装 Hive,你不会有 hive-site.xml 配置文件,这必须默认为当前目录。
如果您不打算在 Spark 中使用 HiveContext
,您可以从源代码重新安装 Spark 2.1.0,使用 Maven 重建它并确保省略启用 Hive 支持的 -Phive -Phive-thriftserver
标志。
对于未来的 google 员工:在每个工作目录中创建 metastore_db
和 derby.log
的实际根本原因是 derby.system.home
的默认值。
这可以在 spark-defaults.conf
中更改,请参阅 。
Spark 1.6 也会发生这种情况。您可以通过添加 Spark 提交额外选项来更改路径:
-Dderby.system.home=/tmp/derby
(或derby.properties,有几种方法可以改变它)。
我刚刚从 Spark 2.0.2 升级到 Spark 2.1.0(通过下载 Hadoop 2.7 及更高版本的预构建版本)。没有安装 Hive。
启动 spark-shell 后,会在启动位置创建 metastore_db/
文件夹和 derby.log
文件,以及一堆警告日志(未打印)在以前的版本中)。
对调试日志的仔细检查表明 Spark 2.1.0 试图初始化 HiveMetastoreConnection
:
17/01/13 09:14:44 INFO HiveUtils: Initializing HiveMetastoreConnection version 1.2.1 using Spark classes.
Spark 2.0.2 的类似调试日志未显示 HiveMetastoreConnection
的任何初始化。
这是有意为之的行为吗?这可能与 spark.sql.warehouse.dir
现在是会话之间共享的静态配置这一事实有关吗?我没有安装 Hive,如何避免这种情况?
提前致谢!
来自 Spark 2.1.0 documentation pages:
When not configured by the hive-site.xml, the context automatically creates metastore_db in the current directory and creates a directory configured by spark.sql.warehouse.dir, which defaults to the directory spark-warehouse in the current directory that the Spark application is started. Note that the hive.metastore.warehouse.dir property in hive-site.xml is deprecated since Spark 2.0.0. Instead, use spark.sql.warehouse.dir to specify the default location of database in warehouse.
因为你没有安装 Hive,你不会有 hive-site.xml 配置文件,这必须默认为当前目录。
如果您不打算在 Spark 中使用 HiveContext
,您可以从源代码重新安装 Spark 2.1.0,使用 Maven 重建它并确保省略启用 Hive 支持的 -Phive -Phive-thriftserver
标志。
对于未来的 google 员工:在每个工作目录中创建 metastore_db
和 derby.log
的实际根本原因是 derby.system.home
的默认值。
这可以在 spark-defaults.conf
中更改,请参阅
Spark 1.6 也会发生这种情况。您可以通过添加 Spark 提交额外选项来更改路径:
-Dderby.system.home=/tmp/derby
(或derby.properties,有几种方法可以改变它)。