Skip to main content

Separate Habitat Builder's backend services onto separate nodes

Chef Habitat On-Prem Builder uses MinIO to store Habitat artifact (.hart) files and PostgreSQL to store package and user metadata.

You can configure Habitat Builder to run the backend components—MinIO and PostgreSQL—on separate nodes.

Configure node ports

Because Habitat Builder services need to communicate across your network between the frontend and backend nodes, you need to open the following ports to these nodes to ensure your Habitat On-Prem Builder works correctly:

  • TCP 9638 - Habitat configuration gossip
  • UDP 9638 - Habitat configuration gossip
  • TCP 9636 - Builder API HTTP
  • TCP 5432 - PostgreSQL
  • TCP 9000 - MinIO
  • TCP 11211 - Memcached

Deploy MinIO on a separate node

Habitat Builder is configured using the bldr.env file, which contains all the information you need to set up MinIO and PostgreSQL. Follow these steps to configure the bldr.env file:

  1. If you don’t already have it on your node, clone the habitat-sh/on-prem-builder repository or download and extract one of the on-prem-builder releases.

  2. If your node previously ran Habitat On-Prem Builder components, run the uninstall.sh script to clean up your environment:

    ./uninstall.sh
    
  3. Copy the bldr.env.sample file and save it as bldr.env:

    cp bldr.env.sample bldr.env
    
  4. Edit the bldr.env file with these settings:

    1. Set S3_ENABLED and ARTIFACTORY_ENABLED to false.

      You can’t use the MinIO server if you’re using S3 or Artifactory directly.

    2. List all frontend and backend nodes running Habitat Builder services using HAB_BLDR_PEER_ARG and the --peer option using the following format:

      HAB_BLDR_PEER_ARG="--peer <HOST> --peer <HOST> --peer <HOST>"
      

      Replace <HOST> with a node IP address or hostname.

  5. Install MinIO by running the install script:

    ./install.sh --install-minio
    
  6. Now that your Minio server is up and running on its own node, connect your frontend Habitat Builder nodes to the MinIO node.

    On your frontend nodes, set the MINIO_ENDPOINT in the bldr.env file to the node where the MinIO server is running.

Deploy PostgreSQL on a separate node

Habitat Builder is configured using the bldr.env file, which contains all the information you need to set up MinIO and PostgreSQL. Follow these steps to configure the bldr.env file:

  1. If you don’t already have it on your node, clone the habitat-sh/on-prem-builder repository or download and extract one of the on-prem-builder releases.

  2. If your node previously ran Habitat On-Prem Builder components, run the uninstall.sh script to clean up your environment:

    ./uninstall.sh
    
  3. Copy the bldr.env.sample file and save it as bldr.env:

    cp bldr.env.sample bldr.env
    
  4. Edit the bldr.env file with these settings:

    1. Set PG_EXT_ENABLED to false.

      The datastore node can’t use an externally hosted PostgreSQL, such as AWS RDS or Azure Database for PostgreSQL. For details about opening the required ports, see the scaling documentation.

    2. List all frontend and backend nodes hosting builder services using HAB_BLDR_PEER_ARG and the --peer option using the following format:

      HAB_BLDR_PEER_ARG="--peer <HOST> --peer <HOST> --peer <HOST>"
      

      Replace <HOST> with a node IP address or hostname.

  5. Install PostgreSQL by running the install script:

    ./install.sh --install-postgresql
    
  6. Connect the frontend Builder nodes to the PostgreSQL datastore node.

    On your frontend Builder nodes, set POSTGRES_HOST in the bldr.env file to the node that’s running the Habitat Builder PostgreSQL datastore.

More information

For details about setting up and scaling the frontend, see scaling Habitat Builder’s frontend documentation.

For information about managing resources with MinIO and PostgreSQL:

Edit this page on GitHub

Thank you for your feedback!

×