2016-10-12 6 views
6

हमारे Hadoop क्लस्टर कि यार्न के अधीन ही हम एक समस्या यह है कि कुछ "होशियार" लोगों की तरह pySpark Jupyter पुस्तिकाओं में स्पार्क नौकरियों कॉन्फ़िगर करके संसाधनों का काफी बड़ा हिस्सा खाने के लिए सक्षम हैं कर रहे हैं में:यार्न के तहत हडोप क्लस्टर में संसाधनों के गतिशील स्व आवंटन को सीमित कैसे करें?

conf = (SparkConf() 
     .setAppName("name") 
     .setMaster("yarn-client") 
     .set("spark.executor.instances", "1000") 
     .set("spark.executor.memory", "64g") 
     ) 

sc = SparkContext(conf=conf) 

यह करने के लिए सुराग स्थिति जब ये लोग सचमुच दूसरों को कम "समझदार" निचोड़ते हैं।

क्या उपयोगकर्ताओं को संसाधनों को स्वयं आवंटित करने और संसाधन आवंटन को पूरी तरह से यार्न में छोड़ने का कोई तरीका है?

+0

अधिकतम कतार क्षमता एक व्यक्ति का उपयोग कर सकते पर अधिकतम यार्न कंटेनर आकार और टोपी पर एक टोपी डाल। – abhiieor

उत्तर

3

यार्न कतारों द्वारा बहु किरायेदारी क्लस्टर में क्षमता की योजना के लिए बहुत अच्छा समर्थन है, यार्न संसाधनप्रबंधकका उपयोग करता CapacityScheduler डिफ़ॉल्ट रूप से।

यहां हम कविता नाम अल्फा में स्पार्क में डेमो उद्देश्य के लिए सबमिट कर रहे हैं।

$ ./bin/spark-submit --class path/to/class/file \ 
    --master yarn-cluster \ 
    --queue alpha \ 
    jar/location \ 
    args 

सेटअप कतार:

CapacityScheduler एक पूर्वनिर्धारित कतार जड़ कहा जाता है। सिस्टम में सभी कतार रूट कतार के बच्चे हैं। capacity-scheduler.xml में, पैरामीटर yarn.scheduler.capacity.root.queues का उपयोग बाल कतार को परिभाषित करने के लिए किया जाता है;

उदाहरण के लिए, 3 कतार बनाने के लिए, अल्पविराम से अलग सूची में कतारों का नाम निर्दिष्ट करें।

<property> 
    <name>yarn.scheduler.capacity.root.queues</name> 
    <value>alpha,beta,default</value> 
    <description>The queues at the this level (root is the root queue).</description> 
</property> 

क्षमता योजना के लिए विचार करने के लिए ये कुछ महत्वपूर्ण गुण हैं।

<property> 
    <name>yarn.scheduler.capacity.root.alpha.capacity</name> 
    <value>50</value> 
    <description>Queue capacity in percentage (%) as a float (e.g. 12.5). The sum of capacities for all queues, at each level, must be equal to 100. Applications in the queue may consume more resources than the queue’s capacity if there are free resources, providing elasticity.</description> 
</property> 

<property> 
    <name>yarn.scheduler.capacity.root.alpha.maximum-capacity</name> 
    <value>80</value> 
    <description>Maximum queue capacity in percentage (%) as a float. This limits the elasticity for applications in the queue. Defaults to -1 which disables it.</description> 
</property> 

<property> 
    <name>yarn.scheduler.capacity.root.alpha.minimum-capacity</name> 
    <value>10</value> 
    <description>Each queue enforces a limit on the percentage of resources allocated to a user at any given time, if there is demand for resources. The user limit can vary between a minimum and maximum value. The former (the minimum value) is set to this property value and the latter (the maximum value) depends on the number of users who have submitted applications. For e.g., suppose the value of this property is 25. If two users have submitted applications to a queue, no single user can use more than 50% of the queue resources. If a third user submits an application, no single user can use more than 33% of the queue resources. With 4 or more users, no user can use more than 25% of the queues resources. A value of 100 implies no user limits are imposed. The default is 100. Value is specified as a integer.</description> 
</property> 

लिंक: YARN CapacityScheduler Queue Properties

+0

धन्यवाद! संसाधन आवंटन (स्मृति, निष्पादकों की संख्या इत्यादि) से संबंधित स्पार्क अनुप्रयोगों की सबमिट की गई कॉन्फ़िगरेशन को अनदेखा करने का कोई तरीका है और इसे पूरी तरह से यार्न में छोड़ दें? –

+0

नौकरी में 'स्पार्ककॉन्फ' कक्षा को डिफ़ॉल्ट प्रोप के साथ निर्दिष्ट किया जाना चाहिए, ताकि स्पार्क-सबमिट पैरा को अनदेखा कर दिया जाए। – mrsrinivas

+0

समस्या यह है कि जो भी वे कॉन्फ़िगरेशन में चाहते हैं, वे ढेर कर रहे हैं और हमारा उद्देश्य स्ट्रिप या इच्छापूर्ण कॉन्फ़िगरेशन को अनदेखा करना है –

संबंधित मुद्दे