Closed Exist2Resist closed 3 years ago
When the container starts
Starting backup server in cron mode ...
Settings:
- Run mode: cron
- Backup strategy: rolling
- Current backup type: daily
- Backups to retain:
- Daily: 7
- Weekly: 4
- Monthly: 12
- Current backup folder: /backups/daily/2021-07-13/
- Time Zone: PDT -0700
- Schedule:
- mssql=mssql-server:1433/timesheets
-
- 0 1 * * * default ./backup.sh -s
- 0 4 * * * default ./backup.sh -s -v all
- Container Type: mssql
- Databases (filtered by container type):
- postgresql:5432/my_postgres_db
- FTP server: not configured
- Webhook Endpoint: not configured
- Environment Friendly Name: not configured
- Environment Name (Id): not configured
Starting go-crond as a background task ...
go-crond: Starting go-crond version 0.6.3
go-crond: --> detected RedHat family, using distribution defaults
go-crond: add: spec:'0 1 * * *' usr:default cmd:'./backup.sh -s' env:'[mssql=mssql-server:1433/timesheets]'
go-crond: add: spec:'0 4 * * *' usr:default cmd:'./backup.sh -s -v all' env:'[mssql=mssql-server:1433/timesheets]'
go-crond: WARNING: go-crond is NOT running as root, disabling user switching
go-crond: Start runner with 2 jobs
When I manually run it
sh-4.4$ ./backup.sh -1
Starting backup process ...
Reading backup config from backup.conf ...
Reading backup config from environment variables ...
Making backup directory /backups/daily/2021-07-13/ ...
Settings:
- Run mode: once
- Backup strategy: rolling
- Current backup type: daily
- Backups to retain:
- Daily: 7
- Weekly: 4
- Monthly: 12
- Current backup folder: /backups/daily/2021-07-13/
- Container Type: mssql
- Databases (filtered by container type):
- postgresql:5432/my_postgres_db
- FTP server: not configured
- Webhook Endpoint: not configured
- Environment Friendly Name: not configured
- Environment Name (Id): not configured
Backing up 'postgresql:5432/my_postgres_db' to '/backups/daily/2021-07-13/postgresql-my_postgres_db_2021-07-13_10-57-17.sql.gz.in_progress' ...
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
removed '/backups/daily/2021-07-13/postgresql-my_postgres_db_2021-07-13_10-57-17.sql.gz.in_progress'
[!!ERROR!!] - Failed to backup postgresql:5432/my_postgres_db.
Elapsed time: 0h:0m:9s - Status Code: 1
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
@Exist2Resist, An example OCP template can be found here; https://github.com/BCDevOps/backup-container/blob/master/openshift/templates/backup/backup-deploy.yaml. Another can be found here; https://github.com/bcgov/orgbook-configurations/blob/master/openshift/templates/backup/backup-deploy.yaml
Although, based on the output in the schedule section of the startup log:
- Schedule:
- mssql=mssql-server:1433/timesheets
-
- 0 1 * * * default ./backup.sh -s
- 0 4 * * * default ./backup.sh -s -v all
It looks like there are formatting issues in your backup.conf
file. Make sure the line endings are Lf
and not `CrLf.
@devinleighsmith, would you be able to point @Exist2Resist at a working MSSQL backup configuration?
Here is our (working) dev configuration:
kind: ConfigMap
apiVersion: v1
namespace: 354028-dev
labels:
app: pims
env: dev
name: pims-backup
role: backup
data:
backup.conf: |-
0 1 * * * default ./backup.sh -s
mssql=pims-database:1433/pims
and yes, you need to be careful about line endings and tabs, or the config map settings will be ignored in favour of the defaults.
These are the templates correct @devinleighsmith? https://github.com/bcgov/PIMS/tree/dev/openshift/4.0/templates/backup
Correct
Thank you I will have a look.
@WadeBarnes @devinleighsmith thank you for the assist. It was a combination my build config and the backup.conf file. Build config didn't reference the mssql container, and there were some spacing/character issues in the backup.conf file.
Using OCP 3.11 and trying to backup a MSSQL instance.
DATABASE_SERVICE_NAME and DATABASE_NAME are not used when using backup.conf. However omitting these variables the backup container assumes postgresql. Run mode is being specified as legacy, how is this changed to utilize the backup.conf? Do I remove unnecessary variables, or do I leave them blank?
backup.conf exists as a config map and variables. Also there are no instructions on how and where the backup storage should be mounted in the sql database container that is being backed up.
${_fileName}
is used to invoke MSSQL backup, where is this variable defined, and how is it mounted in the tsql container?