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:
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.
If your node previously ran Habitat On-Prem Builder components, run the
uninstall.sh
script to clean up your environment:./uninstall.sh
Copy the
bldr.env.sample
file and save it asbldr.env
:cp bldr.env.sample bldr.env
Edit the
bldr.env
file with these settings:Set
S3_ENABLED
andARTIFACTORY_ENABLED
tofalse
.You can’t use the MinIO server if you’re using S3 or Artifactory directly.
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.
Install MinIO by running the install script:
./install.sh --install-minio
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 thebldr.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:
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.
If your node previously ran Habitat On-Prem Builder components, run the
uninstall.sh
script to clean up your environment:./uninstall.sh
Copy the
bldr.env.sample
file and save it asbldr.env
:cp bldr.env.sample bldr.env
Edit the
bldr.env
file with these settings:Set
PG_EXT_ENABLED
tofalse
.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.
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.
Install PostgreSQL by running the install script:
./install.sh --install-postgresql
Connect the frontend Builder nodes to the PostgreSQL datastore node.
On your frontend Builder nodes, set
POSTGRES_HOST
in thebldr.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: