Configuring MySQL for Streaming Components

If you intend to use MySQL to store the metadata for Streams Messaging Manager or Schema Registry, you must configure the MySQL database.

Configure the database to store:
  • In Schema Registry, the schemas and their metadata, all the versions and branches.
  • In SMM, the Kafka metadata, stores metrics, and alert definitions.
.
  1. Log in to the host.
    1. Run the following command for Schema Registry:
      ssh [MY_SCHEMA_REGISTRY_HOST]
    2. Run the following command for Streams Messaging Manager:
      ssh [MY_STREAMS_MESSAGING_MANAGER_HOST]
  2. Launch the MySQL monitor:
    mysql -u root -p
  3. Create the database for the Schema Registry and the SMM metastore:
    
    create database registry;
    create database streamsmsgmgr;
    
  4. Create Schema Registry and SMM user accounts, replacing the final IDENTIFIED BY string with your password:
    
    CREATE USER 'registry'@'%' IDENTIFIED BY 'R12$%34qw';
    CREATE USER 'streamsmsgmgr'@'%' IDENTIFIED BY 'R12$%34qw';
    
  5. Assign privileges to the user account:
    
    GRANT ALL PRIVILEGES ON registry.* TO 'registry'@'%' WITH GRANT OPTION ;
    GRANT ALL PRIVILEGES ON streamsmsgmgr.* TO 'streamsmsgmgr'@'%' WITH GRANT OPTION ;
    
    If you cannot grant all privileges, grant the following privileges that SMM and Schema Registry require at a minimum:
    • CREATE/ALTER/DROP TABLE
    • CREATE/ALTER/DROP INDEX
    • CREATE/ALTER/DROP SEQUENCE
    • CREATE/ALTER/DROP PROCEDURE
    For example:
    grant create session to streamsmsgmgr;
    grant create table to streamsmsgmgr;
    grant create sequence to streamsmsgmgr;
    
  6. Commit the operation:
    commit;