Database Connector#

Install Packages#

Warning

In case you install this Role on a Node which already features the Mesh and Directory Role, make sure you do not install the service-discover-agent package.

# apt install pgpool2 carbonio-files-db carbonio-mailbox-db \
  carbonio-docs-connector-db carbonio-tasks-db \
  carbonio-message-dispatcher-db carbonio-ws-collaboration-db \
  service-discover-agent
# dnf install pgpool2 carbonio-files-db carbonio-mailbox-db \
  carbonio-docs-connector-db carbonio-tasks-db \
  carbonio-message-dispatcher-db carbonio-ws-collaboration-db \
  service-discover-agent

Bootstrap Carbonio CE#

# carbonio-bootstrap

The bootstrap command will execute a number of tasks and will set up the node. At the end, you will be prompted with a menu and, if you already configured all, you only need to click y for confirmation.

During the process, you need to provide these values, which you can retrieve from the first Mesh and Directory node.

  • Ldap master host is the FQDN of the first Mesh and Directory node, (example: ldap-mstr.example.com)

  • Ldap Admin password is obtained from the first Mesh and Directory node (ldap-admin-password)

Join Carbonio Mesh#

Carbonio Mesh is required to allow communication between Carbonio CE and its components. The configuration is interactively generated by command

# service-discover setup-wizard

This command will:

  • ask for the IP address and netmask

  • ask for the Carbonio Mesh secret, which is used for setups, management, and to access the administration GUI. See section Carbonio Mesh Administration Interface for more information.

    This password will be denoted as MESH_SECRET throughout the documentation.

    Hint

    We suggest to use a robust password which is at least 16 characters long, including at least one of lowercase and uppercase letters, numbers, special characters and store it in a password manager.

    In case the password is lost or the credential file becomes corrupted and unusable, you can reset them using the procedure detailed in section Carbonio Mesh Credentials.

  • store the setup in file /etc/zextras/service-discover/cluster-credentials.tar.gpg

To complete Carbonio Mesh installation, run

# pending-setups -a

Hint

The secret needed to run the above command is stored in file /var/lib/service-discover/password, which is accessible only by the root user.

Install and Configure pgpool#

Carry out the following tasks to set up pgpool.

  1. Install pgpool

    # apt install pgpool2
    
    # dnf install https://www.pgpool.net/yum/rpms/4.4/redhat/rhel-8-x86_64/pgpool-II-pg12-4.4.3-1pgdg.rhel8.x86_64.rpm
    
  2. Configure Pgpool-II using the following command.

    Note

    backend_hostname0 is the IP of the Node on which PostgreSQL is installed. If you plan to install it on a different node or you want to use an existing PostgreSQL installation, replace the value localhost with the correct IP address or hostname, provided the hostname is resolvable by the node that hosts the Database connector role.

    Copy the following lines and paste them in file /etc/pgpool2/pgpool.conf.

    backend_clustering_mode = 'raw'
    port = 5432
    backend_hostname0 = 'localhost'
    backend_port0 = 5433
    backend_flag0 = 'DISALLOW_TO_FAILOVER'
    num_init_children = 32
    max_pool=8
    reserved_connections=1
    

    Copy the following lines and paste them in file /etc/pgpool-II/pgpool.conf.

    backend_clustering_mode = 'raw'
    port = 5432
    backend_hostname0 = 'localhost'
    backend_port0 = 5433
    backend_flag0 = 'DISALLOW_TO_FAILOVER'
    num_init_children = 32
    max_pool=8
    reserved_connections=1
    
  3. Make sure the service is enabled and restart it using these commands

    # systemctl enable --now pgpool2
    # systemctl restart pgpool2.service
    
    # systemctl enable --now pgpool
    # systemctl restart pgpool.service
    

Bootstrap Carbonio Databases#

You can use the password of the Postgres user carbonio_adm that you defined when installing the Database role or any other administrator user created previously.

You need to run the commands only if the corresponding Role is installed.

Carbonio Files
# PGPASSWORD=$DB_ADM_PWD carbonio-files-db-bootstrap carbonio_adm 127.0.0.1
Carbonio Tasks
# PGPASSWORD=$DB_ADM_PWD carbonio-tasks-db-bootstrap carbonio_adm 127.0.0.1
Carbonio Workstream Collaboration
# PGPASSWORD=$DB_ADM_PWD carbonio-ws-collaboration-db-bootstrap carbonio_adm 127.0.0.1
Carbonio Workstream Collaboration Dispatcher
# PGPASSWORD=$DB_ADM_PWD carbonio-message-dispatcher-db-bootstrap carbonio_adm 127.0.0.1