当前位置:网站首页>Several methods of spark parameter configuration
Several methods of spark parameter configuration
2022-07-25 14:35:00 【Gegwu MMQ!!】
1.Spark attribute
Spark The operation of the application is controlled by external parameters , Whether the parameters are set correctly , Good and bad will directly affect the performance of the application , This will affect the performance of our entire cluster . The following methods are used for parameter control :
(1) Set it directly to SparkConf, Pass to... In the form of parameters SparkContext, Achieve the goal of control .( adopt set() Methods the incoming key-value Yes ) such as :
val conf = new SparkConf()
.setMaster(”local[2]“) # Be careful 1
.setAppName(”test“)
.set(“spark.cores.max”, “10”) ######set() Method to pass in attribute parameters
val sc = new SparkContext(conf)
# Be careful 1 Local open 2 Threads to work , Pay attention , The local working mode is in addition to collection generation RDD、 Read local files and hdfs The file can start a thread and work outside , In other cases, at least two threads can work normally . This is because in addition to the above ,Spark Will open a reciver To accept the data , If there is only one thread ,reciver Just occupy the resources of the only thread , And data processing and other operations will have no resources to execute .
(2) Dynamic loading Spark attribute . Not hard coded for attributes such as application name and clustering mode , Flexible application . You can do this :val sc = new SparkContext(new SparkConf()). adopt spark-submit Add necessary parameters when . Such as :
./bin/spark-submit --name “My app” --master local[4] --conf spark.eventLog.enabled=false
–conf “spark.executor.extraJavaOptions=-XX:&#
边栏推荐
- awk从入门到入土(21)awk脚本调试
- From fish eye to look around to multi task King bombing -- a review of Valeo's classic articles on visual depth estimation (from fisheyedistancenet to omnidet) (Part 2)
- pt100测温电路图(ad590典型的测温电路)
- gson与fastjson
- sqli-labs Basic Challenges Less11-22
- filters获取data中的数据;filters使用data中的数据
- 基于PaddleOCR开发uni-app离线身份证识别插件
- Go language founder leaves Google
- Idea error failed to determine a suitable driver class
- Thymeleaf controls whether display is displayed through style
猜你喜欢

Wechat official account official environment online deployment, third-party public platform access

~4.2 CCF 2021-12-1 sequence query

Typora cannot open the prompt to install a new version solution

SSH服务器拒绝了密码

Why do China Construction and China Railway need this certificate? What is the reason?

Alibaba cloud installs mysql5.7

sqli-labs Basic Challenges Less1-10

牛客多校 E G J L

【MySQL系列】-索引知多少

The security market has entered a trillion era, and the security B2B online mall platform has been accurately connected to deepen the enterprise development path
随机推荐
Doris learning notes integration with other systems
D2. Chopping Carrots (Hard Version) (每日一题)
C language and SQL Server database technology
QObject源码剖析-d指针和q指针
MySQL table operation
Sqli labs installation environment: ubuntu18 php7
Educational codeforces round 132 (rated for Div. 2) C, d+ac automata
Huawei ENSP router static route (the next hop address of the default route)
C language and SQL Server database technology
[cartographer_ros] VIII: Official demo parameter configuration and effect
GameFramework制作游戏(二)制作UI界面
Numpy basic package for data analysis
河源市区推出消防安全主题奶茶 助推夏季火灾防控
IP地址分类,判断一个网段是子网超网
Development of uni app offline ID card identification plug-in based on paddleocr
软件测试 -- 1 软件测试知识大纲梳理
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
[Nuxt 3] (十一) 传送 & 模块
Awk from getting started to digging in (21) awk script debugging
OverTheWire-Bandit