Instance admin directory
dbi services advices storing MariaDB database admin directories under /u01/app/mysql/admin (${MYSQL_BASE}/admin). For each MariaDB server parameters referring to the database admin directory should point to: ${MYSQL_BASE}/admin, as for example the socket file location (see my.cnf below).
Each directory which cannot be located under /u00 due to lack of space for instance (i.e. binary log directory), should be moved to another filesystem but a soft link must be created from /u00/app/mysql/admin/${MYSQL_SERVER} to this directory, see below:
Because all parameters in the MySQL server configuration file (my.cnf) refer to the same directory structure (${MYSQL_BASE}) maintenance efforts will be reduced.
The admin directory also contains the following directories:
binlog
This directory contains the binary log files (ideally a link to a directory in another mount point of the OFA structure)
backup
This directory contains the MySQL server backups (ideally a link to a directory in another mount point of the OFA structure)
dump
This directory contains the mysqldump files (ideally a link to a directory in another mount point of the OFA structure)
create
MySQL server creation scripts
log
MySQL log directory (general log, slow query log, aso ...)
socket
Socket file and PID file
file .my.cnf
File containing MySQL server user, password and socket location allowing to administrate and operate the MySQL server (start/stop for instance)
sql
Instance specific SQL scripts
The hidden file: .my.cnf
The admin directory of each server should also contain the ".my.cnf" hidden file. This file hosts the [client] section. Each MariaDB server should have its own .my.cnf hidden file. It allows to connect directly to MariaDB server when using the mysql utility. This can be achieved without providing a password. In addition to this file, it is recommended to create an alias (i.e. mq) making the connection quite easy.
Hidden File .my.cnf :
Use the "chmod 600 .my.cnf" statement to change the permissions accordingly.
Use the "chmod 600 .my.cnf" statement to change the permissions accordingly.
The alias "mq" can be defined with the following statement in order to connect directly to the "mysql" server using the socket file and the root user :
MariaDB server ports
Usually a MariaDB server is started on the TCP port 3306. since the dbi services MariaDBB operating concept allows to operate several releases and also several MariaDB servers on the same physical server a concept had to be defined to bind different ports. On UNIX/Linux the "ps" command extended by grep would easily allow to identify the port number and therefore the server which is really started (see below for an example).
The port range proposed by dbi services should be:
Free in the list of TCP services already defined
Fitting to the IPV4 port ranges which is limited to 65535. Some MySQL tools could be confronted with this issues and could not connect to the server if the ports are higher than 65535
Recognizable as a MySQL-server like port
The proposed port range for MariaDB servers starts from 33001 to 33999 (assuming that about 999 servers could be started on the same server). This range is:
free in /etc/services
below 65535
recognizable, since it starts with the prefix "33"
The my.cnf file therefore looks like:
The following alias performs a grep on the "ps -ef" ouput in order to present all MariaDB servers currently up and running.
Last updated