SPARK-1156: allow user to login into a cluster without slaves
SPARK-1156: allow user to login into a cluster without slaves

Reported in https://spark-project.atlassian.net/browse/SPARK-1156

The current spark-ec2 script doesn't allow user to login to a cluster without slaves. One of the issues brought by this behaviour is that when all the worker died, the user cannot even login to the cluster for debugging, etc.

Author: CodingCat <zhunansjtu@gmail.com>

Closes #58 from CodingCat/SPARK-1156 and squashes the following commits:

104af07 [CodingCat] output ERROR to stderr
9a71769 [CodingCat] do not allow user to start 0-slave cluster
24a7c79 [CodingCat] allow user to login into a cluster without slaves

jrshust/spark,liyichao/spark,byakuinss/spark,kimoonkim/spark,Panos-Bletsos/spark-cost-model-optimizer,sureshthalamati/spark,publicRoman/spark,milliman/spark,shaneknapp/spark,sahilTakiar/spark,kevinyu98/spark,liutang123/spark,Aegeaner/spark,stanzhai/spark,liutang123/spark,saltstar/spark,darionyaphet/spark,shaneknapp/spark,kevinyu98/spark,map222/spark,goldmedal/spark,SnappyDataInc/spark,rednaxelafx/apache-spark,akopich/spark,techaddict/spark,shuangshuangwang/spark,byakuinss/spark,xflin/spark,jlopezmalla/spark,Panos-Bletsos/spark-cost-model-optimizer,alunarbeach/spark,lxsmnv/spark,jkbradley/spark,markhamstra/spark,nchammas/spark,jkbradley/spark,dbtsai/spark,hhbyyh/spark,michalsenkyr/spark,icexelloss/spark,witgo/spark,debugger87/spark,hhbyyh/spark,yanboliang/spark,SnappyDataInc/spark,goldmedal/spark,ibm-research-ireland/sparkoscope,cloud-fan/spark,andrewor14/spark,aosagie/spark,someorz/spark,markhamstra/spark,aosagie/spark,caneGuy/spark,bOOm-X/spark,mike0sv/spark,zzcclp/spark,dhruve/spark,holdenk/spark,ericvandenbergfb/spark,ddna1021/spark,wzhfy/spark,janewangfb/spark,patrick-nicholson/spark,cin/spark,tengpeng/spark,holdenk/spark,highfei2011/spark,patrick-nicholson/spark,UndeadBaneGitHub/spark,xflin/spark,darionyaphet/spark,sachintyagi22/spark,caneGuy/spark,poffuomo/spark,liutang123/spark,andrewor14/spark,joseph-torres/spark,SHASHANKB/spark,ahnqirage/spark,narahari92/spark,aosagie/spark,guoxiaolongzte/spark,panfengfeng/spark,dongjoon-hyun/spark,guoxiaolongzte/spark,wzhfy/spark,ConeyLiu/spark,nilsgrabbert/spark,esi-mineset/spark,sahilTakiar/spark,ConeyLiu/spark,aokolnychyi/spark,ron8hu/spark,aray/spark,ibm-research-ireland/sparkoscope,andrewor14/iolap,BryanCutler/spark,panfengfeng/spark,zero323/spark,zuotingbing/spark,xflin/spark,wangmiao1981/spark,rezasafi/spark,debugger87/spark,jiangxb1987/spark,stanzhai/spark,JerryLead/spark,ueshin/apache-spark,kevinyu98/spark,WeichenXu123/spark,tejasapatil/spark,ron8hu/spark,hvanhovell/spark,wangyum/spark,sahilTakiar/spark,cloud-fan/spark,goldmedal/spark,jrshust/spark,1haodian/spark,chuckchen/spark,xuanyuanking/spark,esi-mineset/spark,saltstar/spark,actuaryzhang/spark,bravo-zhang/spark,spark-test/spark,maropu/spark,bravo-zhang/spark,metamx/spark,kevinyu98/spark,patrick-nicholson/spark,bOOm-X/spark,jiangxb1987/spark,kevinyu98/spark,wangyum/spark,vinodkc/spark,spark-test/spark,adrian-ionescu/apache-spark,lvdongr/spark,MLnick/spark,pronix/spark,pgandhi999/spark,LantaoJin/spark,srowen/spark,highfei2011/spark,loneknightpy/spark,rednaxelafx/apache-spark,BryanCutler/spark,xuanyuanking/spark,mike0sv/spark,andrewor14/iolap,HyukjinKwon/spark,jrshust/spark,mahak/spark,srowen/spark,JoshRosen/spark,stanzhai/spark,ajaysaini725/spark,kissmetrics/spark,pronix/spark,rekhajoshm/spark,saturday-shi/spark,andrewor14/spark,saturday-shi/spark,metamx/spark,narahari92/spark,dongjoon-hyun/spark,aosagie/spark,szhem/spark,techaddict/spark,andrewor14/iolap,big-pegasus/spark,dongjoon-hyun/spark,ericvandenbergfb/spark,actuaryzhang/spark,panfengfeng/spark,kissmetrics/spark,kevinyu98/spark,liyichao/spark,mdespriee/spark,zero323/spark,ptkool/spark,kiszk/spark,saltstar/spark,zzcclp/spark,janewangfb/spark,xuanyuanking/spark,dhruve/spark,UndeadBaneGitHub/spark,wzhfy/spark,cloud-fan/spark,caneGuy/spark,vinodkc/spark,rikima/spark,kissmetrics/spark,shuangshuangwang/spark,highfei2011/spark,taroplus/spark,tejasapatil/spark,jkbradley/spark,kevinyu98/spark,hvanhovell/spark,nlalevee/spark,1haodian/spark,stanzhai/spark,stanzhai/spark,ericvandenbergfb/spark,jlopezmalla/spark,nilsgrabbert/spark,michalsenkyr/spark,zhouyejoe/spark,debugger87/spark,shubhamchopra/spark,ConeyLiu/spark,goldmedal/spark,big-pegasus/spark,narahari92/spark,publicRoman/spark,milliman/spark,yanboliang/spark,nchammas/spark,dhruve/spark,sureshthalamati/spark,actuaryzhang/spark,actuaryzhang/spark,UndeadBaneGitHub/spark,wangmiao1981/spark,ioana-delaney/spark,zhouyejoe/spark,ueshin/apache-spark,yanboliang/spark,LantaoJin/spark,kimoonkim/spark,taroplus/spark,akopich/spark,SHASHANKB/spark,dhruve/spark,ioana-delaney/spark,bdrillard/spark,lvdongr/spark,dhruve/spark,minixalpha/spark,dongjoon-hyun/spark,wangyum/spark,shubhamchopra/spark,rekhajoshm/spark,bravo-zhang/spark,nilsgrabbert/spark,shuangshuangwang/spark,shubhamchopra/spark,andrewor14/iolap,janewangfb/spark,holdenk/spark,lxsmnv/spark,nlalevee/spark,WeichenXu123/spark,maropu/spark,zuotingbing/spark,shubhamchopra/spark,gengliangwang/spark,alunarbeach/spark,milliman/spark,ptkool/spark,WeichenXu123/spark,milliman/spark,ahnqirage/spark,holdenk/spark,ericvandenbergfb/spark,kissmetrics/spark,poffuomo/spark,aray/spark,apache-spark-on-k8s/spark,mahak/spark,facaiy/spark,dongjoon-hyun/spark,kimoonkim/spark,srowen/spark,rikima/spark,ConeyLiu/spark,hhbyyh/spark,shubhamchopra/spark,guoxiaolongzte/spark,LantaoJin/spark,zhouyejoe/spark,sachintyagi22/spark,srowen/spark,sachintyagi22/spark,liutang123/spark,jiangxb1987/spark,saltstar/spark,ConeyLiu/spark,UndeadBaneGitHub/spark,janewangfb/spark,nchammas/spark,michalsenkyr/spark,tengpeng/spark,ibm-research-ireland/sparkoscope,cin/spark,alunarbeach/spark,alunarbeach/spark,aosagie/spark,mdespriee/spark,aokolnychyi/spark,cloud-fan/spark,map222/spark,huang1900/spark,nlalevee/spark,gioenn/xSpark,UndeadBaneGitHub/spark,goldmedal/spark,cloud-fan/spark,zero323/spark,haowu80s/spark,rezasafi/spark,skonto/spark,Aegeaner/spark,setjet/spark,zhouyejoe/spark,wangmiao1981/spark,someorz/spark,andrewor14/spark,goldmedal/spark,maropu/spark,aray/spark,szhem/spark,kiszk/spark,ericvandenbergfb/spark,zuotingbing/spark,facaiy/spark,jianran/spark,andrewor14/iolap,hhbyyh/spark,1haodian/spark,ConeyLiu/spark,akopich/spark,gengliangwang/spark,bravo-zhang/spark,janewangfb/spark,markhamstra/spark,jlopezmalla/spark,hvanhovell/spark,ioana-delaney/spark,facaiy/spark,mzl9039/spark,liyichao/spark,mzl9039/spark,mdespriee/spark,WeichenXu123/spark,wangyum/spark,sachintyagi22/spark,lvdongr/spark,nilsgrabbert/spark,mahak/spark,darionyaphet/spark,jkbradley/spark,loneknightpy/spark,zero323/spark,rednaxelafx/apache-spark,apache/spark,pgandhi999/spark,kissmetrics/spark,ron8hu/spark,dongjoon-hyun/spark,hvanhovell/spark,Aegeaner/spark,chuckchen/spark,JoshRosen/spark,JerryLead/spark,JerryLead/spark,HyukjinKwon/spark,JoshRosen/spark,bravo-zhang/spark,panfengfeng/spark,setjet/spark,UndeadBaneGitHub/spark,ahnqirage/spark,bOOm-X/spark,liutang123/spark,bdrillard/spark,markhamstra/spark,ptkool/spark,ajaysaini725/spark,publicRoman/spark,janewangfb/spark,metamx/spark,ioana-delaney/spark,highfei2011/spark,zero323/spark,lxsmnv/spark,witgo/spark,shubhamchopra/spark,panfengfeng/spark,cin/spark,xuanyuanking/spark,patrick-nicholson/spark,taroplus/spark,SnappyDataInc/spark,mahak/spark,akopich/spark,milliman/spark,jiangxb1987/spark,panfengfeng/spark,mike0sv/spark,publicRoman/spark,byakuinss/spark,joseph-torres/spark,sureshthalamati/spark,MLnick/spark,minixalpha/spark,rezasafi/spark,pgandhi999/spark,maropu/spark,holdenk/spark,aokolnychyi/spark,apache-spark-on-k8s/spark,pronix/spark,facaiy/spark,kissmetrics/spark,saturday-shi/spark,skonto/spark,shaneknapp/spark,zzcclp/spark,gengliangwang/spark,jkbradley/spark,ueshin/apache-spark,srowen/spark,gioenn/xSpark,xflin/spark,WindCanDie/spark,taroplus/spark,sachintyagi22/spark,guoxiaolongzte/spark,someorz/spark,brad-kaiser/spark,huang1900/spark,LantaoJin/spark,stanzhai/spark,ron8hu/spark,poffuomo/spark,loneknightpy/spark,JerryLead/spark,shaneknapp/spark,aokolnychyi/spark,bOOm-X/spark,vinodkc/spark,ahnqirage/spark,ptkool/spark,ptkool/spark,mike0sv/spark,caneGuy/spark,jianran/spark,darionyaphet/spark,adrian-ionescu/apache-spark,mike0sv/spark,ron8hu/spark,pronix/spark,pgandhi999/spark,jrshust/spark,adrian-ionescu/apache-spark,ueshin/apache-spark,lxsmnv/spark,ron8hu/spark,lvdongr/spark,brad-kaiser/spark,kiszk/spark,hhbyyh/spark,witgo/spark,sahilTakiar/spark,szhem/spark,BryanCutler/spark,panfengfeng/spark,witgo/spark,jrshust/spark,markhamstra/spark,saturday-shi/spark,rednaxelafx/apache-spark,WindCanDie/spark,shaneknapp/spark,liutang123/spark,HyukjinKwon/spark,jlopezmalla/spark,tejasapatil/spark,narahari92/spark,gengliangwang/spark,LantaoJin/spark,maropu/spark,dongjoon-hyun/spark,haowu80s/spark,facaiy/spark,lxsmnv/spark,apache-spark-on-k8s/spark,zzcclp/spark,pronix/spark,Panos-Bletsos/spark-cost-model-optimizer,WeichenXu123/spark,techaddict/spark,rikima/spark,rikima/spark,wzhfy/spark,rezasafi/spark,WeichenXu123/spark,dbtsai/spark,chuckchen/spark,kiszk/spark,mahak/spark,spark-test/spark,techaddict/spark,ibm-research-ireland/sparkoscope,ddna1021/spark,map222/spark,SHASHANKB/spark,cin/spark,bdrillard/spark,minixalpha/spark,kiszk/spark,witgo/spark,JoshRosen/spark,aray/spark,metamx/spark,mahak/spark,SHASHANKB/spark,wzhfy/spark,haowu80s/spark,rikima/spark,rekhajoshm/spark,spark-test/spark,ueshin/apache-spark,eyalfa/spark,ibm-research-ireland/sparkoscope,huang1900/spark,yanboliang/spark,icexelloss/spark,rednaxelafx/apache-spark,JoshRosen/spark,kiszk/spark,minixalpha/spark,taroplus/spark,Panos-Bletsos/spark-cost-model-optimizer,nilsgrabbert/spark,dbtsai/spark,Panos-Bletsos/spark-cost-model-optimizer,guoxiaolongzte/spark,gioenn/xSpark,tengpeng/spark,Aegeaner/spark,brad-kaiser/spark,sureshthalamati/spark,nilsgrabbert/spark,dbtsai/spark,aray/spark,jiangxb1987/spark,cin/spark,janewangfb/spark,apache/spark,ptkool/spark,ericvandenbergfb/spark,loneknightpy/spark,shubhamchopra/spark,zero323/spark,mdespriee/spark,eyalfa/spark,aokolnychyi/spark,ajaysaini725/spark,zero323/spark,nlalevee/spark,rikima/spark,markhamstra/spark,sachintyagi22/spark,szhem/spark,apache/spark,highfei2011/spark,joseph-torres/spark,ddna1021/spark,stanzhai/spark,WindCanDie/spark,ericvandenbergfb/spark,alunarbeach/spark,markhamstra/spark,techaddict/spark,debugger87/spark,narahari92/spark,rednaxelafx/apache-spark,ahnqirage/spark,akopich/spark,sureshthalamati/spark,bdrillard/spark,vinodkc/spark,dbtsai/spark,xflin/spark,tejasapatil/spark,bOOm-X/spark,jkbradley/spark,zhouyejoe/spark,pgandhi999/spark,dbtsai/spark,wangmiao1981/spark,tejasapatil/spark,techaddict/spark,xuanyuanking/spark,JerryLead/spark,huang1900/spark,Aegeaner/spark,big-pegasus/spark,dhruve/spark,wangyum/spark,map222/spark,esi-mineset/spark,witgo/spark,wzhfy/spark,jlopezmalla/spark,WeichenXu123/spark,zzcclp/spark,michalsenkyr/spark,alunarbeach/spark,zuotingbing/spark,icexelloss/spark,Aegeaner/spark,pgandhi999/spark,sahilTakiar/spark,nchammas/spark,liyichao/spark,WindCanDie/spark,nchammas/spark,patrick-nicholson/spark,narahari92/spark,someorz/spark,jianran/spark,andrewor14/iolap,michalsenkyr/spark,nlalevee/spark,ajaysaini725/spark,icexelloss/spark,darionyaphet/spark,mdespriee/spark,mdespriee/spark,xflin/spark,huang1900/spark,sureshthalamati/spark,Panos-Bletsos/spark-cost-model-optimizer,big-pegasus/spark,milliman/spark,MLnick/spark,akopich/spark,ahnqirage/spark,vinodkc/spark,actuaryzhang/spark,dbtsai/spark,LantaoJin/spark,kiszk/spark,darionyaphet/spark,SHASHANKB/spark,kimoonkim/spark,michalsenkyr/spark,ueshin/apache-spark,jlopezmalla/spark,mzl9039/spark,aosagie/spark,saturday-shi/spark,lxsmnv/spark,big-pegasus/spark,liyichao/spark,JoshRosen/spark,facaiy/spark,liyichao/spark,wangmiao1981/spark,HyukjinKwon/spark,szhem/spark,aray/spark,saturday-shi/spark,aokolnychyi/spark,hvanhovell/spark,minixalpha/spark,skonto/spark,xflin/spark,metamx/spark,adrian-ionescu/apache-spark,rekhajoshm/spark,publicRoman/spark,apache/spark,liutang123/spark,sahilTakiar/spark,srowen/spark,adrian-ionescu/apache-spark,tejasapatil/spark,esi-mineset/spark,big-pegasus/spark,yanboliang/spark,WindCanDie/spark,eyalfa/spark,taroplus/spark,apache/spark,ajaysaini725/spark,Panos-Bletsos/spark-cost-model-optimizer,tengpeng/spark,poffuomo/spark,skonto/spark,MLnick/spark,caneGuy/spark,shaneknapp/spark,mike0sv/spark,taroplus/spark,jrshust/spark,SnappyDataInc/spark,BryanCutler/spark,aray/spark,debugger87/spark,sahilTakiar/spark,rikima/spark,rekhajoshm/spark,esi-mineset/spark,mzl9039/spark,rekhajoshm/spark,ConeyLiu/spark,skonto/spark,maropu/spark,loneknightpy/spark,zuotingbing/spark,ahnqirage/spark,bOOm-X/spark,ajaysaini725/spark,highfei2011/spark,1haodian/spark,mzl9039/spark,ajaysaini725/spark,loneknightpy/spark,milliman/spark,jianran/spark,someorz/spark,jiangxb1987/spark,ron8hu/spark,poffuomo/spark,ueshin/apache-spark,gengliangwang/spark,zuotingbing/spark,brad-kaiser/spark,metamx/spark,metamx/spark,spark-test/spark,xuanyuanking/spark,map222/spark,cloud-fan/spark,saltstar/spark,debugger87/spark,HyukjinKwon/spark,brad-kaiser/spark,skonto/spark,1haodian/spark,caneGuy/spark,BryanCutler/spark,brad-kaiser/spark,jianran/spark,lvdongr/spark,wangyum/spark,UndeadBaneGitHub/spark,apache/spark,shuangshuangwang/spark,byakuinss/spark,ddna1021/spark,HyukjinKwon/spark,highfei2011/spark,debugger87/spark,gioenn/xSpark,ddna1021/spark,apache-spark-on-k8s/spark,esi-mineset/spark,setjet/spark,eyalfa/spark,michalsenkyr/spark,wangmiao1981/spark,rezasafi/spark,szhem/spark,zzcclp/spark,tejasapatil/spark,skonto/spark,eyalfa/spark,dhruve/spark,hvanhovell/spark,joseph-torres/spark,pgandhi999/spark,gioenn/xSpark,andrewor14/iolap,adrian-ionescu/apache-spark,chuckchen/spark,apache-spark-on-k8s/spark,alunarbeach/spark,BryanCutler/spark,ioana-delaney/spark,joseph-torres/spark,shuangshuangwang/spark,apache/spark,hhbyyh/spark,SnappyDataInc/spark,lvdongr/spark,MLnick/spark,tengpeng/spark,matthewfranglen/spark,sureshthalamati/spark,spark-test/spark,publicRoman/spark,kissmetrics/spark,kimoonkim/spark,bdrillard/spark,saltstar/spark,akopich/spark,icexelloss/spark,shuangshuangwang/spark,gengliangwang/spark,MLnick/spark,eyalfa/spark,tengpeng/spark,gioenn/xSpark,hvanhovell/spark,holdenk/spark,haowu80s/spark,patrick-nicholson/spark,jianran/spark,mzl9039/spark,joseph-torres/spark,mahak/spark,ibm-research-ireland/sparkoscope,facaiy/spark,JoshRosen/spark,zzcclp/spark,goldmedal/spark,apache-spark-on-k8s/spark,byakuinss/spark,SnappyDataInc/spark,mike0sv/spark,loneknightpy/spark,jlopezmalla/spark,tengpeng/spark,setjet/spark,szhem/spark,SHASHANKB/spark,guoxiaolongzte/spark,jkbradley/spark,ibm-research-ireland/sparkoscope,nilsgrabbert/spark,yanboliang/spark,zhouyejoe/spark,nlalevee/spark,map222/spark,andrewor14/spark,bdrillard/spark,WindCanDie/spark,JerryLead/spark,andrewor14/spark,MLnick/spark,byakuinss/spark,SHASHANKB/spark,sachintyagi22/spark,saltstar/spark,cloud-fan/spark,zuotingbing/spark,setjet/spark,xuanyuanking/spark,poffuomo/spark,chuckchen/spark,yanboliang/spark,BryanCutler/spark,kimoonkim/spark,haowu80s/spark,chuckchen/spark,rezasafi/spark,bravo-zhang/spark,bOOm-X/spark,rednaxelafx/apache-spark,brad-kaiser/spark,kimoonkim/spark,someorz/spark,ioana-delaney/spark,cin/spark,techaddict/spark,ioana-delaney/spark,rezasafi/spark,witgo/spark,aosagie/spark,shaneknapp/spark,narahari92/spark,rekhajoshm/spark,wangyum/spark,srowen/spark,andrewor14/spark,aokolnychyi/spark,1haodian/spark,saturday-shi/spark,ddna1021/spark,huang1900/spark,spark-test/spark,vinodkc/spark,minixalpha/spark,nchammas/spark,publicRoman/spark,jiangxb1987/spark,maropu/spark,poffuomo/spark,LantaoJin/spark,patrick-nicholson/spark,someorz/spark,bravo-zhang/spark,vinodkc/spark,pronix/spark,joseph-torres/spark,actuaryzhang/spark,SnappyDataInc/spark,actuaryzhang/spark,nchammas/spark,HyukjinKwon/spark,1haodian/spark,darionyaphet/spark,cin/spark,minixalpha/spark,guoxiaolongzte/spark,hhbyyh/spark,adrian-ionescu/apache-spark,mdespriee/spark,setjet/spark,byakuinss/spark,map222/spark,zhouyejoe/spark,huang1900/spark,bdrillard/spark,esi-mineset/spark,JerryLead/spark,icexelloss/spark,jianran/spark,setjet/spark,lxsmnv/spark,apache-spark-on-k8s/spark,wangmiao1981/spark,holdenk/spark,caneGuy/spark,eyalfa/spark,wzhfy/spark,lvdongr/spark,ptkool/spark,jrshust/spark,ddna1021/spark,big-pegasus/spark,haowu80s/spark,Aegeaner/spark,icexelloss/spark,liyichao/spark,shuangshuangwang/spark,gioenn/xSpark,gengliangwang/spark,WindCanDie/spark,chuckchen/spark,nlalevee/spark,mzl9039/spark