FAQ:NewInstanceMySQL: Difference between revisions

From Wiki_dbSQWare
Jump to navigation Jump to search
mNo edit summary
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Work In Progress
==Generalties==
==Generalties==
<br>
<br>
{{Warning | Before anything, don't go further if you don't have read the first section [[General:Concepts|"dbSQWare Concepts "]] !}}
{{Warning | Before anything, don't go further if you don't have read the first section [[General:Concepts|"dbSQWare Concepts "]] !}}


Dans ce chapitre, on considèrera que SQWareCentral a été installé sur dbsqware@sqwarebox ...
In this chapter, we will consider that SQWareCentral has been installed on dbsqware@sqwarebox.


===Limits of this section===
===Limits of this section===
Ce chapitre ne traite que de l'ajout d'une nouvelle instance sur un socle déjà paramétré et fonctionnel.<br>
This chapter only deals with adding a new instance to a base that is already configured and functional.<br>
Utilisez les portions qui concernent votre environnement et utilisez la méthode match ou manuelle au choix !<br>
Use the portions that apply to your environment, and choose either the automatic or manual method as desired<br>
 
===General operating procedure for integrating a new MySQL/MariaDB instance===
There will potentially be one or two connection cases to handle.
* "local" for Unix machines (or those with Cygwin) where you'll be running MySQL/MariaDB on the machine hosting the instance (SSH connection from dbsqware@sqwarebox).
* "remote" for cases where you don't have SSH access to the machine (Windows, RDS, etc.).
 
Classic steps:
 
*Setting up the environment
 
*Checking system prerequisites for the "local" part (bash + rsync)
 
*Manual tests


===MODOP général d'intégration d'une nouvelle instance MySQL/MariaDB===
*Deployment of the instance
Il y aura potentiellement 1 ou 2 cas de connexion à traiter
* "locale", pour les machines unix (ou avec Cygwin) où l'on va faire du "mysql" sur la machine qui porte l'instance (connexion ssh depuis dbsqware@sqwarebox)
* "distante", pour le cas où l'on n'a accès à la machine en ssh (Windows, RDS, etc, ...)


Etapes classiques :
You will see that these steps can be handled one by one or in batches!
*Mise en place de l'environnement
*Vérification des prérequis système pour la partie "locale" (bash + rsync)
*Tests "manuels"
*Mise en exploitation de l'instance
Vous verrez que ces étapes peuvent être traitée une par une ou par batch !


==Intégration d'une instance MySQL/MariaDB==
==Integration of an MySQL/MariaDB instance==


===Mise en place de l'environnement===
===Setting up the environment===
====Général====
=====Explication du "DbAlias" (la clé unique dbSQWare)=====
La clé dbSQWare doit être unique et raccord avec ce qui aura été paramétré pour la variable gvsqw_DbAlias dans sqwmys_GlobalVar.cfg !<br/>
On va utiliser une variable, MYSQL_SID qui n'a aucune valeur pour MySQL/MariaDB mais qui va identifier l'instance dans dbSQWare.<br/>
Par "convention", on utilise souvent MYS "_" APPLI "_" ENV.<br/>
Exemple : MYS_MONAPPLI_PRD ou MYS_DEUXAPPLI_DEV ...<br/>
Mais rien n'est imposé, vous choisissez ce qui "vous arrange" ! Il faudra juste positionner la variable MYSQL_SID dans le profile du compte mysql avec la valeur souhaitée.<br/>


=====Explication des statuts=====
====General====
*Une instance sera traitée en mode "local", c’est-à-dire que l’on va se connecter en "mysql" en local sur la machine qui porte l’instance (accès ssh depuis dbsqware@sqwarebox), statut "ON".<br/>
 
*Une instance où l’on n’aurait pas d'accès unix local serait gérée en mode "distant" (style Windows, RDS, ...), statut "DIST".<br/>
=====Explanation of "DbAlias" (the unique dbSQWare key)=====
*Le statut "OFF" fait "disparaître" l’instance de la visu web.<br/>
The dbSQWare key must be unique and consistent with what has been configured for the gvsqw_DbAlias variable in sqwmys_GlobalVar.cfg!<br/>
*Le statut "NEW" est utilisé comme statut intermédiaire entre le début et la fin du paramétrage d'une nouvelle instance.<br/>
We'll use a variable, MYSQL_SID, which has no value for MySQL/MariaDB but will identify the instance in dbSQWare.<br/>
*Tous les autres statuts permettent d’afficher l’instance dans le référentiel (notamment "KEEP") mais ne seront pas pris en compte par les traitements automatiques.<br/>
By convention, we often use MYS "_" APPLI "_" ENV.<br/>
Example: MYS_THISAPPS_PRD or MYS_THISOTHERAPPS_DEV ...<br/>
But nothing is imposed; you choose what "suits you"! You just need to set the MYSQL_SID variable in the MySQL account profile with the desired value.<br/>
 
=====Explanation of statuses=====
*An "open" instance will be handled in "local" mode, meaning we will connect with mysql locally on the machine hosting the instance (ssh access from dbsqware@sqwarebox), status "ON".<br/>
*An instance where we don’t have local unix access will be managed in "remote" mode (like Windows, RDS, ...), status "DIST".<br/>
*The "OFF" status makes the instance "disappear" from the web view.<br/>
*The "NEW" status is used as an intermediate status between the beginning and the end of setting up a new instance.<br/>
*All other statuses allow the instance to be displayed in the repository (especially "KEEP") but will not be taken into account by the automatic processes.<br/>
<br/>
<br/>
Résumé des statuts :<br/>
Resume of statuses :<br/>
{| align="center" {{Prettytable}}
{| align="center" {{Prettytable}}
|-
|-
| '''Statut'''  
| '''Status'''  
| '''Description'''  
| '''Description'''  
|-
|-
| ON
| ON
| gestion locale sous unix (le plus courant)
| locale under Unix (the most common)
|-
|-
| DIST
| DIST
| gestion uniquement à distance
| remote-only management
|-
|-
| KEEP
| KEEP
| statut temporaire, lors d'une maintenance par exemple ou avant suppression complète
| temporary status, during maintenance for example or before complete deletion
|-
|-
| NEW
| NEW
| statut temporaire, lors du paramétrage
| temporary status, during configuration
|-
|-
| OFF
| OFF
| suppression visuelle de l'instance (sans suppression de son paramétrage)
| visual removal of the instance (without deleting its configuration)
|-
|-
| XXX
| XXX
| non pris en charge ...
| not supported...
|}
|}


====Déclaration de l'instance dans SQWareRepository avec SQWareWeb====
====Instance declaration in SQWareRepository with SQWareWeb====
Nous allons déclarer la nouvelle instance depuis l'interface d'administration de SQWareWeb.<br/>
We will declare the new instance from the SQWareWeb administration interface.<br/>
[[Fichier:Admin_dbSQWare.png||admin|Lien vers la console d'administration]]<br/>
[[File:Admin dbSQWare.png||admin|Admin dbSQWare]]


Déclarez la nouvelle instance en statut "NEW" (Ajout ou Duplicate)<br/>
<br/>
[[Fichier:AjoutInstance.png||admin|Ajout d'une instance]]
[[Fichier:DuplicateInstance.png||admin|Ajout par duplication d'une instance]]<br/>
[[Fichier:DeclarationInstanceMySQL.png|adminMySQL|Déclaration de la nouvelle instance MySQL/MariaDB]]


Explication des champs :<br/>
Declare the new instance with the status "NEW" (Add or Duplicate).<br/>
[[File:AjoutInstance.png||admin|Ajout d'une instance]]
[[File:DuplicateInstance.png||admin|Ajout par duplication d'une instance]]<br/>
[[File:DeclarationInstanceMySQL.png|admin|Add a new instance by duplicate an other one.]]<br/>
Explanation of the fields :<br/>
{| align="center" {{Prettytable}}
{| align="center" {{Prettytable}}
|-
|-
| '''Champ'''  
| '''Fields'''  
| '''Description'''  
| '''Description'''  
|-
|-
| Db Alias
| Db Alias
| Clé unique qui identifie l'instance dans dbSQWare (pas de valeur pour MySQL/MariaDB)
| Unique key that identifies the instance in dbSQWare (no value for MySQL/MariaDB).
|-
|-
| Dbms Name
| Dbms Name
| Type de SGBD
| Type of SGBD
|-
|-
| Virtual Host
| Virtual Host
| Host virtuel (meme que Host si pas cluster)
| Virtual Host (same as Host if not clustered)
.
|-
|-
| Host Name
| Host Name
| Hostname de l'instance
| Hostname of the instance
|-
|-
| User Name
| User Name
| User qui porte l'instance
| User associated with the instance
|-
|-
| Port
| Port
| Port d'écoute de l'instance
| Listening port of the instance.
|-
|-
| Comments
| Comments
| Une courte description de ce que porte l'instance
| A brief description of what the instance hosts
|-
|-
| Status
| Status
| Instance statut (cf plus haut pour les explications)
| Instance status (see above for explanations).
|-
|-
| Contact
| Contact
| Un contact si besoin
| A contact if needed
|-
|-
| Environnement
| Environnement
| Environnement de l'instance (PRD, PPR, REC, DEV, TST, ...)
| Instance environment (PRD, PPR, REC, DEV, TST, ...)
|-
|-
| Client
| Client
| Utilisé uniquement pour filtrer (mettre un nom de client et/ou de département et/ou service ...
| Used only for filtering (enter a client name and/or department and/or service...)
|-
|-
| GlobalHost
| GlobalHost
| Champ libre dans lequel on met souvent l'hôte de hyperviseur par exemple
| Free field in which the hypervisor host is often entered, for example.
|-
|-
| Custom1
| Custom1
| Champ libre 1
| Free field 1
|-
|-
| Custom2
| Custom2
| Champ libre 2
| Free field 2
|}
|}
=====Regénérer les fichiers de référence de SQWareCentral=====
=====Regenerate the reference files of SQWareCentral.=====
Tapez la commande suivante qui va générer les fichiers de référence :
Type the following command which will generate the reference files:
 
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
Line 130: Line 138:
</syntaxhighlight>
</syntaxhighlight>


===Procédure spécifique pour la partie "locale" (statut ON)===
===Specific procedure for the "local" part (status ON)===
/!\ Uniquement que les instances qui seront en statut "ON" !<br/>
/!\ Only instances that will be in the "ON" status !<br/>


====Vérification des prérequis système pour la partie "locale" (bash + rsync)====
====Verification of system prerequisites for the "local" part (bash + rsync)====
SQWareProduction étant écrit essentiellement en shell bash et étant synchronisé depuis SQWareCentral avec rsync, il nous faut donc "bash" et "rsync" installés !
Since SQWareProduction is mainly written in bash shell and synchronized from SQWareCentral using rsync, we therefore need "bash" and "rsync" to be installed !


=====Vérification=====
=====Verification=====
Adaptez à votre nom de user et nom de machine.<br>
Adapt to your username and machine name.<br>
<br>
<br>
bash:
bash:
Line 143: Line 151:
# From : mysql@my_mysql_host
# From : mysql@my_mysql_host
type bash
type bash
#ou
#or
which bash
which bash
</syntaxhighlight>
</syntaxhighlight>
rsync:
rsync:
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# mysql@my_mysql_host
# From : mysql@my_mysql_host
type rsync
type rsync
#ou
#or
which rsync
which rsync
</syntaxhighlight>
</syntaxhighlight>


=====Installation=====
=====Installation=====
Adaptez à votre type de machine (sudo si vous n'êtes pas root).<br/>
Adapt to your machine type (use sudo if you are not root).<br/>
<br>
<br>
RedHat / CentOS / ... :
RedHat / CentOS / ... :
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : root@my_mysql_host
# From : root@my_mysql_host
yum install -y bash rsync
yum install -y bash rsync
#ou
#or
dnf install -y bash rsync
dnf install -y bash rsync</syntaxhighlight>
</syntaxhighlight>
 
Ubuntu / Debian / ... :
Ubuntu / Debian / ... :
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : root@my_mysql_host
# From : root@my_mysql_host
apt install -y bash rsync
apt install -y bash rsync
</syntaxhighlight>
</syntaxhighlight>


====Modification user unix ====
====Unix user modification====
Adaptez à votre type de machine (sudo si vous n'êtes pas root).<br/>
Adapt to your machine type (sudo if you're not root).
Modification du homedir (pas obligatoire mais évite de se retrouver dans /var/lib/mysql) :
Modify the homedir (not mandatory, but avoids ending up in /var/lib/mysql):
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : root@my_mysql_host
# From : root@my_mysql_host
Line 182: Line 188:


<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
##Stop instance (service mysql/mariadb stop -- ou -- systemctl stop mysql/mariadb)
##Stop instance (service mysql/mariadb stop -- or -- systemctl stop mysql/mariadb)
usermod -d /home/mysql mysql -s /bin/bash
usermod -d /home/mysql mysql -s /bin/bash
##Start instance (service mysql/mariadb start -- ou -- systemctl start mysql/mariadb)
##Start instance (service mysql/mariadb start -- or -- systemctl start mysql/mariadb)


#Ou directement vi /etc/passwd !
#Or directly vi /etc/passwd !
exemple : mysql:x:1004:989::/home/mysql:/bin/bash
example : mysql:x:1004:989::/home/mysql:/bin/bash
</syntaxhighlight>
</syntaxhighlight>


Affectez un passwd au user mysql (sinon la connexion par échange de clés ne fonctionnera pas !) :
Assign a passwd to the mysql user (otherwise the key exchange connection will not work!):<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : root@my_mysql_host
# From : root@my_mysql_host
passwd mysql
passwd mysql
</syntaxhighlight>
</syntaxhighlight>


====Création d'un compte MySQL/MariaDB spécifique dbSQWare (Pour connexion locale)====
====Creating a specific MySQL/MariaDB account for dbSQWare (for local connection)====
Adaptez aux besoins en fonction de ce que vous voulez faire ...<br/>
Adapt to your needs depending on what you want to do...<br/>


Exemple pour une connexion "locale"
Example for local connection :
<syntaxhighlight lang="sql" line>
<syntaxhighlight lang="sql" line>
grant all privileges on *.* to 'DBSDBA'@'localhost' IDENTIFIED BY 'NePasMettreCePassword!' with grant option;
grant all privileges on *.* to 'DBSDBA'@'localhost' IDENTIFIED BY 'DoNotSetThisPassword!' with grant option;


/* ou */
/* or */
create user 'DBSDBA'@'localhost' IDENTIFIED BY 'NePasMettreCePassword!';
create user 'DBSDBA'@'localhost' IDENTIFIED BY 'DoNotSetThisPassword!';
grant all privileges on *.* to 'DBSDBA'@'localhost' with grant option;
grant all privileges on *.* to 'DBSDBA'@'localhost' with grant option;
</syntaxhighlight>
</syntaxhighlight>
Line 210: Line 215:
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : mysql@my_mysql_host
# From : mysql@my_mysql_host
#Puis, création du fichier .my.cnf pour permettre la connexion sans passer de passwd
#Then, create the .my.cnf file to allow connection without using passwd
echo "[client]
echo "[client]
password = NePasMettreCePassword!
password = DoNotSetThisPassword!
" >> $HOME/.my.cnf
" >> $HOME/.my.cnf
chmod 600 $HOME/.my.cnf
chmod 600 $HOME/.my.cnf
</syntaxhighlight>
</syntaxhighlight>


====Déploiement de(s) clé(s) ssh de SQWareCentral vers la/les machine(s) cible(s)====
====Deployment of SSH key(s) from SQWareCentral to the target machine(s)====
Il existe deux manières de procéder :
There are two ways to proceed:
*Une automatique (depuis dbsqware@sqwarebox mais vous oblige à connaitre le mdp du compte unix mysql)
*An automatic one (from dbsqware@sqwarebox, but it requires you to know the password of the mysql Unix account)
*Une manuelle que vous appliquez sur chaque compte unix mysql
*A manual one that you apply on each mysql Unix account
/!\ Le mdp de votre compte mysql unix doit avoir été initialisé, si non, la connexion par échange de clé ne fonctionnera pas !
/!\ The password of your mysql Unix account must have been initialized, otherwise key-based authentication will not work!


=====Déploiement de(s) clé(s) ssh : méthode batch=====
=====Deployment of SSH key(s): batch method=====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
menu_mys GenDeplSshKeys_SQWareCentral GenLstInstanceNew
menu_mys GenDeplSshKeys_SQWareCentral GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>
Vérifiez que c'est bien la liste que vous souhaitez déployer, puis choix 1 ...<br/>
Verify that this is indeed the list you want to deploy, then choose option 1 ...<br/>
=> Entrez le mdp unix quand il vous est demandé !
=> Enter the Unix password when prompted !


=====Déploiement de(s) clé(s) ssh : méthode manuelle=====
=====Deployment of SSH key(s): manual method=====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : mysql@my_mysql_host
# From : mysql@my_mysql_host
if [ ! -r $HOME/.ssh/id_rsa ]
if [ ! -r $HOME/.ssh/id_rsa ]
then
then
Line 243: Line 246:
chmod 600 $HOME/.ssh/authorized_keys
chmod 600 $HOME/.ssh/authorized_keys
</syntaxhighlight>
</syntaxhighlight>
=> Mettre la bonne clé dans le "echo" (celle de dbsqware@sqwarebox)
=> Put the correct key in the "echo" (the one from dbsqware@sqwarebox)


====Test de connexion ssh depuis SQWareCentral====
====SSH connection test from SQWareCentral====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
menu_mys TestSshConnection GenLstInstanceNew
menu_mys TestSshConnection GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>


====Test des prérequis sur l'hote cible (bash+rsync) ssh depuis SQWareCentral====
====Test of prerequisites on the target host (bash+rsync) via SSH from SQWareCentral====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
menu_mys TestSysPrerequisites GenLstInstanceNew
menu_mys TestSysPrerequisites GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>


====Déploiement de SQWareProduction====
====Deployment of SQWareProduction====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox


#Si depl sur user "unique"
#If deployment on "unique" user
menu_mys DeplScripts GenLstUniqueNew
menu_mys DeplScripts GenLstUniqueNew


#Si depl sur user "de l'instance", celui spécifié dans SQWareRepository
#If deployment on "instance" user, the one specified in SQWareRepository
menu_mys DeplScripts GenLstInstanceNew
menu_mys DeplScripts GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>
Pour user "unique" c'est l'utilisateur "standard", par défaut nous le réglons sur "mysql", et il peut être modifié dans SQWareCentral.


====Ajout de l'environnement dbSQWare dans ~/.profile ou ~/.bash_profile====
For "unique" user, it is the "standard" user. By default, we set it to "mysql", and it can be modified in SQWareCentral.
Une nouvelle fois, il existe deux manières de procéder :
 
*Une automatique (depuis dbsqware@sqwarebox)
====Adding the dbSQWare environment to ~/.profile or ~/.bash_profile====
*Une manuelle que vous appliquez sur chaque compte unix mysql
Once again, there are two ways to proceed:
 
*An automatic one (from dbsqware@sqwarebox)
*A manual one that you apply on each mysql Unix account


=====Ajout de l'environnement dbSQWare : méthode batch=====
=====Adding the dbSQWare environment: batch method=====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
menu_mys AdddbSQWareProfile GenLstInstanceNew
menu_mys AdddbSQWareProfile GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>
Vérifiez que c'est bien la liste que vous souhaitez déployer, puis choix 1 ...<br/>
Check that this is indeed the list you want to deploy, then choose 1 ...<br/>  
=> Dans ~/.profile ou ~/.bash_profile, changez la variable suivante avec la valeur adaptée : gvsqw_Env='XXX'
=> In ~/.profile or ~/.bash_profile, change the following variable with the appropriate value: gvsqw_Env='XXX'


=====Ajout de l'environnement dbSQWare : méthode manuelle=====
=====Adding the dbSQWare environment: manual method=====  
Ajoutez les lignes suivantes dans le ~/.profile ou ~/.bash_profile
Add the following lines to ~/.profile or ~/.bash_profile
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : mysql@my_mysql_host
# From : mysql@my_mysql_host


#dbSQWare
#dbSQWare
Line 297: Line 297:
</syntaxhighlight>
</syntaxhighlight>


=====Ajout de la variable MYSQL_SID=====
=====Adding the variable MYSQL_SID=====
Ajoutez la variable MYSQL_SID dans le ~/.profile ou ~/.bash_profile
Add the MYSQL_SID variable in the ~/.profile or ~/.bash_profile
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : mysql@my_mysql_host
# From : mysql@my_mysql_host
Line 304: Line 304:
</syntaxhighlight>
</syntaxhighlight>


====Test sendmail (non obligatoire)====
====Test sendmail (Non mandatory)====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
menu_mys TestSendmail GenLstInstanceNew
menu_mys TestSendmail GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>


====Test de connexion "manuel" à l'instance MySQL/MariaDB (connexion "locale")====
===="Manual" connection test to the MySQL/MariaDB instance ("local" connection)====
/!\ Uniquement que les instances qui seront en statut "ON" !
/!\ Only instances that will be in "ON" status!
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line># From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
menu_mys TestInstConnectionOnNoMail GenLstInstanceNew
menu_mys TestInstConnectionOnNoMail GenLstInstanceNew
</syntaxhighlight>
</syntaxhighlight>


===Procédure spécifique pour la partie "distante" (statut DIST)===
===Specific Procedure for the "Remote" Port (DIST Status)===


====Création d'un compte MySQL/MariaDB spécifique dbSQWare (Pour connexion distante)====
====Creating a Specific MySQL/MariaDB Account (dbSQWare) (For Remote Connections)====
Exemple pour une connexion "distante"
Example for a "Remote" Connection
<syntaxhighlight lang="sql" line>
<syntaxhighlight lang="sql" line>
grant all privileges on *.* to 'DBSDBA'@'%' IDENTIFIED BY 'NePasMettreCePassword!' with grant option;
grant all privileges on *.* to 'DBSDBA'@'%' IDENTIFIED BY 'DoNotSetThisPassword!' with grant option;


/* ou */
/* or */
create user 'DBSDBA'@'%' IDENTIFIED BY 'NePasMettreCePassword!';
create user 'DBSDBA'@'%' IDENTIFIED BY 'DoNotSetThisPassword!';
grant all privileges on *.* to 'DBSDBA'@'%' with grant option;
grant all privileges on *.* to 'DBSDBA'@'%' with grant option;
flush privileges;
flush privileges;
</syntaxhighlight>
</syntaxhighlight>


Vous pouvez mettre le nom et le mot de passe que vous souhaitez !<br/>
You can enter any username and password you like!<br/>
Ce compte devra être déclaré sur le compte unix mysql@sqwarebox ...<br/>
This account must be registered under the Unix account mysql@sqwarebox...<br/>
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
  vi /home/mysql/.passwd_mysql
  vi /home/mysql/.passwd_mysql
  DbAlias;UserName;Passwd;HostName;Port
  DbAlias;UserName;Passwd;HostName;Port
  MYS_APPLI_PRD;DBSDBA;NePasMettreCePassword!;srvdbmys01;3306
  MYS_INST_PRD;DBSDBA;DoNotSetThisPassword!;srvdbmys01;3306
</syntaxhighlight>
</syntaxhighlight>


====Test connexion "distante"====
====Test "remote" connection====
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
Line 344: Line 342:
</syntaxhighlight>
</syntaxhighlight>


==Mise en exploitation de l'instance==
==Starting the Instance==
===Génération de la configuration par défaut SQWareProduction===
===Generating the Default SQWareProduction Configuration===
/!\ Uniquement que les instances qui seront en statut "ON" !
/!\ Only instances that will be in "ON" status!
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
Line 352: Line 350:
</syntaxhighlight>
</syntaxhighlight>


===Mise à jour de SQWareRepository===
===Update SQWare Repository===
Dans le repository dbSQWare via la console d’administration, mettre à jour le statut de la nouvelle instance MySQL/MariaDB (à NEW actuellement) avec la valeur souhaitée (ON, DIST)
In the dbSQWare repository via the administration console, update the status of the new MySQL/MariaDB instance (currently NEW) to the desired value (ON, DIST).


===Test de "reprise" des indicateurs===
===Testing the "Recovery" of Indicators===
A ce moment là, vous pouvez tester la reprise des indicateurs manquants (en principe, uniquement les instances que vous venez d'intégrer !)
At this point, you can test the recovery of missing indicators (in principle, only the instances you have just integrated!).
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From : dbsqware@sqwarebox
# From : dbsqware@sqwarebox
## Pour les statuts "ON"
## for those with status "ON"
repind_mys
repind_mys
## Pour les statuts "DIST"
## for those with status "DIST"
repind_mys_dist
repind_mys_dist
</syntaxhighlight>
</syntaxhighlight>


===Exploitation (stats, backups, ) pour les instance "ON"===
===Operation (stats, backups, etc.) for "ON" instances===
====Génération des conf SQWareProduction====
====Generating SQWareProduction configs====
Si vous avez suivi la procédure d’insertion de l’instance, cette partie est déjà fait par l’étape "menu_mys GenDefConf_SQWareProduction GenLstInstanceNew".<br/>
If you followed the instance insertion procedure, this part is already done by step "menu_mys GenDefConf_SQWareProduction GenLstInstanceNew".<br/>
Vous pouvez vérifier avec le chapitre suivant.<br/>
You can check with the next chapter.<br/>
<br/>
<br/>
Se connecter à la machine qui porte l'instance « MySQL/MariaDB » et taper les commandes suivantes :<br/>
Connect to the machine that has the “MySQL/MariaDB” instance and type the following commands: <br/>
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
# From dbsqware@vmyswarebox
# From dbsqware@vmyswarebox
Line 388: Line 386:
A ce moment, vous avez généré les fichiers de configuration par défaut de SQWareProduction.
A ce moment, vous avez généré les fichiers de configuration par défaut de SQWareProduction.


====Explications====
====Explanations====
Les étapes précédentes ont créé certains fichiers par défaut. ($HOME/MYS_INST_PRD/sqwConfig)
The previous steps created some default files. ($HOME/MYS_INST_PRD/sqwConfig)
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
#Entrez le nom de l’instance
#Enter the instance name
e MYS_INST_PRD
e MYS_INST_PRD
cfg
cfg
Line 427: Line 425:
</syntaxhighlight>
</syntaxhighlight>


C’est un fichier de paramétrage qui est utilisé par le script sqwmys_RunJob.ksh pour exécuter des actions.<br/>
This is a configuration file used by the sqwmys_RunJob.ksh script to execute actions.<br/>
<br/>
<br/>
Fichier pour une cron par défaut $HOME/CrontabRef_MYS_INST_PRD :
File for a default cron job $HOME/CrontabRef_MYS_INST_PRD:
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
## mm(0-59) hh(0-23) dd(1-31) MM(0-12) DAY(0-sunday, 1-monday, ...) command
## mm(0-59) hh(0-23) dd(1-31) MM(0-12) DAY(0-sunday, 1-monday, ...) command
Line 449: Line 447:
</syntaxhighlight>
</syntaxhighlight>


====Mise en exploitation====
====Startup====
Mise en place de la cron :
Setting up cron:
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
mv $HOME/CrontabRef_MYS_INST_PRD $HOME/CrontabRef
mv $HOME/CrontabRef_MYS_INST_PRD $HOME/CrontabRef
Line 458: Line 456:
</syntaxhighlight>
</syntaxhighlight>


Mise à jour du fichier CrontabRef  :
Update the file CrontabRef  :
<syntaxhighlight lang="sh" line>
<syntaxhighlight lang="sh" line>
crontab -l > $HOME/CrontabRef
crontab -l > $HOME/CrontabRef
Line 464: Line 462:
</syntaxhighlight>
</syntaxhighlight>


====Commandes utiles====
====Useful commands====
alias intéressants :
alias :
e DBALIAS => source l'env pour l'instance
e DBALIAS => source env for the instance
bin, etc, too ... => pour aller dans arbo SQWareProduction standard
bin, etc, too ... => to go to the standard SQWareProduction tree
cbin, cetc, ctoo ... => pour aller dans arbo SQWareProduction custom
cbin, cetc, ctoo ... => to go to the custom SQWareProduction tree
log => logs SQWareProduction
log => SQWareProduction logs
dmp => on va dans les chemins de backup
dmp => go to the backup paths


Quelques options des scripts :
Some script options:
-h => aide en ligne
-h => online help
-s => exemples en ligne
-s => online examples
-Exec => lorsque elle est présente, si non settée ne sort que les commandes sans les exécuter
-Exec => when present; if not set, only outputs commands without executing them.


Exemples :
Examples :
  mysql@my_mysql_host:$HOME/admin/MYS_INST_PRD/logs/DumpAllDatabases (MYS_DBA_PRD) $ bin
  mysql@my_mysql_host:$HOME/admin/MYS_INST_PRD/logs/DumpAllDatabases (MYS_DBA_PRD) $ bin
  total 100
  total 100

Latest revision as of 14:12, 28 April 2025

Generalties


Warning:
Before anything, don't go further if you don't have read the first section "dbSQWare Concepts " !.

In this chapter, we will consider that SQWareCentral has been installed on dbsqware@sqwarebox.

Limits of this section

This chapter only deals with adding a new instance to a base that is already configured and functional.
Use the portions that apply to your environment, and choose either the automatic or manual method as desired

General operating procedure for integrating a new MySQL/MariaDB instance

There will potentially be one or two connection cases to handle.

  • "local" for Unix machines (or those with Cygwin) where you'll be running MySQL/MariaDB on the machine hosting the instance (SSH connection from dbsqware@sqwarebox).
  • "remote" for cases where you don't have SSH access to the machine (Windows, RDS, etc.).

Classic steps:

  • Setting up the environment
  • Checking system prerequisites for the "local" part (bash + rsync)
  • Manual tests
  • Deployment of the instance

You will see that these steps can be handled one by one or in batches!

Integration of an MySQL/MariaDB instance

Setting up the environment

General

Explanation of "DbAlias" (the unique dbSQWare key)

The dbSQWare key must be unique and consistent with what has been configured for the gvsqw_DbAlias variable in sqwmys_GlobalVar.cfg!
We'll use a variable, MYSQL_SID, which has no value for MySQL/MariaDB but will identify the instance in dbSQWare.
By convention, we often use MYS "_" APPLI "_" ENV.
Example: MYS_THISAPPS_PRD or MYS_THISOTHERAPPS_DEV ...
But nothing is imposed; you choose what "suits you"! You just need to set the MYSQL_SID variable in the MySQL account profile with the desired value.

Explanation of statuses
  • An "open" instance will be handled in "local" mode, meaning we will connect with mysql locally on the machine hosting the instance (ssh access from dbsqware@sqwarebox), status "ON".
  • An instance where we don’t have local unix access will be managed in "remote" mode (like Windows, RDS, ...), status "DIST".
  • The "OFF" status makes the instance "disappear" from the web view.
  • The "NEW" status is used as an intermediate status between the beginning and the end of setting up a new instance.
  • All other statuses allow the instance to be displayed in the repository (especially "KEEP") but will not be taken into account by the automatic processes.


Resume of statuses :

Status Description
ON locale under Unix (the most common)
DIST remote-only management
KEEP temporary status, during maintenance for example or before complete deletion
NEW temporary status, during configuration
OFF visual removal of the instance (without deleting its configuration)
XXX not supported...

Instance declaration in SQWareRepository with SQWareWeb

We will declare the new instance from the SQWareWeb administration interface.
Admin dbSQWare


Declare the new instance with the status "NEW" (Add or Duplicate).
Ajout d'une instance Ajout par duplication d'une instance
Add a new instance by duplicate an other one.
Explanation of the fields :

Fields Description
Db Alias Unique key that identifies the instance in dbSQWare (no value for MySQL/MariaDB).
Dbms Name Type of SGBD
Virtual Host Virtual Host (same as Host if not clustered)

.

Host Name Hostname of the instance
User Name User associated with the instance
Port Listening port of the instance.
Comments A brief description of what the instance hosts
Status Instance status (see above for explanations).
Contact A contact if needed
Environnement Instance environment (PRD, PPR, REC, DEV, TST, ...)
Client Used only for filtering (enter a client name and/or department and/or service...)
GlobalHost Free field in which the hypervisor host is often entered, for example.
Custom1 Free field 1
Custom2 Free field 2
Regenerate the reference files of SQWareCentral.

Type the following command which will generate the reference files:

# From : dbsqware@sqwarebox
gen_all

Specific procedure for the "local" part (status ON)

/!\ Only instances that will be in the "ON" status !

Verification of system prerequisites for the "local" part (bash + rsync)

Since SQWareProduction is mainly written in bash shell and synchronized from SQWareCentral using rsync, we therefore need "bash" and "rsync" to be installed !

Verification

Adapt to your username and machine name.

bash:

# From : mysql@my_mysql_host
type bash
#or
which bash

rsync:

# From : mysql@my_mysql_host
type rsync
#or
which rsync
Installation

Adapt to your machine type (use sudo if you are not root).

RedHat / CentOS / ... :

# From : root@my_mysql_host
yum install -y bash rsync
#or
dnf install -y bash rsync

Ubuntu / Debian / ... :

# From : root@my_mysql_host
apt install -y bash rsync

Unix user modification

Adapt to your machine type (sudo if you're not root). Modify the homedir (not mandatory, but avoids ending up in /var/lib/mysql):

# From : root@my_mysql_host
mkdir -p /home/mysql
chown mysql:mysql /home/mysql
chmod 750 /home/mysql
##Stop instance (service mysql/mariadb stop -- or -- systemctl stop mysql/mariadb)
usermod -d /home/mysql mysql -s /bin/bash
##Start instance (service mysql/mariadb start -- or -- systemctl start mysql/mariadb)

#Or directly vi /etc/passwd !
example : mysql:x:1004:989::/home/mysql:/bin/bash

Assign a passwd to the mysql user (otherwise the key exchange connection will not work!):

# From : root@my_mysql_host
passwd mysql

Creating a specific MySQL/MariaDB account for dbSQWare (for local connection)

Adapt to your needs depending on what you want to do...

Example for local connection :

grant all privileges on *.* to 'DBSDBA'@'localhost' IDENTIFIED BY 'DoNotSetThisPassword!' with grant option;

/* or */
create user 'DBSDBA'@'localhost' IDENTIFIED BY 'DoNotSetThisPassword!';
grant all privileges on *.* to 'DBSDBA'@'localhost' with grant option;
# From : mysql@my_mysql_host
#Then, create the .my.cnf file to allow connection without using passwd
echo "[client]
password = DoNotSetThisPassword!
" >> $HOME/.my.cnf
chmod 600 $HOME/.my.cnf

Deployment of SSH key(s) from SQWareCentral to the target machine(s)

There are two ways to proceed:

  • An automatic one (from dbsqware@sqwarebox, but it requires you to know the password of the mysql Unix account)
  • A manual one that you apply on each mysql Unix account

/!\ The password of your mysql Unix account must have been initialized, otherwise key-based authentication will not work!

Deployment of SSH key(s): batch method
# From : dbsqware@sqwarebox
menu_mys GenDeplSshKeys_SQWareCentral GenLstInstanceNew

Verify that this is indeed the list you want to deploy, then choose option 1 ...
=> Enter the Unix password when prompted !

Deployment of SSH key(s): manual method
# From : mysql@my_mysql_host
if [ ! -r $HOME/.ssh/id_rsa ]
then
ssh-keygen -t rsa -N ''''''' -f $HOME/.ssh/id_rsa
fi
chmod go-w $HOME
echo "ssh-rsa AAAAB......XSPpdV11 dbsqware@sqwarebox" >>$HOME/.ssh/authorized_keys
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys

=> Put the correct key in the "echo" (the one from dbsqware@sqwarebox)

SSH connection test from SQWareCentral

# From : dbsqware@sqwarebox
menu_mys TestSshConnection GenLstInstanceNew

Test of prerequisites on the target host (bash+rsync) via SSH from SQWareCentral

# From : dbsqware@sqwarebox
menu_mys TestSysPrerequisites GenLstInstanceNew

Deployment of SQWareProduction

# From : dbsqware@sqwarebox

#If deployment on "unique" user
menu_mys DeplScripts GenLstUniqueNew

#If deployment on "instance" user, the one specified in SQWareRepository
menu_mys DeplScripts GenLstInstanceNew

For "unique" user, it is the "standard" user. By default, we set it to "mysql", and it can be modified in SQWareCentral.

Adding the dbSQWare environment to ~/.profile or ~/.bash_profile

Once again, there are two ways to proceed:

  • An automatic one (from dbsqware@sqwarebox)
  • A manual one that you apply on each mysql Unix account
Adding the dbSQWare environment: batch method
# From : dbsqware@sqwarebox
menu_mys AdddbSQWareProfile GenLstInstanceNew

Check that this is indeed the list you want to deploy, then choose 1 ...
=> In ~/.profile or ~/.bash_profile, change the following variable with the appropriate value: gvsqw_Env='XXX'

Adding the dbSQWare environment: manual method

Add the following lines to ~/.profile or ~/.bash_profile

# From : mysql@my_mysql_host

#dbSQWare
export gvsqw_MysBin=$HOME/SQWareProduction/mysql/bin
export gvsqw_Env='PRD'
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_MysBin/../etc/.profile_confort ]
then
. $gvsqw_MysBin/../etc/.profile_confort
fi
Adding the variable MYSQL_SID

Add the MYSQL_SID variable in the ~/.profile or ~/.bash_profile

# From : mysql@my_mysql_host
export MYSQL_SID=MYS_INST_PRD

Test sendmail (Non mandatory)

# From : dbsqware@sqwarebox
menu_mys TestSendmail GenLstInstanceNew

"Manual" connection test to the MySQL/MariaDB instance ("local" connection)

/!\ Only instances that will be in "ON" status!

# From : dbsqware@sqwarebox
menu_mys TestInstConnectionOnNoMail GenLstInstanceNew

Specific Procedure for the "Remote" Port (DIST Status)

Creating a Specific MySQL/MariaDB Account (dbSQWare) (For Remote Connections)

Example for a "Remote" Connection

grant all privileges on *.* to 'DBSDBA'@'%' IDENTIFIED BY 'DoNotSetThisPassword!' with grant option;

/* or */
create user 'DBSDBA'@'%' IDENTIFIED BY 'DoNotSetThisPassword!';
grant all privileges on *.* to 'DBSDBA'@'%' with grant option;
flush privileges;

You can enter any username and password you like!
This account must be registered under the Unix account mysql@sqwarebox...

 vi /home/mysql/.passwd_mysql
 DbAlias;UserName;Passwd;HostName;Port
 MYS_INST_PRD;DBSDBA;DoNotSetThisPassword!;srvdbmys01;3306

Test "remote" connection

# From : dbsqware@sqwarebox
menu_mys TestInstConnectionDistNoMail GenLstInstanceNew

Starting the Instance

Generating the Default SQWareProduction Configuration

/!\ Only instances that will be in "ON" status!

# From : dbsqware@sqwarebox
menu_mys GenDefConf_SQWareProduction GenLstInstanceNew

Update SQWare Repository

In the dbSQWare repository via the administration console, update the status of the new MySQL/MariaDB instance (currently NEW) to the desired value (ON, DIST).

Testing the "Recovery" of Indicators

At this point, you can test the recovery of missing indicators (in principle, only the instances you have just integrated!).

# From : dbsqware@sqwarebox
## for those with status "ON"
repind_mys
## for those with status "DIST"
repind_mys_dist

Operation (stats, backups, etc.) for "ON" instances

Generating SQWareProduction configs

If you followed the instance insertion procedure, this part is already done by step "menu_mys GenDefConf_SQWareProduction GenLstInstanceNew".
You can check with the next chapter.

Connect to the machine that has the “MySQL/MariaDB” instance and type the following commands:

# From dbsqware@vmyswarebox
c MYS_INST_PRD
#Source de l'env si multi-instance (from mysql@my_mysql_host)
e MYS_INST_PRD
too
./sqwmys_GenerateCreateInstance.ksh -dbsOnly

Vérifier que ce qui est proposé est bon et tapez « y » si c’est le cas.
A ce moment, vous avez généré les fichiers de configuration par défaut de SQWareProduction.

Explanations

The previous steps created some default files. ($HOME/MYS_INST_PRD/sqwConfig)

#Enter the instance name
e MYS_INST_PRD
cfg
cat sqwmys_Jobs.cfg
#############################################
#IndicDba: Gather DBAs indicators
IndicDba:$gvsqw_MysBin/sqwmys_GatherIndicators.ksh -I MYS_INST_PRD

#Dump: backup all databases with mysqlDump
Dump:$gvsqw_MysBin/sqwmys_DumpAllDatabases.ksh -I MYS_INST_PRD -Exec

#Optimize : optimize tables for all databases
Optimize:$gvsqw_MysBin/sqwmys_OptimizeAllDatabases.ksh -I MYS_INST_PRD -Exec

#Analyse : analyze tables for all databases
Analyze:$gvsqw_MysBin/sqwmys_AnalyzeAllDatabases.ksh -I MYS_INST_PRD -Exec

#XtraFull: Backup full with XtraBackup
XtraFull:$gvsqw_MysBin/sqwmys_XtraBackup.ksh -I MYS_INST_PRD -Type full -Exec

#XtraInc: Backup incremental with XtraBackup
XtraInc:$gvsqw_MysBin/sqwmys_XtraBackup.ksh -I MYS_INST_PRD -Type inc -Exec

#MariaFull: Backup full with MariaBackup
MariaFull:$gvsqw_MysBin/sqwmys_MariaBackup.ksh -I MYS_INST_PRD -Type full -Exec

#MariaInc: Backup incremental with MariaBackup
MariaInc:$gvsqw_MysBin/sqwmys_MariaBackup.ksh -I MYS_INST_PRD -Type inc -Exec

#PurgeAlert: Rotate error log
PurgeAlert:$gvsqw_MysBin/sqwmys_PurgeAlert.ksh -I MYS_INST_PRD

This is a configuration file used by the sqwmys_RunJob.ksh script to execute actions.

File for a default cron job $HOME/CrontabRef_MYS_INST_PRD:

## mm(0-59) hh(0-23) dd(1-31) MM(0-12) DAY(0-sunday, 1-monday, ...) command
## MYS_INST_PRD
#Purge alert
00 08 * * 0 bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A PurgeAlert > $HOME/tmp/PurgeAlert_MYS_INST_PRD.log 2>&1'
# Dump
00 20 * * * bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A Dump > $HOME/tmp/Dump_MYS_INST_PRD.log 2>&1'
# Optimize
00 04 * * 6 bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A Optimize > $HOME/tmp/Optimize_MYS_INST_PRD.log 2>&1'
# Analyze
00 05 * * 6 bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A Analyze > $HOME/tmp/Analyze_MYS_INST_PRD.log 2>&1'
# XtraBackup
#00 21 * * 6   bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A XtraFull > $HOME/tmp/XtraFull_MYS_INST_PRD.log 2>&1'
#00 21 * * 1-5 bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A XtraInc > $HOME/tmp/XtraInc_MYS_INST_PRD.log 2>&1'
# MariaBackup
#00 21 * * 6   bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A MariaFull > $HOME/tmp/MariaFull_MYS_INST_PRD.log 2>&1'
#00 21 * * 1-5 bash -c '. $HOME/.profile MYS_INST_PRD;$gvsqw_MysBin/sqwmys_RunJob.ksh -I MYS_INST_PRD -A MariaInc > $HOME/tmp/MariaInc_MYS_INST_PRD.log 2>&1'

Startup

Setting up cron:

mv $HOME/CrontabRef_MYS_INST_PRD $HOME/CrontabRef
vi $HOME/CrontabRef
crontab $HOME/CrontabRef
crontab -l

Update the file CrontabRef  :

crontab -l > $HOME/CrontabRef
cat $HOME/CrontabRef

Useful commands

alias : e DBALIAS => source env for the instance bin, etc, too ... => to go to the standard SQWareProduction tree cbin, cetc, ctoo ... => to go to the custom SQWareProduction tree log => SQWareProduction logs dmp => go to the backup paths

Some script options: -h => online help -s => online examples -Exec => when present; if not set, only outputs commands without executing them.

Examples :

mysql@my_mysql_host:$HOME/admin/MYS_INST_PRD/logs/DumpAllDatabases (MYS_DBA_PRD) $ bin
total 100
drwxr-x---  2 dbsqware dba 4096 Sep  6 14:09 .
drwxr-x--- 15 dbsqware dba  187 Aug 16 15:50 ..
-rwxr-x---  1 dbsqware dba 2957 Aug 16 15:50 sqwmys_AnalyzeAllDatabases.ksh
-rwxr-x---  1 dbsqware dba 2514 Aug 16 15:50 sqwmys_AnalyzeDatabase.ksh
-rwxr-x---  1 dbsqware dba 2608 Aug 16 15:50 sqwmys_CheckAllDatabases.ksh
-rwxr-x---  1 dbsqware dba 2257 Aug 16 15:50 sqwmys_CheckDatabase.ksh
-rwxr-x---  1 dbsqware dba 5418 Aug 16 15:50 sqwmys_CopyDumpAllDatabases.ksh
-rwxr-x---  1 dbsqware dba 5324 Aug 16 15:50 sqwmys_CopyDumpDatabase.ksh
-rwxr-x---  1 dbsqware dba 5610 Sep  6 10:45 sqwmys_CopyMariaBackup.ksh
-rwxr-x---  1 dbsqware dba 5594 Sep  6 14:08 sqwmys_CopyXtraBackup.ksh
-rwxr-x---  1 dbsqware dba 3248 Aug 16 15:50 sqwmys_DumpAllDatabases.ksh
-rwxr-x---  1 dbsqware dba 3541 Aug 16 15:50 sqwmys_DumpDatabase.ksh
lrwxrwxrwx  1 dbsqware dba   36 Jan  2  2022 sqwmys_ExecSQL.ksh -> ../../generic/bin/sqwgen_ExecSQL.ksh
-rwxr-x---  1 dbsqware dba 2455 Aug 16 15:50 sqwmys_GatherIndicators.ksh
-rwxr-x---  1 dbsqware dba 2454 Aug 16 15:50 sqwmys_GatherStructure.ksh
-rwxr-x---  1 dbsqware dba 3043 Aug 16 15:50 sqwmys_MariaBackup.ksh
lrwxrwxrwx  1 dbsqware dba   38 Jan  2  2022 sqwmys_NetBackup.ksh -> ../../generic/bin/sqwgen_NetBackup.ksh
-rwxr-x---  1 dbsqware dba 2959 Aug 16 15:50 sqwmys_OptimizeAllDatabases.ksh
-rwxr-x---  1 dbsqware dba 2522 Aug 16 15:50 sqwmys_OptimizeDatabase.ksh
lrwxrwxrwx  1 dbsqware dba   40 Jan  2  2022 sqwmys_ParallelRun.ksh -> ../../generic/bin/sqwgen_ParallelRun.ksh
-rwxr-x---  1 dbsqware dba 2252 Aug 16 15:50 sqwmys_PurgeAlert.ksh
-rwxr-x---  1 dbsqware dba 3855 Aug 16 15:50 sqwmys_RestoreAllDatabases.ksh
-rwxr-x---  1 dbsqware dba 3463 Aug 16 15:50 sqwmys_RestoreDatabase.ksh
-rwxr-x---  1 dbsqware dba 3825 Aug 16 15:50 sqwmys_RotateLogSlowQuery.ksh
lrwxrwxrwx  1 dbsqware dba   40 Jan  2  2022 sqwmys_RsyncBackup.ksh -> ../../generic/bin/sqwgen_RsyncBackup.ksh
lrwxrwxrwx  1 dbsqware dba   35 Jan  2  2022 sqwmys_RunJob.ksh -> ../../generic/bin/sqwgen_RunJob.ksh
-rwxr-x---  1 dbsqware dba 3025 Aug 16 15:50 sqwmys_XtraBackup.ksh
mysql@my_mysql_host:$HOME/SQWareProduction/mysql/bin (MYS_INST_PRD) $ 
./sqwmys_DumpAllDatabases.ksh -h

Sourcing sqwmys_Global.lib v2023.06 SQWareProduction for MySQL (dbSQWare) ...

Usage: sqwmys_DumpAllDatabases.ksh [-h] -I instance [+ options]

DESCRIPTION
   sqwmys_DumpAllDatabases.ksh dump databases in parallel
SUPPORT
   MySql   supported versions: 5.0 <= v <= 8
   MariaDB supported versions: 5.5 <= v <= 11.6

PARAMETERS
     -I  instance       : Target instance to mysqldump.
OPTIONS
     -h  help           : Display the full usage.
     -s                 : Display samples of usage.
     -P  Nb threads     : Number of threads in parallel (by default 2).
     -RD directory      : Directory to write dump file (default /backups/mysql/$MYSQL_SID).
     -ID listdb         : List of databases to be dumped (by default all).
     -ED listdb         : List of databases to exclude from dump.
     -IL likeclause     : Like clause to generate databases list (example: 'db%').
     -EL likeclause     : Like clause to exclude databases (example: 'nodb%').
     -HI Nb_Generations : Number of generations to keep (by default 2).
     -WCD  whereclause  : Where clause to generate databases list.
     -AGR  Nb sec       : Nb of seconds between two runs (by default 1s).
     -AGE  Nb sec       : Nb of seconds between two checks of end (by default 10s).
     -FRT  return_code  : Force return code value on error.
     -Opt  option       : Additional options for mysqldump.
     -Dist              : For distant connection to database (change $gvsqw_ConnectString to $gvsqw_DistConnectString ).
     -AddMail email     : Email address to add at 'xxx'.
     -SendReport        : Send execution log report.
     -NoMail            : Deactivate sendmail on error xxx (by default, send on error).
     -Locale   locale   : Force Locale for help display (fr,en).
     -Consistent        : Lock for consistent mode (by default, no lock).
     -Exec              : Execute commands (default, display generated commands)


Enjoy !