10 Star 37 Fork 22

openEuler / ha-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.md 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
yangzhao_kl 提交于 2021-03-02 09:45 . update release branch in document

从源码构建

该文档描述如何从源码构建ha-api管理平台项目后端服务。

编译

构建需求

Ha-api项目后端服务编译需要在主机上安装以下包:

  • go >= 1.13
  • git
  • pam-devel
  • tar

构建

首先获取项目源码:

git clone https://gitee.com/openeuler/ha-api.git
cd ha-api/
git checkout -b release-v1.0 origin/release-v1.0

运行go build来构建项目

go build

该命令会生成ha-api(windows系统为ha-api.exe)可执行文件。

安装及使用

在使用ha-api后端服务之前,你需要安装HA软件。 查看ha_install文档获取更多信息。

tools目录下,提供了安装脚本,用于构建ha-api可执行文件并将其与相关脚本安装到系统当中。安装完成后,通过systemd启动服务:

systemctl start ha-api

run_ha-api

现在你可以通过REST API接口在默认的8080端口来管理你的集群。你可以使用curl命令来访问。

curl -s http://localhost:8080//api/v1/haclusters/1`

hacluster_api_example

1
https://gitee.com/openeuler/ha-api.git
git@gitee.com:openeuler/ha-api.git
openeuler
ha-api
ha-api
master

搜索帮助