SQWareProduction:postgres:etc:sqwpg GlobalVar.cfg

De WikiFr

Configuration file $gvsqw_PgBin/../etc/sqwpg_GlobalVar.cfg:
Global var for Postgres
Contient les variables operationnelles de SQWareProduction.

Contenu du fichier:

#!/bin/ksh
###################################################################
# SQWareProduction for Postgres module of dbSQWare
# 
# dbSQWare is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# CGU/CGA for more details.
# 
# You should have received a copy of the CGU/CGA
# along with this program.  If not, see <http://www.dbsqware.com/licenses/>.
# 
# For information : contact@dbsqware.com or www.dbsqware.com
###################################################################
## @Synopsis	Global var for Postgres
## @Copyright	Copyright 2010-2020, dbSQWare (www.dbsqware.com)

#global
export gvsqw_ConnectString=''
export gvsqw_PGPASSFILE='$gvsqw_PgBin/../etc_cust/.pgpass'
export gvsqw_DistConnectString='-h $gvsqw_PostgresHost -p $gvsqw_PostgresPort -U $gvsqw_DbaUser'
export gvsqw_RootAdmin='$HOME/${PG_SID}'
export gvsqw_RootAdminDisable='$HOME'
export gvsqw_RootAdminDist='$HOME/admin/postgres/${PG_SID}'
export gvsqw_RootCfg='$gvsqw_RootAdmin/sqwConfig'
export gvsqw_RootDbf='/pgdata/$PG_SID/data'
export gvsqw_NbThreadReindex=2
export gvsqw_NbThreadAnalyze=2
export gvsqw_NbThreadDump=2
export gvsqw_NbThreadVacuum=2
export gvsqw_PostgresErrorMsg="^ERROR: |^FAILED: |^ERREUR: |^FATAL: |^PANIC: |psql:.* ERROR: |psql:.* FAILED: |psql:.* ERREUR: |psql:.* FATAL: |psql:.* PANIC: |could not connect"
export PAGER=more
export gvsqw_PgDefaultExcludeDb="datname not like 'template%'"
#Sort databases list, put "pg_database_size(oid) desc" to sort by size desc
export gvsqw_PgDefaultSortDb="1"
export gvsqw_DbAlias='$PG_SID'

#for Dump scripts
export gvsqw_RootDump='/pgbackup/$PG_SID'
export gvsqw_DumpNbGeneration=2
export gvsqw_DumpCompressorExt=gz
export gvsqw_DumpFormat='p'
export gvsqw_PgDumpOpt='-Z0'
export gvsqw_RsyncDefaultSourceDir='/pgbackup/$PG_SID'

#for archive pg_xlog script
## put the destination list (1,2,3, ... corresponding to gvsqw_ArchiveXlog_destx, put dest1 to local destination)
export gvsqw_ArchiveXlog_enabled=1
export gvsqw_ArchiveXlog_dest1='/pgdata/$PG_SID/archive_xlog'
#export gvsqw_ArchiveXlog_dest2='destusr@desthost:/pgdata/$PG_SID/archive_xlog'
export gvsqw_ArchiveXlogCompressorExt=gz
export gvsqw_ArchiveXlogMaxMail=2

#for PITR scripts
export gvsqw_RootPitr='/pgbackup/$PG_SID/PITR'
export gvsqw_PitrNbGeneration=2
export gvsqw_PitrCompressorExt=gz
export gvsqw_PitrFormat='tar'
export gvsqw_PgPitrOpt=''
export gvsqw_PitrWaitTimeOut=900
#To autostart SqwArchmon when backup (enable/disable)
export gvsqw_PitrAutoStartSqwArchmon=enable
#Delay max between two backup of archives in s by default (unit: s,m,h)
export gvsqw_PitrArchLogsTimeTreshold=6h
#Delay between two tests in s by default (unit: s,m,h)
export gvsqw_PitrArchLogsInterval=5m
#Threshold for trigger backup ArchiveXlog in M by default (unit: K,M,G,%)
export gvsqw_ArchiveXlog_dest1_threshold=100M

#for indicators
export gvsqw_SizeMinTableIndicators=10
export gvsqw_GenExcludeDatabasesObjects="^postgres$"
export gvsqw_GenExcludeDatabasesObjectsExtra=""

##Globaly forcing return code for scripts
#export gvsqw_ForcedReturnCodeScript_sqwpg_DumpDatabase=0


Explication de variables:

#General variables
gvsqw_SqwVersion => SQWare Production version
gvsqw_PostgresSock => Path to MySQL sock file
gvsqw_ConnectDb => if connection to db evalable then Enable else Disable
gvsqw_Hostname => Hostname for prompt and trace
gvsqw_GlobalMsgMail => Begining of email subject
gvsqw_GlobalMail => email adress, put NoNail in gvsqw_GlobalMail if you don't want to send mail on error
gvsqw_SendmailHtmlFormat => Html format for email, put disable in gvsqw_SendmailHtmlFormat if you don't want to send mail in html format
gvsqw_PreFormatHtlml => enable if file is already formated
gvsqw_Colors => enable, put disable in gvsqw_Colors if you don't want to print in color
gvsqw_TraceJobDb => enable, put disable in gvsqw_TraceJobDb if you don't want to trace job execution in SQWareRepository
gvsqw_EgrepIvFs => for 'egrep -v' on 'df' command
gvsqw_SuppLogsHisto => number of days to delete log files
gvsqw_GzipLogsHisto => number of days to compress log files
gvsqw_SuppArchAlert => number of days to delete archives of alert files
gvsqw_SuppArchSlow => number of days to delete archives of slow query files
gvsqw_RootAdmin => admin directory
gvsqw_RootCfg => configuration directory
gvsqw_RootDbf => datafiles directory
gvsqw_InitInstanceSourceCommand => Init profile instance command
gvsqw_NbThread => default number of thread for parallelism
gvsqw_PostgresErrorMsg => format of MySQL errors
gvsqw_SshOptions => ssh default options
gvsqw_ScpOptions => scp default options

#Html tags
gvsqw_CHtmlError => font tag for error
gvsqw_CHtmlOk => font tag for OK
gvsqw_CHtmlInfo => font tag for info
gvsqw_CHtmlEnd => end font tag
gvsqw_THtmlBegin => table tag
gvsqw_THtmlEnd => end table tag
gvsqw_THtmlThBegin => th tag
gvsqw_THtmlThEnd => end th tag
gvsqw_THtmlThInter => inter th tag
gvsqw_THtmlTdBegin1 => td tag sqwnc
gvsqw_THtmlTdBegin2 => td tag sqwc_
gvsqw_THtmlTdEnd => end td tag
gvsqw_THtmlTdInter => inter td tag
gvsqw_THtmlPre => tag for pre formated text
gvsqw_THtmlPreEnd => end tag for pre formated text
gvsqw_HtmlCss => CSS style

#for Dump scripts
gvsqw_NbThreadDump => default number of thread for parallelism for pg_Dump
gvsqw_RootDump => default pg_Dump directory
gvsqw_DumpNbGeneration => default number generation of pg_Dump to keep online
gvsqw_ConsistentInnoDb => command to make pg_Dump consistent where engine = InnoDb
gvsqw_ConsistentOthers => command to make pg_Dump consistent where engine != InnoDb
gvsqw_PgDumpOpt => postgres Dump command
#Put disable in gvsqw_TraceBackup if you don't want to trace backup execution in SQWareRepository
gvsqw_TraceBackup => to trace backup execution in SQWare repository

#for optimize scripts
gvsqw_NbThreadReindex => default number of thread for parallelism for optimize

#for analyse scripts
gvsqw_NbThreadAnalyze => default number of thread for parallelism for analyse

##Globaly forcing return code for scripts
gvsqw_ForcedReturnCodeScript_sqwpg_DumpDatabase => To force return code of sqwpg_DumpDatabase.ksh
...

#for SQWare Web
gvsqw_WebDbaURL => SQWare Web URL
gvsqw_WebDbaUserConn => Connection string ssh user@hostname to SQWare Web
gvsqw_WebDbaDirSlowQuery => Directory to store SlowQuery files on SQWare Web
Information.png
Information:
Vous pouvez surcharger les variables contenues dans $gvsqw_PgBin/../etc/sqwpg_GlobalVar.cfg

en mettant les memes noms de variables dans $gvsqw_PgBin/../etc_cust/sqwpg_GlobalVar.cfg pour tous vos environnements
ou dans $HOME/sqwConfig/sqwpg_GlobalVar.cfg pour cet utilisateur specialement.