Initial Configuration

  1. Start the MySQL server:
    # /etc/init.d/mysqld start 
  2. Set a password for the MySQL root user.
    Note: MySQL passwords cannot contain the reserved character &.
    # mysqladmin -u root password <new password>
  3. Log into MySQL and create a new database and schema for use with MapR Metrics.
    # mysql -u root -p 
    Enter password:
    mysql> CREATE DATABASE metrics;
    mysql> SHOW DATABASES;
  4. Create a 'maprmetrics' user, grant the user privileges, and verify that the user has the granted privileges. For remote SQL servers, provide the following grants:
    mysql> CREATE user 'maprmetrics'@'%' IDENTIFIED BY 'mapr';
    mysql> grant all privileges on metrics.* to 'maprmetrics'@'%' with grant option;
    mysql> show grants for 'maprmetrics'@'%';
    For SQL servers on a local node with the metrics role installed, provide the following grants:
    mysql> CREATE user 'maprmetrics'@'%' IDENTIFIED BY 'mapr';
    mysql> CREATE user 'maprmetrics'@'localhost' IDENTIFIED BY 'mapr';
    mysql> grant all privileges on metrics.* to 'maprmetrics'@'%' with grant option;
    mysql> grant all privileges on metrics.* to 'maprmetrics'@'localhost' with grant option;
    mysql> show grants for 'maprmetrics'@'%';
    mysql> show grants for 'maprmetrics'@'localhost';
  5. Create the maprmetrics schema.
    # mysql -u maprmetrics -h <hostname or IP where the SQL server is running> -p -vvv < /opt/mapr/bin/setup.sql > /opt/mapr/logs/setup_sql_results.txt
  6. Restart the hoststats service.
    # maprcli node services -name hoststats -action restart -filter '[csvc==hoststats]'
Note: The MapR Metrics database uses the InnoDB table storage engine by default. The Metrics database uses transactional tables, which require a storage engine that supports locking to prevent data corruption. To change the storage engine, edit the following line in the setup.sql script: SET storage_engine='InnoDB';

To display a list of the available storage engines, issue the SHOW ENGINES command from the mysql> prompt.