作者簡介:董必勝(叔大),阿裡巴巴配置管理專家,負責集團、螞蟻的移動端建構,負責研發協同平台rdc無線。
背景:在移動物聯網大潮中ios建構的重要性日益突出,如何能提供穩定的ios建構服務?中大型的企業如何搭建、管理這種非标準的ios建構叢集?如何能做到叢集搭建的成本最優?本文以alibaba集團的場景和大家分享ios建構叢集搭建的方案選型。
我們都知道ios的建構需要在macos sierra的系統上建構。針對我們建構叢集的搭建有幾種思路:
直接采購mac mini、mac pro用于建構;
在linux虛機裡安裝macos sierra(應用層);
在pc、linux等裸機上安裝macos sierra(系統層)。
一、 系統層虛拟化方案
這種機器在業界有個說法叫黑蘋果,最著名的黑蘋果論壇:https://www.tonymacx86.com/ 。詳細裝機文檔:https://www.tonymacx86.com/threads/unibeast-install-macos-sierra-on-any-supported-intel-based-pc.200564/。
從文檔可以看出:
裝機過程比較複雜;
常見做法是在pc上直接裝,pc機運維成本比較高;
無法做到自動化。
1)最新版本6.5.0版本在mac pro安裝失敗,achi無法識别;
2)6.0.0patch2版本在mac pro安裝成功一次,但安裝後,通路虛拟機管理頁面有錯誤。測試重新開機伺服器,虛拟機自動重新開機不生效。部分文章回報,磁盤讀取部分虛拟化有問題,讀寫效率低,目前未驗證;
3)在惠普微伺服器gen8上安裝6.0.0版本,雖然6.0.0标記僅支援macos10.10,但可以更新到macos10.12.4;
4)燒制6.5.0exsi後安裝後,即使傳回安裝6.0.0patch2,exsi安裝後,能正常讀取ip,但網絡通路有問題,并且無法進入exsi系統的指令行模式;
5)借用lenovo t4500,因網卡不識别,無法安裝exsi,可見exsi相容範圍有限。
裝機過程比較複雜
常見做法是在pc上直接裝,pc機運維成本比較高
無法做到自動化

另外上述方案最大的優點在成本低。但是還有兩個通用緻命的問題:
根據macosx的使用協定, macosx 隻能用在apple-labeled computer,是以在部分企業基本不能使用非mac的機器用來做ios建構
<code>2. permitted license uses and restrictions. a. this license allows you to install and use one copy of the apple software on a single apple-labeled computer at a time. this license does not allow the apple software to exist on more than one computer at a time,and you may not make the apple software available over a network where it could be used by multiple computers at the same time. you may make one copy of the apple software (excluding the boot rom code) in machine-readable form for backup purposes only; provided that the backup copy must include all copyright or other proprietary notices contained on the original.</code>
從黑蘋果使用者了解到,在黑蘋果機器上建構的app無法通過app store稽核。也就是說你即使打出app也沒發走官方管道,隻用用于framework建構或者一些越獄管道。
這種方式裝機的問題不存在,但是也存在一些問題
成本相比較下偏高,這個問題是相對的mac mini也才幾k
運維也是非标的,運維标準化包括:
idc的标準化,像bat這種會自己搭建了符合idc規範的機房
裝機的标準化,已有的os更新安裝等都可以實作指令行自動化
監控的标準化:mac機器已經接入到服務端監控平台
mac mini、mac pro的運維标準化已經在路上了
黑蘋果的包有法務、app store上傳的問題,這條路在部分大企業是走不通的
掃碼免費體驗研發協同rdc