5.6.2 Adding an OpenSearch Service

The script to add or delete the service uses the following arguments:

  • -h or --help

    Show the help message and exit.

  • --add

    An OpenSearch service will be added.

  • --delete

    The OpenSearch service will be removed.

  • --install_base_dir BASE_DIR

    Enter the base directory (BASE_DIR) where you installed the OSK DPK.

To add OpenSearch as a service:

  1. Open a terminal window, running as root.

  2. Change directory to OSK_INSTALL/setup:

    cd OSK_INSTALL/setup
  3. Run this command to add the service:

    ./psft-os-service.sh --add --install_base_dir BASE_DIR
                   
  4. Use this command to verify that the service was added.

    The output of the following ps command must show a running OpenSearch process:

    ps -ef | grep opensearch
  5. Use this systemctl command to check if a service is started for OpenSearch:

    systemctl status opensearch

    This should give an output with the status “active (running),” as shown in bold font in this sample:

    opensearch.service - OpenSearch
       Loaded: loaded (/etc/systemd/system/opensearch.service; enabled; vendor preset: disabled)
       Active: active (running) since Tue 2020-09-01 22:24:38 PDT; 12s ago
         Docs: https://opensearch.org
    Main PID: 59416 (java)
        Tasks: 34
       Memory: 2.2G
       CGroup: /system.slice/opensearch.service