2 Standalone-Server Domains

An Oracle Stream Analytics standalone-server domain contains a single Oracle Stream Analytics server. By default, the Configuration Wizard creates a standalone-server domain, which can be the starting point for a multiserver domain.

This chapter includes the following sections:

2.1 Configuration Wizard

The Configuration Wizard is an administration tool that enables you to create a new domain or update an existing domain. You can use the Configuration Wizard in graphical mode (interactive) or silent mode.

Silent mode is non-interactive and requires an XML properties file for selecting configuration options. You can run silent-mode configuration as part of a script or from the command line. The advantage to silent-mode configuration is that if you plan to create a multiserver domain, you can set the domain configuration options once and use the same options to set the configuration on the other servers.

The following procedures show how to perform the create and update operations in graphical mode and in silent mode. You can update only the listen port and the JDBC data source configuration of a standalone-server domain.

You can Create New Domain with Samples and Update Domain with Samples similar to Create New Domain and Update Domain. See Create a Standalone-Server Domain and Update a Standalone-Server Domain.

2.2 Create a Standalone-Server Domain

Use the Configuration Wizard to create a new domain to which to deploy your applications. The Configuration Wizard creates a single default server in the domain. All of the server files are in a subdirectory of the domain directory. The domain directory has the same name as the server.

You also configure the following:

  • Server administration user name and password.

  • A database or database driver that is different from the default.

  • Server listen port.

  • Password for the identity keystore and private keystore.

2.2.1 Create a Standalone-Server Domain in Graphical Mode

Once launched, the Configuration Wizard in graphical mode is self-explanatory, but the full procedure is provided here for your information.

  1. Go to the /Oracle/Middleware/my_osa/osa/common/bin directory.

  2. Run the config command to start the wizard:

    UNIX:
    ./config.sh
    
    Windows: config.cmd
    

    The Oracle Welcome screen displays.

  3. Click Next.

    The Choose Create or Update Domain screen displays.

  4. In the Choose Create or Update Domain window, select Create a New OSA Domain and click Next.

    The Configure Administrator Username and Password screen displays.

  5. In the Configure Administrator Username and Password screen, enter the following:

    User name: osaadmin User password: welcome1 Confirm user password: welcome1.

  6. Click Next.

  7. Enter basic configuration information about the default server in the domain. In particular:

    The Configure Server screen displays.

    • Enter the name of the default server. This name is also used for the name of the directory that contains the default server files.

    • The listen port for Oracle Stream Analytics itself. Default is 9002.

  8. In the Configure Server screen, enter the server name and listen port as follows:

    Server name: The name of the default server. This name is also the name of the directory that contains the default server files.

    Server listen port: The port where Oracle Stream Analytics listens for events. The default is 9002.

  9. Click Next.

    The Configure Domain Identity Keystore screen displays.

  10. In the Configure Domain Identity Keystore screen, enter the following:

    Keystore file: Accept the default. Keystore password: welcome1. Confirm keystore password: welcome1.

    By default, the password for the certificate private key is the same as the password for the domain identity keystore.

  11. Click Next.

    The Configuration Options screen displays.

  12. In the Configuration Options screen, decide whether or not to update the JDBC data source configuration.

    If you select No, no JDBC data source is configured. If you select Yes, you proceed to the page in which you can enter the JDBC data source information.

    1. To create a JDBC data source:

      • Select Yes and click Next.

        The Configure Database Properties screen displays.

      • In the Configure Database Properties screen, enter the new JDBC data source values.

        In the top section, enter the data source name, type, driver name and location.

        In the lower section, enter information about the data base to which this data source connects.The JDBC connection URL is generated based on the information you enter.

      • Click Next.

        The Create OSA Domain screen displays

    2. To not create a JDBC data source, select No and click Next.

      The Create OSA Domain screen displays.

  13. In the Create OSA Domain screen, enter the following information:

    Domain name: The name of the new domain. Domain location: Accept the default.

    The Configuration Wizard creates the domain in the domain location directory with the domain name that you specified

  14. Click Create.

    The Creating Domain screen displays.

    If the creation of the domain succeeds, a message similar to the following displays in the information window:

    Domain created successfully!
    Domain location: C:\Oracle\Middleware\my_osa\user_projects\domains\osa_domain
    
  15. Click Done to exit Configuration Wizard.

  16. Go to the domain location to see the domain you just created.

2.2.2 Create a Standalone-Server Domain in Silent Mode

Silent mode is a non-interactive way to update a domain and requires an XML properties file for selecting configuration options.

2.2.2.1 Create an XML Properties File

To create an XML properties file:
  1. On the computer on which you want to run the Configuration Wizard in silent mode, create an empty file in an XML editor.

    The file name can be anything, as long as it has an .xml extension. For this procedure, the file name is silent.xml.

  2. Copy the contents of the following sample XML file into the silent.xml file.
    <?xml version="1.0" encoding="UTF-8"?>
    <bea-installer xmlns="http://www.bea.com/plateng/wlevs/config/silent">
      <input-fields>
        <data-value name="CONFIGURATION_OPTION" value="createDomain" />
        <data-value name="USERNAME" value="wlevs" />
        <data-value name="PASSWORD" value="wlevs" />
        <data-value name="SERVER_NAME" value="my_wlevs_server" />
        <data-value name="DOMAIN_NAME" value="myDomain" />
        <data-value name="DOMAIN_LOCATION" 
               value="C:\Oracle\Middleware\my_osa\user_projects\domains" />
        <data-value name="NETIO_PORT" value="9002" />
        <data-value name="KEYSTORE_PASSWORD" value="my_keystore_password" /> 
        <data-value name="PRIVATEKEY_PASSWORD" value="my_privatekey_password" /> 
        <data-value name="DB_URL" value="jdbc:oracle:thin:@locahost:1521:XE" />
        <data-value name="DB_USERNAME" value="db_user" />
        <data-value name="DB_PASSWORD" value="db_password" />
      </input-fields>
    </bea-installer>
    
  3. In the silent.xml file, edit the values for the keywords shown in Table 2-1 to reflect your configuration.

    For example, to create a new domain in the /Oracle/Middleware/my_osa/finance_projects/domains directory, update the corresponding <data-value> element as follows

    <data-value name="DOMAIN_LOCATION" 
      value="/Oracle/Middleware/my_osa/finance_projects/domains" />
    

    Table 2-1 Values for the silent.xml File

    For this data-value name... Enter the following value...

    CONFIGURATION_OPTION

    Whether you want to create a new domain with a default server or update a server in an existing domain.

    Valid values are createDomain or updateDomain or updateDomainWithSample or createDomainWithSample. Default value is createDomain.

    Assign createDomainWithSample to Create New Domain with Samples.

    Assign updateDomainWithSample to Update Domain with Samples.

    EXISTING_DOMAIN_PATH

    The full path name of an existing server in the domain.

    Use this option only when updating an existing server in a domain.

    USERNAME

    The user name of the administrator of the created or updated server in the domain.

    PASSWORD

    The password of the administrator of the created or updated server in the domain.

    SERVER_NAME

    The name of the new server in this domain. This name will also be used as the name of the directory that contains the server files.

    DOMAIN_NAME

    The name of the domain.

    DOMAIN_LOCATION

    The full name of the directory that will contain the domain.

    The standard location for Oracle Stream Analytics domains is /Oracle/Middleware/my_osa/user_projects/domains.

    NETIO_PORT

    The port number to which the Oracle Stream Analytics server instance listens.

    KEYSTORE_PASSWORD

    The password for the Oracle Stream Analytics identity keystore.

    PRIVATEKEY_PASSWORD

    The password for the certificate private key.

    The default value of this option is the value of the KEYSTORE_PASSWORD.

    DB_URL

    The URL used to connect to a database using JDBC. This option is used to configure the data source.

    The database configuration parameters are optional; if you do not specify them, then no data source is configured for the server.

    DB_USERNAME

    The name of the user that connects to the database via the data source.

    The database configuration parameters are optional; if you do not specify them, then no data source is configured for the server.

    DB_PASSWORD

    The password of the user that connects to the database via the data source.

    The database configuration parameters are optional; if you do not specify them, then no data source is configured for the server.

  4. Save the file in a directory of your choice.

2.2.2.2 Use Silent Mode and Generate a Log File

  1. Go to the /Oracle/Middleware/my_osa/oep/common/bin directory:
  2. Run the config command to start the wizard in silent mode and generate a log file to catch failures do to incorrect XML property entries:
    UNIX:
    ./config.sh -mode=silent -silent_xml=path_to_xml_file -log=/logs/create_domain.log
    
    Windows: config.cmd -mode=silent -silent_xml=path_to_xml_file -log=/logs/create_domain.log
    

    path_to_xml_file is the full path name to the XML properties file you created

    create_domain.log specifies to create a log file in the domain directory.

    The command does not return any messages if it completes successfully. See Return Exit Codes to the Command Window to get information about the success or failure of the silent execution of the Configuration Wizard.

2.2.2.3 Return Exit Codes to the Command Window

When you run in silent mode, the Configuration Wizard generates exit codes that indicate the success or failure of the creation and configuration of the domain. These exit codes are shown in the following table.

Table 2-2 Exit Codes

Code Description

0

Configuration Wizard execution completed successfully

-1

Configuration Wizard execution failed due to a fatal error

-2

Configuration Wizard execution failed due to an internal XML parsing error

The following example provides a sample Windows command file that runs the Configuration Wizard in silent mode and echoes the exit codes to the command window from which the script is executed.

rem Execute the Configuration Wizard in silent mode
@echo off
config.cmd -mode=silent -silent_xml=c:\scripts\silent.xml  -log=C:\logs\create_domain.logs

@rem Return an exit code to indicate success or failure
set exit_code=%ERRORLEVEL%

@echo.
@echo Exitcode=%exit_code%
@echo.
@echo Exit Code Key
@echo ---------------
@echo  0=Configuration Wizard completed successfully
@echo -1=Configuration Wizard failed due to a fatal error
@echo -2=Configuration Wizard failed due to an internal XML parsing error
@echo.

2.3 Update a Standalone-Server Domain

Use the Configuration Wizard to update an existing standalone-server domain.

You can update only the listen port and the JDBC data source configuration.

2.3.1 Update a Standalone-Server Domain in Graphical Mode

Once launched, the Configuration Wizard in graphical mode is self-explanatory, but the full procedure is provided here for your information.

  1. Go to the /Oracle/Middleware/my_osa/osa/common/bin directory.

  2. Run the config command to start the wizard:

    UNIX:
    ./config.sh
    
    Windows: config.cmd
    

    The Oracle Welcome screen displays.

  3. Click Next.

    The Choose Create or Update Domain screen displays.

  4. In the Choose Create or Update Domain window, select Updating an existing Oracle Stream Analytics domain.

  5. Click Next.

    The Choose an Existing OSA domain screen displays.

  6. In the Choose an Existing OSA domain screen text box, enter or browse for the full path name to the server directory for the server that you want to update.

    In this example, the value is C:\Oracle\Middleware\my_osa\user_projects\domains\myDomain\productionServer.

  7. Click Next.

    The Choose an Existing OSA Domain screen displays.

  8. In the Choose an Existing OSA Domain screen, select the path to the domain that you want to update from the drop-down list and click Next.

    The Configure Server screen displays. The Server name field is grayed out, but you can change the value in the Server listen port field.

    Note:

    To prevent any conflicts when all servers are running at the same time, be sure that you do not enter the same values used by other servers in the domain.

  9. In the Configure Server screen, either change the listen port and click Next or click Next without changing the listen port.

    The Configuration Options screen displays.

  10. In the Configuration Options screen, decide whether to update the JDBC data source configuration.

    To update the JDBC data source configuration:

    1. In the Configuration Options screen, select Yes and click Next.

      The Configure Database Properties screen displays.

    2. In the Configure Database Properties screen, enter your changes and click Next.

      The Create OSA Domain screen displays.

    To leave the JDBC data source configuration unchanged:

    1. In the Configuration Options screen, select No.

    2. Click Next.

      The Create OSA Domain screen displays.

  11. In the Create OSA Domain screen, click Update to update the server.

2.3.2 Update a Standalone-Server Domain in Silent Mode

Silent mode is a non-interactive way to update a domain and requires an XML properties file for selecting configuration options.

  1. Create an XML properties file that contains the updates that you want to make.

    See Return Exit Codes to the Command Window if you need information about how to create the file, but handle the update settings as follows:

    • Set CONFIGURATION_OPTION to updateDomain.

    • Set EXISTING_DOMAIN_PATH to the full path name of the server directory that contains the server files that you want to update.

    • Do not set the DOMAIN_NAME and DOMAIN_LOCATION options. This is because the Configuration Wizard already knows these values, based on what you entered for EXISTING_DOMAIN_PATH.

    • Set the listen port to the new values.Be sure that the new server configuration options, such as NETIO_PORT are different than the options for any other servers in the domain.

    • Set the JDBC data source options to the new values. The database options can be the same if you want the updated server to connect to the same database as the other servers.

    The following XML properties file updates the listen port (NETIO_PORT) and data source settings for \~mydomain\productionServer.

    <?xml version="1.0" encoding="UTF-8" ?> 
    <bea-installer xmlns="http://www.bea.com/plateng/wlevs/config/silent">
      <input-fields>
        <data-value name="CONFIGURATION_OPTION" value="updateDomain" /> 
        <data-value name="EXISTING_DOMAIN_PATH" 
          value="C:\Oracle\Middleware\my_oep\user_projects\domains\myDomain\productionServer" /> 
        <data-value name="NETIO_PORT" value="9102" />
        <data-value name="DB_URL" value="jdbc:oracle:thin:@locahost:1521:XE" />
        <data-value name="DB_USERNAME" value="db_user" />
        <data-value name="DB_PASSWORD" value="db_password" />
      </input-fields>
    </bea-installer>
    
  2. Go to the /Oracle/Middleware/my_osa/oep/common/bin directory.
  3. Run the config command to start the wizard in silent mode and generate a log file:
    UNIX:
    ./config.sh -mode=silent -silent_xml=path_to_xml_file -log=/logs/create_domain.log
    
    Windows: config.cmd -mode=silent -silent_xml=path_to_xml_file -log=/logs/create_domain.log
    

    path_to_xml_file is the full path name to the XML properties file you created

    create_domain.log specifies to create a log file in the domain directory.

    The command does not return any messages if it completes successfully. See Return Exit Codes to the Command Window to get information about the success or failure of the silent execution of the Configuration Wizard.

2.4 Start and Stop a Server in a Standalone-Server Domain

You can start and stop an Oracle Stream Analytics standalone-server with any of the command-line scripts or with Oracle Stream Analytics Visualizer.

For information about Visualizer, see Using Visualizer for Oracle Stream Analytics.

2.4.1 Start a Standalone-Server with the startwlevs Script

Each Oracle Stream Analytics server directory contains a command script that starts a server instance. By default, the script is called startwlevs.cmd (Windows) or startwlevs.sh (UNIX).

  1. Ensure that the JAVA_HOME variable in the server start script points to the correct JDK. If it does not, edit the script.

    The server start script is located in the server directory under the main domain directory. For example, the default server directory for the HelloWorld domain is in /Oracle/Middleware/my_osa/oep/examples/domains/helloworld_domain/defaultserver.

  2. Open a command window and change to the server directory of the domain directory. For example, to start the HelloWorld sample server:
    cd C:\Oracle\Middleware\my_osa\oep\examples\domains\helloworld_domain\defaultserver
    

    Note:

    You must run the start scripts from within the target directory. Oracle Stream Analytics does not support relative directory paths.

  3. Run the startwlevs.cmd (Windows) or startwlevs.sh (UNIX) script:
    startwlevs.cmd
    

Note:

On HP-UX, to avoid an OutOfMemoryError, you might need to increase the MaxPermSize to 256 in startwlevs.sh. For example: -XX:MaxPermSize=256m.

2.4.2 Stop a Standalone-Server with the stopwlevs Script

Each Oracle Stream Analytics server directory contains a command script that stops a server instance; by default, the script is called stopwlevs.cmd (Windows) or stopwlevs.sh (UNIX).

Note:

The following procedure does not stop an Oracle Stream Analytics stand-alone server running in SSL mode. To stop an Oracle Stream Analytics stand-alone server running in SSL mode, run the wlevs.Admin utility, as described in Run wlevs.Admin Utility in SSL Mode.

  1. Open a command window and change to the server directory. For example, to stop the running HelloWorld sample server:
    cd C:\Oracle\Middleware\my_osa\oep\examples\domains\helloworld_domain\defaultserver
    
  2. Execute the stopwlevs.cmd (Windows) or stopwlevs.sh (UNIX) script.

    Use the -url argument to pass the URL that establishes a JMX connection to the server you want to stop. This URL takes the form service:jmx:msarmi://host:port//jndi/jmxconnector, where host refers to the computer hosting the server and port refers to the server's JNDI port, configured in config.xml file. For example:

    stopwlevs.sh -url service:jmx:msarmi://ariel:9002/jndi/jmxconnector
    

    In the example, the host is ariel and the JMX port is 9002. The 9002 port is the netio port defined in the Oracle Stream Analytics server config.xml configuration file. MSA security uses it for JMX connectivity.

    See Connection Arguments for additional details about the -url argument.

    Note:

    On Windows, do not stop the Oracle Stream Analytics server by clicking the Close button in the command prompt in which you started it. Always stop the Oracle Stream Analytics server with the stopwlevs.cmd script or with Ctrl-C.