Configure PostgreSQL for Streaming Components

If you are installing Schema Registry or Streams Messaging Manager (SMM), you must configure the database to store metadata.

After you install PostgreSQL, configure the database to store:
  • Schema Registry data such as the schemas and their metadata, all the versions and branches.
  • SMM data such as Kafka metadata, stores metrics, and alert definitions.
.
  1. Log in to Postgres:
    
    sudo su postgres
    psql
    
  2. For the Schema Registry metadata store, create a database called registry with the password registry:
    
    create database registry;
    CREATE USER registry WITH PASSWORD 'registry';
    GRANT ALL PRIVILEGES ON DATABASE "registry" to registry;
    
  3. For the SMM metadata store, create a database called streamsmsgmgr with the password streamsmsgmgr:
    
    create database streamsmsgmgr;
    CREATE USER streamsmsgmgr WITH PASSWORD 'streamsmsgmgr';
    GRANT ALL PRIVILEGES ON DATABASE "streamsmsgmgr" to streamsmsgmgr;
    
    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;