1 回答

TA貢獻1846條經(jīng)驗 獲得超7個贊
我遇到了類似的問題,最后我手動創(chuàng)建了客戶端 Pod 所需的服務(wù)。就我而言,我想部署不支持集群模式的 Spark-thrift 服務(wù)器。
首先,您需要創(chuàng)建 Spark blockManager 和驅(qū)動程序本身所需的服務(wù)
apiVersion: v1
kind: Service
metadata:
name: spark-thrift
spec:
type: ClusterIP
ports:
- protocol: TCP
port: 4000
name: driver
- protocol: TCP
port: 4001
name: block-manager
現(xiàn)在你可以像這樣啟動你的驅(qū)動程序:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: spark-thrift
labels:
app: spark-thrift
spec:
template:
spec:
containers:
- name: spark-thrift-driver
image: image:latest
command:
- /opt/spark/bin/spark-submit
args:
- "--name"
- "spark-thrift"
- "--class"
- "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
- "--conf"
- "spark.driver.port=4000"
- "--conf"
- "spark.driver.host=spark-thrift"
- "--conf"
- "spark.driver.bindAddress=0.0.0.0"
- "--conf"
- "spark.driver.blockManager.port=4001"
imagePullPolicy: Always
ports:
- name: driver
containerPort: 4000
- name: blockmanager
containerPort: 4001
這里的重要論點是
“spark.driver.host=spark-thrift” - 指向主機(因此是服務(wù)名稱)
“spark.driver.port=4000” - 指向驅(qū)動程序端口
“spark.driver.bindAddress=0.0.0.0” - 這是spark不使用spark-thrift作為主機名所必需的,否則會導(dǎo)致錯誤
“spark.driver.blockManager.port=4001” - 指向 blockManager 端口
顯然,這不是一個工作 Pod 的完整示例,您仍然需要在規(guī)范中配置您自己的端口和卷。
添加回答
舉報