Code Monkey home page Code Monkey logo

pact-broker-saas's Introduction

Pact Broker SaaS

Pact Broker SaaS是一个支持多租户的Pact契约文件中间件服务。

特性

多租户

通过容器隔离实现物理多租。通过docker-compose为每个租户拉起PactBroker和所依赖的postgresql数据库服务,每个租户的服务通过端口进行区分。

运维操作

新增租户

新增租户选择端口号时应避免与已有端口号冲突,可以通过docker ps | grep pact_broker命令来查看已占用的端口号。

新增租户运行命令

./deploy.sh <tenant_name> <tenant_port>

例如,新租户名为tenant,为其在12999端口上提供服务,则运行以下命令:

./deploy.sh tenant 12999

即可创建出对应的pact_broker容器与pact_db容器,通过12999端口访问服务。

停止租户容器运行

停止租户容器(包括pact_broker与pact_db两个容器),运行命令:

./stop.sh <tenant_name>

例如,停止租户tenant的容器,则运行以下命令:

./stop.sh tenant

删除租户容器和数据卷

删除已停止运行的租户容器(包括pact_broker与pact_db两个容器),并删除数据卷,运行命令:

./remove.sh <tenant_name>

例如,删除租户tenant的容器及数据卷,则运行以下命令:

./remove.sh tenant

备份租户数据

将租户数据备份到当前文件夹下的<tenant_name>-data.tar文件中,运行命令:

./backup.sh <tenant_name>

例如,要备份租户tenant的数据,则运行以下命令:

./backup.sh tenant

租户的数据库数据会被备份到当前文件夹下的tenant-data.tar文件中。

恢复租户数据

首先在当前目录下准备数据源文件,文件名必须是<tenant_name>-data.tar形式,运行命令:

./restore.sh <tenant_name>

例如,要恢复租户tenant的数据,则运行以下命令:

./restore.sh tenant

就会从当前文件夹下的tenant-data.tar文件中恢复租户数据,并且重启postgresql容器(由于postgresql本身的机制,必须重启容器才能读取到被恢复的数据)。

pact-broker-saas's People

Contributors

tongzh avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.