NetBackup™ Deployment Guide for Kubernetes Clusters
- Introduction
- Section I. Configurations
- Prerequisites
- Recommendations and Limitations
- Configurations
- Configuration of key parameters in Cloud Scale deployments
- Section II. Deployment
- Section III. Monitoring and Management
- Monitoring NetBackup
- Monitoring Snapshot Manager
- Monitoring fluentbit
- Monitoring MSDP Scaleout
- Managing NetBackup
- Managing the Load Balancer service
- Managing PostrgreSQL DBaaS
- Managing fluentbit
- Performing catalog backup and recovery
- Managing MSDP Scaleout
- Section IV. Maintenance
- MSDP Scaleout Maintenance
- PostgreSQL DBaaS Maintenance
- Patching mechanism for primary, media servers, fluentbit pods, and postgres pods
- Upgrading
- Cloud Scale Disaster Recovery
- Uninstalling
- Troubleshooting
- Troubleshooting AKS and EKS issues
- Troubleshooting AKS-specific issues
- Troubleshooting EKS-specific issues
- Troubleshooting AKS and EKS issues
- Appendix A. CR template
Enable request logging, update configuration, and copying files from/to PostgreSQL pod
This section provides the steps to enable, update and copy the container based PostgreSQL deployment for NetBackup database service.
Following are the PostgreSQL log and configuration files location:
PostgreSQL log:
/netbackup/postgresqldb/logs/*
PostgreSQL config:
/netbackup/postgresqldb/postgresql.conf
PostgreSQL hba:
/netbackup/postgresqldb/pg_hba.conf
PostgreSQL bin:
/usr/openv/db/bin
PgBouncer ini:
/home/nbsvcusr/postgresqldb/pgbouncer.ini
Perform the following to update the configuration or enable request for logging when there is a separate PostgreSQL container:
Run the following command to exec into the Postgres pod:
kubectl exec -it <postgres-pod-name> -n netbackup - - bash
Run the following command to list the PostgreSQL logs:
ls -l /netbackup/postgresqldb/log/
Run the following command to view the conf file:
cat /netbackup/postgresqldb/posgresql.conf
Modify the PostgreSQL configurations, perform the following:
Note:
Any changes done to
/netbackup/postgresqldb/postgresql.conf
file would be lost during the PostgreSQL pod restart.Method 1
Run the following command to exec into the Postgres pod:
kubectl exec -it <postgres-pod-name> -n netbackup - - bash
Set the value of
parameter to 0 as follows:sed -i 's/^#log_parameter_max_length = -1/log_parameter_max_length = 0/' /netbackup/postgresqldb/postgresql.conf
Restart Postgres as follows:
su nbsvcusr -c 'pg_ctl stop -w -D /netbackup/postgresqldb'
su nbsvcusr -c 'pg_ctl start -w -D /netbackup/postgresqldb'
Method 2 (Requires access to the internet)
Run the following command to exec into the Postgres pod:
kubectl exec -it nb-postgresql-0 -n netbackup - - bash
Run the following command to download the
vi
:microdnf install vi
Edit the
postgresql.conf
file as follows:vi /netbackup/postgresqldb/postgresql.conf
Restart Postgres as follows:
su nbsvcusr -c 'pg_ctl stop -w -D /netbackup/postgresqldb'
su nbsvcusr -c 'pg_ctl start -w -D /netbackup/postgresqldb'
To deploy PostgreSQL with custom configuration
- Start PostgreSQL with custom configuration files as follows:
Create
psqlconf
dir and copy the configuration files:mkdir psqlconf
kubectl cp netbackup/nb-postgresql-0:/netbackup/postgresqldb/postgresql.conf psqlconf/postgresql.conf kubectl cp netbackup/nb-postgresql-0:/netbackup/postgresqldb/pg_hba.conf psqlconf/pg_hba.conf kubectl cp netbackup/nb-postgresql-0:/home/nbsvcusr/postgresqldb/pgbouncer.ini psqlconf/pgbouncer.ini
Modify the settings of postgresql.conf file:
vi psqlconf/postgresql.conf
Create the
nbsqlconf
configMap:kubectl create configmap nbpsqlconf --from-file=psqlconf -n netbackup
Use the following command to save the PostgreSQL chart values to a file:
helm show values postgresql-<version>.tgz > postgres-values.yaml
Modify postgresql helm chart input file: :
vi postgres-values.yaml
Uncomment configMapName, mountConf, pgbouncerIniPath, postgresqlConfFilePath, pgHBAConfFilePath as in the following example:
# Default values for postgresql. global: environmentNamespace: "netbackup" containerRegistry: "123456789abc.dkr.ecr.us-east-1.amazonaws.com" postgresql: replicas: 1 # The values in the image (name, tag) are placeholders. These will be set image: name: "netbackup/postgresql" tag: "10.5" pullPolicy: Always service: serviceName: nb-postgresql volume: volumeClaimName: nb-psql-pvc volumeDefaultMode: 0640 pvcStorage: 5Gi configMapName: nbpsqlconf storageClassName: nb-disk-premium mountPathData: /netbackup/postgresqldb secretMountPath: /netbackup/postgresql/keys/server mountConf: /netbackup timezone: null securityContext: runAsUser: 0 createCerts: true pgbouncerIniPath: /netbackup/pgbouncer.ini serverSecretName: postgresql-server-crt clientSecretName: postgresql-client-crt dbSecretName: dbsecret dbPort: 13785 pgbouncerPort: 13787 dbAdminName: postgres initialDbAdminPassword: postgres dataDir: /netbackup/postgresqldb postgresqlConfFilePath: /netbackup/postgresql.conf pgHbaConfFilePath: /netbackup/pg_hba.conf defaultPostgresqlHostName: nb-postgresql
Reinstall postgresql helm chart using the modified input file:
helm upgrade --install postgresql postgresql-10.5.tgz -f postgres-values.yaml -n netbackup
Wait for the postgres pod to restart.
To enable request logging
- Enable request logging by performing the following changes to
postgresql.conf
file:log_min_duration_statement = 0
Note:
The value 0 means the setting is the threshold in milliseconds after which the statement is to be logged.
log_checkpoints = on log_connections = on log_disconnections = on log_lock_waits = on log_temp_files = 0 log_autovacuum_min_duration = 0 log_error_verbosity = default
Run the following command to exec into the Postgres pod:
kubectl exec -it <postgres-pod-name> -n netbackup - - bash
Run the following command to list the PostgreSQL logs:
ls -l /netbackup/postgresqldb/log/
Run the following command to view the conf file:
cat /netbackup/postgresqldb/posgresql.conf
Perform one of the following methods to copy files out of PostgreSQL container:
Method 1:
Run the following commands:
kubectl exec nb-postgresql-0 -n netbackup -- cat /netbackup/postgresqldb/postgresql.conf > /tmp/postgresql.conf
kubectl exec nb-postgresql-0 -n netbackup -- cat /netbackup/postgresqldb/log/postgresql-Tue.log > /tmp/postgresql-Tue.log
Method 2 (Requires access to the internet):
Exec into Postgres pod and install tar:
kubectl exec -i nb-postgresql-0 -n netbackup - - microdnf install tar
Copy the files:
kubectl cp netbackup/nb-postgresql-0:/netbackup/postgresqldb/postgresql.conf /tmp/postgresql.conf