Databases
MyARM supports several databases for storage and retrival of ARM data. This section describes the basic setup and configuration for each database.
SQLite database
SQLite is a simple and easy to use database. It provides a complete SQL database by using just a single data file. The file used for storing all ARM data can be configured using MyARM configuration properties as described below.
<name>.type
- database type which has to be
sqlite3
. <name>.file
- specifies the path and name for SQLite database file.
Default is ${MYARM_VARLIB_DIR}/myarm_sqlite.db
# agent uses a datasink named db_sqlite agent.sink.name = db_sqlite # analysis tools uses also the sqlite3 database tools.source.name = db_sqlite # define the type of the database db_sqlite.type = sqlite3 # define the SQLite database file db_sqlite.file = /opt/myarm/var/sqlite.db
MySQL database
For production use a MySQL database can be used to store all ARM data. The database has to be setup correctly. To setup correct databases and tables within MySQL, use the myarminitdb.
Note that the configured MySQL database user needs the appropriate privileges to create the MyARM databases. Please use the following SQL statement to grant the privileges:
someuser@localhost: mysql -u root
GRANT ALL PRIVILEGES ON *.* TO 'someuser'@'localhost';
The MySQL database configuration is split into six database properties defining specific databases for definition data, application instance data, transaction instance and derived runtime data.
These database configuration properties should be used in production environments with a high number of transaction measurements. Therefore the tentative static data like ARM definitions can be separated from the highly dynamic data like transaction measurements, context and metrics values.
For a detailed description of MySQL insert performance please read the appendix Using MySQL.
By default the MyARM MySQL configuration uses the
myarm user with no password. It is recommended that you
create such a MySQL user and change the password according to your
security standards. All changes should be written into the
user.conf
file, which will override any standard
configuration property.
To configure the MySQL database within MyARM the following properties are used:
<name>.user
- database user name.
Default is an empty string ("").
<name>.password
- password for the database user.
Default is an empty string ("").
<name>.host
- host where the database is running.
Default is localhost.
<name>.port
- port number on which the MySQL server listens for
incoming connections.
Default is 3306.
<name>.connections
- number of concurrent connections to the MySQL database
server.
Default and minimum is 1, maximum is 16.
Note: The configuration is only used if Multiple database connections (MDB) Add-on is licensed.
<name>.reconnect
- defines an interval value in seconds to wait before MyARM
retries to connect to the MySQL database process again.
Default is 30s (30 seconds), minimum is 10s (10 seconds), maximum is 5m (5 minutes).
<name>.database.config
- Database for the storage of MyARM web 2.0 configuration
data.
Default is MyARM_Config.
<name>.database.definition
- Database for the storage of ARM definition data such as
application and transaction definitions which are also called meta
data.
Default is MyARM_Def.
<name>.database.application
- Database for the storage of ARM application instance data
such as application instances and application context
values.
Default is MyARM_App.
<name>.database.transaction
- Database for the storage of ARM transaction instance data
such as transaction measurements, transaction properties and
metrics as well as transaction correlation information.
Default is MyARM_Tran.
The MySQL datasink supports on-the-fly generation of transaction databases according to the transaction timestamp. For this purpose the transaction database name can contain '
%
'patterns which are replaced by appropriate values from the transaction to store. The following patterns are supported:- '
%d
' - is replaced by the two digit day of the month
('
DD
' the transaction started. - '
%m
' - is replaced by the two digit month of the year
('
MM
' the transaction started. - '
%y
' - is replaced by the two digit year ('
YY
' the transaction started. - '
%Y
' - is replaced by the four digit year ('
YYYY
' the transaction started.
# define the database name where to store MyARM web config data db_mysql.database.config = MyARM_Date_Config # define the database name where to store the definition data db_mysql.database.definition = MyARM_Date_Def # define the database name where to store the application data db_mysql.database.application = MyARM_Date_App # define the database name where to store the transaction data db_mysql.database.transaction = MyARM_Date_%Y%m%d_Tran
- '
<name>.database.rts
- Database for the storage of real time statistics
data.
Default is MyARM_RTS.
<name>.database.rtevent
(New since "4.0.x.0")- Database for the storage of runtime events used to trigger
notification actions.
Default is MyARM_RTEvent.
<name>.engine
- MySQL storage engine to use for the database.
Default is INNODB.
The following example configures a MySQL datasink where the database runs on host dbhost and the database name is MyARM. The MySQL user is set to the user myarm:
# agent uses a datasink named db_mysql agent.sink.name = db_mysql # define the type of the datasink db_mysql.type = mysql # define the host where the MySQL database runs db_mysql.host = dbhost # number of concurrent connections to MySQL database db_mysql.connections = 4 # the reconnect interval for reconnecting to the database in seconds db_mysql.reconnect = 30s # define the user to log into the database db_mysql.user = myarm # define the database name where to store the MyARM web config data db_mysql.database.definition = MyARM_Config # define the database name where to store the ARM definition data db_mysql.database.definition = MyARM_Def # define the database name where to store the ARM application data db_mysql.database.application = MyARM_App # define the database name where to store the ARM transaction data db_mysql.database.transaction = MyARM_Tran # define the database name where to store the RTS data db_mysql.database.rts = MyARM_RTS # define the database name where to store the runtime events db_mysql.database.rtevent = MyARM_RTEvent # set the default storage engine for creating tables db_mysql.engine = INNODB
MyARM also provides its own compiled mysql client library.
If you have problems connecting to the MySQL database it is
possible that your MySQL installation uses connecting socket
different from the library provided (by the MyARM distribution). By
default, MySQL searches for a connection socket named
/tmp/mysql.sock
in Unix environments. If your server
uses a different path please setup the MYSQL_UNIX_PORT
variable correctly.
MariaDB database
Since MariaDB is a binary drop in replacement of the same MySQL version, we support MariaDB 5.5 to be used instead of a MySQL database. Just use the appropriate MySQL configuration files and properties as described above.