Databases

Documentation / C# Edition / User Guide / Databases
 

MyARM supports different databases to store and retrieve ARM data. This section describes the basic setup and configuration for each database.

SQLite database

The simplest and easy to use database is the SQLite database which 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';

Since MyARM version 1.3 the MySQL database configuration is split into three new properties which defines specific databases for definition data, application instance data and transaction instance data.

These new database configuration properties should be used in production environments with 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.

By default the MyARM MySQL configuration uses the myarm user with no password. It is recommended that you create such a MySQL user and according to your security standards change the password. 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 (New since "2.1.x.0")
number of concurrent connections to the MySQL database server.

Default and minimum is 1. Maximum is 8.

<name>.reconnect
defines an interval value in seconds to wait before MyARM retries to connect to the MySQL database process again.

Default is 30 second.

<name>.database.config (New since "2.0.x.0")
Database name to store MyARM web 2.0 configuration data.

Default is MyARM_Config.

<name>.database.definition
Database name to store ARM definition data such as application and transaction definitions which are also called meta data.

Default is MyARM_Def.

<name>.database.application
Database name to store ARM application instance data such as application instances and application context values.

Default is MyARM_App.

<name>.database.transaction
Database name to store 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 time stamp . For this purpose the transaction database name can contain '%'patterns which are replaced by appropriate values of 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 (New since "3.0.x.0")
] Database name to store real time statistics data.

Default is MyARM_RTS.

<name>.database.rtevent (New since "4.0.x.0")
Database name to store runtime events used to trigger notification actions.

Default is MyARM_RTEvent.

<name>.engine
MySQL storage engine to use for the database name.

Default is INNODB .

The following example configures a MySQL datasink where the database runs on host dbhost, the database name is MyARM. The MySQL user is set to the user logged in:

# 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 = 30
# 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

Also MyARM provides its own compiled mysql client library. If you have problems connecting to the MySQL database it is possible that your MySQL installation uses another connecting socket as 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.