本篇文章主要讲如何在本地搭建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.143
appengine : 192.168.1.143
database : 192.168.1.143
zookeeper : 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官网上下载文件很慢,可以参考我的文章来修改镜像下载源 提高下载速度:


 

最后一步执行appscale up的时候需要输入root密码,然后输入邮箱和密码,这个邮箱和密码就是后来你访问appscle主页需要登录的账户名和密码。最后一步可能需要4-10分钟不等,最后会输出你的appscle web页面地址:

如何在Appscale下发布自己的应用(一)_ubuntu