總網頁瀏覽量

2013年5月25日 星期六

fair scheduler設定經驗分享

上禮拜應主管要求,想在fair scheduler加上global的mapper/reducer數量限制
查閱官方文件
http://hadoop.apache.org/docs/stable/fair_scheduler.html

不見global linitation設定蹤跡
後來請示了神人同事確定無此設定
那怎辦呢

其實還是有workaround(不過也有副作用)
那就是把scheduler吃的pool name改成MR的queue name
要enable此功能需要再mapred-site.xml設置:

<property>
<name>mapred.fairscheduler.poolnameproperty</name>
<value>mapred.job.queue.name</value>
</property>

接著只要在fair-scheduler.xml中設置pool的limitation即可
例如:

<pool name="default">
<minmaps>14</minMaps>
<minreduces>8</minReduces>
<maxmaps>25</maxMaps>
<maxreduces>12</maxReduces>
</pool>

即所有人最少有14mapper/8reducer, 最多25/12
如此一來所有沒有設定queue name的MR job(使用default queue)都會apply到
但是!!!
因為scheduler是吃queue name來做控管
在此設定下要區分priority的話
就必須設定另一組queue
mapred-site.xml:

<property>
<name>mapred.queue.names</name>
<value>default,production</value>
</property>

現在有兩組queue, default和production
要讓production有更高優先權的話需要在fair-scheduler.xml中設置:

<pool name="production">
<minmaps>100</minMaps>
<minreduces>50</minReduces>
</pool>

即最少保證mapper的fair share有100, reducer有50,沒有天花板限制(有多少拿多少)
要讓MR job submit到production queue中
需要設定queue name:

-D mapred.job.queue.name=hdfs (generic option)
setQueueName(String) (API)

但是但是!!!
還有一件事要做
每個MR job都可以設queue name為production呀
因此沒設定ACL的話也只是做一半四不像而已

在mapred-site.xml下設定ACL

<property>
<name>mapred.acls.enabled</name>
<value>true</value>
</property>
<property>

意思是讓group1和group2兩個群組的user可以submit job到production queue
這裡的group就是hadoop hdfs的group無誤
走到這一步
基本算是大功告成

如果你的hadoop cluster是用simple authentication的話...
我只能說你是白做了XDDD

2013年5月6日 星期一

screen網路斷線後再連入會hang住

這個問題困擾我好久
經請教強著同事 Jeff Hung
原因如下
因我每次連入都是用scree -rd
會把上一次連線踢掉再連進去
不過由於是網路斷線
上一個session還傻傻在等待回應
導致沒辦法detach

[RESOLVE]
使用screen -xRR
連入時不踢掉session而是同步使用

2013.5.11
改用xRR發現因為是連上共用session,所以resolution以原session為主
這就造成我這端畫面很醜的問題
再次請教J神,ctrl+F即可resize

2013年5月2日 星期四

Ganglia start failed on ambari after OS reboot

Restarted VMs and all ambari server/agent are started,

only ganglia service can not been bright up.

I think it may due to that I just power off the VM instead of stop services first.

[RESOLVE]
http://hortonworks.com/community/forums/topic/ganglia-not-working-on-hdp-1-2/

Kill the process {gmond,gmetad} and start it on web UI again.

The root cause of this issue is that ambari has its own wrapped gmond and gmetad.

The origin one will fight with ambari one.