本篇文章主要講如何在本地搭建appscale環境。
由于國內的信息資源有限,很多重要的論壇被墻了,所以遇到不少麻煩,由于最近一段時間vpn也被封掉了,我只能通過特殊渠道方法來翻墻查閱資料,走了不少彎路。
1.先說系統和環境吧:
root@ubuntu:/usr/lib/ssl# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
root@ubuntu:/usr/lib/ssl# python -V
Python 2.7.6
2. 下載appscale安裝包:
wget -O – http://bootstrap.appscale.com | sh
apt-get install -y git-core
echo "start appscal ..."
cd ~ && git clone https://github.com/AppScale/appscale.git && cd appscale/debian && bash -x appscale_build.sh
echo "start appscale-tools ..."
cd ~ && git clone https://github.com/AppScale/appscale-tools.git && cd appscale-tools/debian && bash -x appscale_build.sh
echo "start appscale service ..."
cd ~ && appscale init cluster
開始編輯~目錄下的Appscalefile文件,修改
root@appscale-image0:~# cat ~/AppScalefile
---
# The deployment strategy (roles -> machines) that should be used in this
# AppScale deployment.
# The following is a sample layout for running everything on one machine:
ips_layout :master : 192.168.1.143appengine : 192.168.1.143database : 192.168.1.143zookeeper : 192.168.1.143# Alternatively, the following is a layout that separates everything onto
# four machines:
# ips_layout :
# master : 192.168.1.2
# appengine : 192.168.1.3
# database : 192.168.1.4
# zookeeper : 192.168.1.5# The previous two layouts only have one instance of each role running, so if
# that machine fails, there is no backup to take its place. This layout uses
# eight machines to provide failure resiliency:
# ips_layout:
# master : 192.168.1.2
# appengine:
# - 192.168.1.3
# - 192.168.1.4
# database:
# - 192.168.1.5
# - 192.168.1.6
# zookeeper: # zookeeper uses paxos, so it needs a majority up (hence 3)
# - 192.168.1.7
# - 192.168.1.8
# - 192.168.1.9# The search API is optional, and can be added with the "search" role.
修改成當前本機的ip地址,或者你想安裝在哪個服務器的ip地址(前提是你得有這個服務器的訪問權限)。
最后一步是啟動了,也就是在~目錄下執行appscale up
注意:還是要緊盯著bash -x appscale_build.sh這兩個安裝appscle和appscle-tools的操作,中間可能因為中國大陸的網絡問題導致下載部分包失敗或者超時的情況,所以如果中間失敗了建議重新執行腳本安裝,我就是在第一步安裝appscle的時候失敗了四五次,最后切換了代理才成功安裝,如果appscle-tools安裝很慢,主要是因為python官網上下載文件很慢,可以參考我的文章來修改鏡像下載源 提高下載速度:
?http://blog.csdn.net/pbymw8iwm/article/details/77773723
?
最后一步執行appscale up的時候需要輸入root密碼,然后輸入郵箱和密碼,這個郵箱和密碼就是后來你訪問appscle主頁需要登錄的賬戶名和密碼。最后一步可能需要4-10分鐘不等,最后會輸出你的appscle web頁面地址: