zstack 搭建部署
[问题] FreeBSD11 中 ZStack 源码编译过程
[解答] 参考:http://zstack.org/cn_blog/build-zstack.html
zstack 的commit id: 55f182cf11fe4c14ec43098f330a6b396e19b9fa
下载下面四个仓库的代码,需要放到同一个目录,我是放放在/usr/home/harvis/Opensource/目录里面的
zstack
zstack-dashboard
zstack-utility
zstack-vyos
cd /usr/home/harvis/Opensource/
git clone https://github.com/zstackio/zstack
git clone https://github.com/zstackio/zstack-dashboard
git clone https://github.com/zstackio/zstack-utility
git clone https://github.com/zstackio/zstack-vyos
开始编译了,首先安装需要的依赖软件包,zstack依赖maven,mariadb,rabbitmq, golang 这几大件,
比较繁琐的是maven里面的依赖库,网速慢,耐着点性子。
先编译zstack
cd zstack/
mvn -DskipTests clean install
再编译zstack all in one安装包
编译之前先配置一些 go 的两个环境变量
$ export GOROOT="/usr/local/go"
$ export GOPATH="/home/harvis/go"
cd zstack-utility/zstackbuild
ant -Dzstack_build_root=/usr/home/harvis/Opensource all-in-one
编译出来的all-in-one bin格式的文件,/usr/home/harvis/Opensource/zstack-utility/zstackbuild/target/zstack-installer-1.11.0.bin
有点遗憾,FreeBSD中all-in-one安装包不能用,因为它是为Centos6/7/Ubuntu14.04定制的,我是参照CentOS7,手工部署的,能跑起来UI。
但是没法跑zstack simulator, 在创建VmInstance的步骤出错。
[问题] CentOS7 中 zstack start/stop service step by step
[解答] 手动启动的流程如下
[harvis@centos7 ~]$ sudo service httpd start
[harvis@centos7 ~]$ sudo service rabbitmq-server start
[harvis@centos7 ~]$ sudo service mariadb start
[harvis@centos7 ~]$ sudo /etc/init.d/zstack-consoleproxy start
[harvis@centos7 ~]$ sudo /etc/init.d/zstack-server start
手工停止服务的流程如下
[harvis@centos7 ~]$ sudo /etc/init.d/zstack-server stop
[harvis@centos7 ~]$ sudo /etc/init.d/zstack-consoleproxy stop
[harvis@centos7 ~]$ sudo service mariadb stop
[harvis@centos7 ~]$ sudo service rabbitmq-server stop
[harvis@centos7 ~]$ sudo service httpd stop
[问题] freebsd 中 zstack start/stop service step by step
[解答] 手动启动的流程如下
# start mysql
sudo /usr/local/etc/rc.d/mysql-server onestart
sleep 2
# start rabbitmq
sudo /usr/local/etc/rc.d/rabbitmq onestart
sleep 2
# start apache24(httpd)
sudo /usr/local/etc/rc.d/apache24 onestart
sleep 2
# start console proxy agent
. /usr/local/zstack/virtualenv/consoleproxy/bin/activate && python -c "from consoleproxy import cdaemon; cdaemon.main()" start
sleep 2
# start zstack managemen node and dashboard
sudo zstack-ctl start
手工停止zstack服务的流程如下
# stop zstack management node and dashboard
sudo zstack-ctl stop
# stop console proxy agent
. /usr/local/zstack/virtualenv/consoleproxy/bin/activate && python -c "from consoleproxy import cdaemon; cdaemon.main()" stop
# stop apache24(httpd)
sudo /usr/local/etc/rc.d/apache24 onestop
# start rabbitmq
sudo /usr/local/etc/rc.d/rabbitmq onestop
# stop mysql
sudo /usr/local/etc/rc.d/mysql-server onestop
mvn -DskipTests clean install