1 Administering Oracle Stream Analytics

Administering Oracle Stream Analytics is essential to get the required results.

The tasks listed in this chapter can only be performed by a user who has the administrator privileges.

Managing Users in Oracle Stream Analytics

After you install Oracle Stream Analytics, it is important to setup and manage users who can use the application.

In this release of Oracle Stream Analytics, user details are stored in a database. When you create Oracle Stream Analytics schema at the time of installation, the following database tables are populated with one record in each table:

  • osa_users — table containing the users

  • osa_user_roles — table containing the user names and their associated roles

When you execute a query to pull in all the data from the osa_users table, you can see the following:

select * from osa_users;
+----+----------+--------------------------------------+ 
| id | username | pwd                                  | 
+----+----------+--------------------------------------+ 
|  1 | osaadmin | MD5:201f00b5ca5d65a1c118e5e32431514c | 
+----+----------+--------------------------------------+ 

where osaadmin is the pre-configured user along with the encrypted password.

When you execute a query to pull in all the data from the osa_user_roles table, you can see the following:

select * from osa_user_roles;
+---------+---------+
| user_id | role_id |
+---------+---------+
|       1 |       1 |
+---------+---------+

where role_id of value 1 indicates that the user is an administrator.

Adding Users

Though you can continue using Oracle Stream Analytics through the pre-configured user, it is a best practice to create your own users and delete the default pre-configured user.

When you add a user, it is highly recommended, though not mandatory, to obfuscate or encrypt the password. You can use the utility provided with the application server (Jetty) to encrypt the password.

Add Users Through User Interface

You can add/create users through the Oracle Stream Analytics application user interface.

To add a new user:

  1. Go to System Settings.

  2. Under the User Management tab, click Add user.

  3. Enter details in the Username, Password, and Confirm Password fields and click Create Make sure that you provide the same value in both Password and Confirm Password fields.

    You can see the new user along with the predefined user in the list of available users.

Repeat these steps for as many users as you need based on your requirement. If you try a user with the same name as that of an existing user, an error A user profile with the user name <username> already exists. Please specify another user name. pops up.

Add Users Through Code

To add a new user:

  1. Open a terminal and navigate to OSA-18.1.0.0.1.
    This is top-level folder in the folder where you have extracted your zip installer.
  2. Execute the following command:
    java -cp ./lib/jetty-util-9.4.7.v20170914.jar org.eclipse.jetty.util.security.Password NewUser <password>

    where NewUser is the name if the user <password> is the password that you want to obfuscate or encrypt.

    You can see a result something similar to the following on your terminal:

    2018-02-22 17:26:31.259:INFO::main: Logging initialized @100ms to org.eclipse.jetty.util.log.StdErrLog <password> 
    OBF:1pbi1vn61unn1z7e1vu91ytc1o4u1o5s1yta1vv11z7o1uob1vnw1pcg 
    MD5:58d613129c5e71de57ee3f44c5ce16bc 
    CRYPT:NegJERR2H/a1M
    

    For more information about running the password utility, see Configuring Secure Password.

  3. Connect to the database using the database user credentials that you have configured in OSA-18.1.0.0.0/osa-base/etc/jetty-osa-datasource.xml.
  4. Insert a record into the osa_users table using any one of the following commands:
    insert into osa_users (id,username,pwd) values (2,'NewUser','OBF:1pbi1vn61unn1z7e1vu91ytc1o4u1o5s1yta1vv11z7o1uob1vnw1pcg');

    or

    insert into osa_users (id,username,pwd) values (2,'NewUser','MD5:58d613129c5e71de57ee3f44c5ce16bc');

    or

    insert into osa_users (id,username,pwd) values (2,'NewUser','CRYPT:NegJERR2H/a1M');
  5. Insert a record into the osa_user_roles table using the following command:
    insert into osa_user_roles (user_id, role_id) values (2,1);

    Important:

    Currently, Oracle Stream Analytics supports only one user role, i.e, the administrator role. So the role_id value must always be 1.
You can now login to Oracle Stream Analytics as NewUser using <password>. Repeat these steps to create as many users as you require.

Changing Password

Change Password Through User Interface

To change a user password:

  1. Go to System Settings.

  2. Click the User Management tab.

  3. Click Change Password next to the required user within the list of available users and then provide a value for the new password and click Save.

    Passwords are stored in MD5 hash form.

Change Password Using Code

To change a user password:

  1. Obfuscate or encrypt the new password for the user using the utility provided with the application server (Jetty).
  2. Update the relevant record in the osa_users table. For example:
    update osa_users set pwd='CRYPT:NesIZC3VkNGN2' where username='NewUser';
    This command updates the password for the NewUser.
Remember to use your updated password the next time you login with NewUser.

Removing Users

You may want to remove users when you no longer need them.

Before you proceed to delete any user, make a note of the following:

  • If a user who owns draft pipelines is deleted, then the pipelines are either migrated to the current user or deleted, based on the selection you make at the time of deletion.

  • If you attempt to delete yourself, all your draft pipelines are deleted after you confirm. The current user session is invalidated and you will be signed out of the application immediately.

Delete Users Through User Interface

To delete a user:

  1. Go to System Settings.

  2. Click the User Management tab.

  3. Click Delete next to the required user within the list of available users and then click OK within the confirmation dialog.

Delete Users Through Code

To delete a user:

  1. Execute the following command to remove a user:
    delete from osa_users where id=2;
    This command deletes the user with the id value as 2, i.e, the second user in the database.
  2. Execute the following command to delete the user role corresponding to the user in the above step:
    delete from osa_user_roles where user_id=2;

Configuring Oracle Stream Analytics System Settings

Only Oracle user-managed services This topic applies only to Oracle user-managed services.

Only users with the Administrator role can set the system settings in Oracle Stream Analytics.
To set/update system settings:
  1. Click the user name in the top right corner of the screen.
  2. Click System Settings.
    The System Settings page opens.
  3. Click Environment.
  4. Specify the server names and URLs where the Kafka Zookeeper, Yarn Resource Manager, or Spark Standalone, Path, HA Namenodes are deployed and running. Hadoop authentication is an optional setting.

    Description of system_settings_environment.png follows
    Description of the illustration system_settings_environment.png

    • Kafka Zookeeper Connection — the URL where the Zookeeper server or servers are configured, separated by comma. Kakfa is used as internal transport.

    • Runtime Server — the runtime server you want your Oracle Stream Analytics instance to run on

    • YARN Resource Manager URL — the URL where the YARN Resource Manager is configured, if the runtime server is Yarn

    • Spark REST URL — Spark standalone REST URL, if the runtime server is Spark standalone. To submit an Oracle Stream Analytics pipeline to Spark, the pipeline needs to be copied to a storage location that is accessible by all Spark nodes.

    • Storage — the type of storage for pipelines

    • Path — the path where the storage exists. The user who accesses this folder must have the write permission to it. The folder at this path is either created by the administrator, or Oracle Stream Analytics creates the folder at runtime.

    • HA Namenodes — If the hostname in the above URL refers to a logical HA cluster, specify the actual namenodes here in the format hostname1<port>, hostname2<port> etc.

    • Hadoop Authentication — the type of authentication configured on the Hadoop cluster. Oracle Stream Analytics supports only simple authentication.

  5. Click Pipelines. Specify the various settings for the pipeline within Oracle Stream Analytics.
    • Batch Duration — the default duration of the batch for each pipeline

    • Executor Count — the default number of executors per pipeline

    • Cores per Executor — the default number of cores. A minimum value of 2 is required.

    • Executor Memory — the default allocated memory for each executor instance in megabytes

    • Cores per Driver — the default number of cores

    • Driver Memory — the default allocated memory per driver instance in megabytes

    • High Availability — toggle the default HA value as on/off for each pipeline

  6. Click Proxy. If you set proper proxy, the back-end system will use these settings to reach the REST target. The proxy settings are also required for geo code related spatial patterns.
  7. Click User Management. You see the list of available users here. You can add/delete users from this screen.
  8. Click Save.

    Note:

    On the Yarn Cluster, make sure that you do not set a high value for yarn.nm.liveness-monitor.expiry-interval-ms (for example, 3000 ms instead of 10 minutes). This property determines the default value for how long to wait until a node manager is considered dead. Using a high value for this property does not process the events and the events are lost.

Configuring User Preferences

Only Oracle user-managed services This topic applies only to Oracle user-managed services.

Based on the preferences the users set in this page, the characteristics of Oracle Stream Analytics vary.

General

To set/update user preferences:

  1. Click the user name in the top right corner of the screen.

  2. Click Preferences. The Preferences page opens.

Provides a set of general preferences that you can view and set according to your requirements.

Description of general_pref.png follows
Description of the illustration general_pref.png

Start Page

Select if you want the Home page, the Catalog page, or the Patterns page to appear as the Start Page.

Notifications

Provides a set of notifications preferences that you can view and set according to your requirements.

Description of notifications_pref.png follows
Description of the illustration notifications_pref.png

Show Information Notifications

Select this option if you want the information notifications to appear in the pipeline. This option is selected by default.

Information Notification duration (in seconds)

Choose the number of seconds for which the notifications appear. The default value is 5.

Catalog

Provides a set of catalog preferences that you can view and set according to your requirements.

Description of catalog_pref.png follows
Description of the illustration catalog_pref.png

Default Sorting Column

Select the column by which you want the columns to be sorted. This value will be used as the default for all columns until you change the value again.

Default Sorting Order

Select the order by which you want the columns to be sorted. This value will be used as the default value for all columns until you change the value again.

Default Page Size

Select the value to be used as the default page size. Based on the value selected, the number of records that appear on a page vary. This value will be used as the default for all pages until you change the value again.

Pipeline

Provides a set of pipeline preferences that you can view and set according to your requirements.

Description of application_ua_pref.png follows
Description of the illustration application_ua_pref.png

Select Yes if you want to display the User Assistance text for the pipelines in the Pipeline Editor.

Live Output Stream

Provides a set of pipeline live output stream preferences that you can view and set according to your requirements.

Select a value that you want to be applied as the default table size for the data in Live Output Stream of a pipeline.

Timestamp

Provides a set of pipeline timestamp preferences that you can view and set according to your requirements.

Description of preferences_timestamp.png follows
Description of the illustration preferences_timestamp.png

Map

Provides a set of map preferences that you can view and set according to your requirements.

Select a value that you want to be used as the default tile layer preference in the geo fences.

Description of map_preferences.png follows
Description of the illustration map_preferences.png