更新时间:2022-09-30 GMT+08:00

配置多主实例与多租户模式切换

配置场景

在使用集群中,如果需要在多主实例模式与多租户模式之间切换,则还需要进行如下参数的设置。

  • 多租户切换成多主实例模式
    修改Spark2x服务的以下参数:
    • spark.thriftserver.proxy.enabled=false
    • spark.scheduler.allocation.file=#{conf_dir}/fairscheduler.xml
    • spark.proxyserver.hash.enabled=false
  • 多主实例切换成多租户模式
    修改Spark2x服务的以下参数:
    • spark.thriftserver.proxy.enabled=true
    • spark.scheduler.allocation.file=./__spark_conf__/__hadoop_conf__/fairscheduler.xml
    • spark.proxyserver.hash.enabled=true

配置描述

登录Manager,选择“集群 > 待操作集群的名称 > 服务 > Spark2x > 配置”,单击“全部配置”,搜索并修改以下参数。

表1 参数说明

参数

说明

默认值

spark.thriftserver.proxy.enabled

是否使用多租户模式。

  • false表示使用多实例模式
  • true表示使用多租户模式

true

spark.scheduler.allocation.file

公平调度文件路径。

  • 多主实例配置为:#{conf_dir}/fairscheduler.xml
  • 多租户配置为:./__spark_conf__/__hadoop_conf__/fairscheduler.xml

./__spark_conf__/__hadoop_conf__/fairscheduler.xml

spark.proxyserver.hash.enabled

是否使用Hash算法连接ProxyServer。

  • true为使用Hash算法,使用多租户模式时,该参数需配置为true。
  • false为使用随机连接,多主实例模式,配置为false。

true

说明:

该参数修改后需要重新下载客户端。