ZStack源码编译

B3ale · · 670 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

! https://zhuanlan.zhihu.com/p/338679138

ZStack 源码编译

更新 yum 源以及安装相关依赖:

$ curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
$ yum clean all
$ yum makecache
$ yum install -y vim tmux wget curl maven ant mariadb-server git zip unzip patch python-setuptools

下载 ZStack 以及相关安装包:

$ git clone https://github.com/zstackio/zstack.git -b 3.10.2
$ git clone https://github.com/zstackio/zstack-utility.git -b 3.10.2
$ git clone https://github.com/zstackio/zstack-dashboard.git -b 3.10.2
$ git clone https://github.com/zstackio/zstack-vyos.git -b 3.8.3

下载相应的 Tomcat 压缩包:

$ wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.55/bin/apache-tomcat-8.5.55.zip

安装 Golang 并设置环境变量:

$ wget https://mirrors.nju.edu.cn/golang/go1.10.8.linux-amd64.tar.gz
$ tar -C /usr/local -xvzf go1.10.8.linux-amd64.tar.gz
$ vim ~/.bashrc
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

安装数据库:

$ cd zstack && ./conf/db/deploydb.sh

进入 zstack-utility,并打上以下 patch:

diff --git a/zstackbuild/build.properties b/zstackbuild/build.properties
index 35d8259..3610877 100644
--- a/zstackbuild/build.properties
+++ b/zstackbuild/build.properties
@@ -18,11 +18,11 @@ zstack.build_version=${build_version}
 zstackutility.source=${zstack_build_root}/zstack-utility
 zstackutility.build_version=${build_version}

-apachetomcat.pkg=${zstack_build_root}/apache-tomcat-8.5.57.zip
+apachetomcat.pkg=${zstack_build_root}/apache-tomcat-8.5.55.zip

 # For UI 1.x
 zstackdashboard.source=${zstack_build_root}/zstack-dashboard
-mevocoui.source=${zstack_build_root}/mevoco-ui
+#mevocoui.source=${zstack_build_root}/mevoco-ui
 zstackdashboard.build_version=${build_version}
 #zstackdashboard.source=${zstack_build_root}/zstack-ui
 #zstackdashboard.build_version=master
@@ -129,6 +129,6 @@ zstack.ui.source=${zstack_build_root}/zstack-ui
 build.zstack.ui.war.script=${zstackbuild.scripts}/build_zstack_ui_war.sh
 mevocoui2.build_version=${build_version}
 mevocouiserver.build_version=${build_version}
-build.zstack.ui.war=true
+build.zstack.ui.war=false
 vendor.name=
 vendor.custom.path=
diff --git a/zstackbuild/build.xml b/zstackbuild/build.xml
index a4b9629..05b0d39 100644
--- a/zstackbuild/build.xml
+++ b/zstackbuild/build.xml
@@ -291,15 +291,6 @@
             <sequential>
                 <antcall target="build-zstack-vyos"/>
             </sequential>
-            <sequential>
-                <antcall target="build-zstack-network"/>
-            </sequential>
-            <sequential>
-                <antcall target="build-zstack-sharedblock"/>
-            </sequential>
-            <sequential>
-                <antcall target="check-zstack-distro"/>
-            </sequential>
         </parallel>
     </target>

@@ -383,12 +374,6 @@
                 <antcall target="assemble-zstack-vyos"/>
             </sequential>
             <sequential>
-                <antcall target="assemble-zstack-network"/>
-            </sequential>
-            <sequential>
-                <antcall target="assemble-zstack-sharedblock"/>
-            </sequential>
-            <sequential>
                 <antcall target="assemble-zstack-promtail"/>
             </sequential>
             <sequential>

更换 maven 镜像:

  <mirrors>
    <mirror>
      <id>aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>Aliyun Mirror</name>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
  </mirrors>

编译安装 zstack:

$ cd zstack && mvn -DskipTests clean install

编译安装 zstack-utility:

$ cd zstack-utility/zstackbuild
$ ant -Dzstack_build_root=$ZSTACK_HOME all-in-one

2020.12.22 by B3ale


有疑问加站长微信联系(非本文作者)

本文来自:简书

感谢作者:B3ale

查看原文:ZStack源码编译

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

670 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传