使用Docker完成编译(推荐)

下载Docker镜像

Pegasus将编译环境封装至Docker镜像中,你可以直接基于此环境编译代码。

docker pull apachepegasus/build-env:centos7

如果希望基于正式发布的稳定版本(如 2.1.0)进行编译,你可以下载:

docker pull apachepegasus/build-env:2.1.0-centos7

编译

请先参考下载文档获取源码到某目录(/your/local/apache-pegasus-source)下。随后运行以下命令:

docker run -v /your/local/apache-pegasus-source:/root/pegasus \
           apachepegasus/build-env:2.1.0-centos7 \
           /bin/bash -c "./run.sh build -c"

编译的结果会被放在项目根目录的DSN_ROOT/文件夹下,其中包含bin、include、lib目录。

编译打包

打包server端程序包,用于服务部署:

docker run -v /your/local/apache-pegasus-source:/root/pegasus \
           apachepegasus/build-env:2.1.0-centos7 \
           /bin/bash -c "./run.sh pack_server"

打包client端库,用于C/C++端客户端开发:

docker run -v /your/local/apache-pegasus-source:/root/pegasus \
           apachepegasus/build-env:2.1.0-centos7 \
           /bin/bash -c "./run.sh pack_client"

打包tools工具集,里面包含了各种工具(shell、bench):

docker run -v /your/local/apache-pegasus-source:/root/pegasus \
           apachepegasus/build-env:2.1.0-centos7 \
           /bin/bash -c "./run.sh pack_tools"

编译成功后,推荐先体验onebox集群

Apache Incubator
Copyright © 2020 The Apache Software Foundation. Licensed under the Apache License, Version 2.0.

Apache Pegasus is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.