Creating a user and schema

Attention

 

To deploy Kognitio on MapR systems we now recommend using Containerized Kognitio .

Therefore the “Kognitio on MapR” product is no longer available to new users.

Existing users can still receive updates via support channels. Please contact us via the community forum or our support portal if you want to migrate to a containerized deployment.

 

When you first connect to Kognitio you must do so as the SYS user. This is the default administration account that Kognitio creates during installation.

1. Create a user and schema.

It is best practice to create a user and schema rather than continuing to connect as the ‘SYS’ user.

You can create them with just one SQL command. Let’s create a user called demo_ret_user and a schema called demo_ret. We’ll use these throughout this tutorial:

CREATE USER demo_ret_user PASSWORD "MyPassword" SCHEMA demo_ret;

You can run this from the command line or Kognitio Console.

2. Grant demo_ret_user privileges to use the Map-FS connector.

It is best practice to manage privileges using groups. During the installation the MapR-FS connector was created along with a group (grp_maprfs) with the privileges to use it. Add the demo_ret_user to this group:

ALTER GROUP grp_maprfs ADD USER demo_ret_user;

This grants demo_ret_user the necessary privileges to use the MapR-FS connector to access data from the MapR-FS file system. Other users can be given the same access by adding them to the grp_maprfs GROUP as required.

3. Log in as the new user.

Log out of the SYS account on Kognitio. Then log back in using the demo_ret_user. You will be prompted for the password you gave in the CREATE USER statement. If you used double quotation marks (“”) as above, the password is case sensitive.

Note

You might notice that demo_ret_user has privileges to CREATE, DROP,SELECT FROM, and VIEW objects in the demo_ret schema.

These default privileges are automatically granted on the demo_ret schema created in the same SQL statement as the demo_ret_user during step 1.

These privileges allow you to create and drop Kognitio internal tables in the demo_ret schema. For Kognitio standalone and on AWS these are stored on local disk. In Kognitio on Hadoop these are stored in the HDFS file system allocated to the Kognitio cluster when it was created by YARN. In Kognitio on MapR these are stored on the MapR-FS volumes created on the nodes during installation.

Next: Creating tables

A note on best practice for the administration of users, groups, and privileges

To allow for easy administration as the number of users on Kognitio grows, it is best practice to administer privileges at the group (AKA role) level, not for each individual user. You can change group privileges and add or remove users to groups as required:

  1. Create a group.

  2. Assign privileges to the group.

  3. Create users.

  4. Add users to the group.