Using Service-Related Commands

A Jethro instance includes an entire database – all tables, data, indexes and metadata. One or multiple Jethro hosts can be connected (attached) to the same instance; for example, you can add hosts to handle a larger number of concurrent users (scale-out).
Each host can run the following services per attached instance:

JethroMonitor - Is a background service that run on every host, unlike the rest of the services, which runs per instance. This service monitors and restarts failing services, and can also manage the Kerberos keys renewal process.

Reviewing Common Deployment Options

Jethro instances can be deployed in either of the following deployment methods:

Service Start/Stop/Status Commands

The Jethro installation RPM file creates a Linux OS service for starting and stopping Jethro services. It simplifies and automates the startup of Jethro services for production environments, while providing the administrator full control for development/test environments. The service command runs under the jethro OS user, so no root privileges is required.

The basic commands syntax are: 

service jethro start/stop/restart/status
service jethro start/stop/restart host monitor
service jethro start/stop <Instance-name> [maint | loadscheduler | all]

service jethro status - Lists all currently running services and <instances-names>.

service jethro start - Starts all services marked for auto-start (this command also runs automatically during the host startup).

service jethro stop - Stops all running services (also runs during the host shutdown).

service jethro restart - Stops all running services, and then it starts all services marked for auto-start.

service jethro start/stop/restart host monitor - Controls the state of the Jethro host monitor.

service jethro start/stop <instance-name> - Starts/Stops only the JethroServer service, for the specified instance.

service jethro start/stop <Instance-name> maint - Starts/Stops only the JethroMaint service, for the specified instance.

service jethro start/stop <Instance-name> loadscheduler - Starts/Stops only the JethroLoadsScheduler service, for the specified instance.

service jethro start/stop <Instance-name> all - Starts/Stops all the instance services, for the specified instance.

Configuring the Automatic Start of Services

The service command automatically monitors any Jethro service that it started (JethroServer and JethroMaint); upon detecting that a running service was unexpectedly stopped, the service command will restart the service.
In addition, the linux service automatically starts Jethro services during boot, based on a text configuration file called services.ini that resides under /opt/jethro/instances. This file is automatically populated by the JethroAdmin commands.
For example, the create-instance command adds a line that refers to the instance – if the instance being created is the only instance on the host, it will set the value of the autostart parameter to On, otherwise it will set autostart to Off.

The services.ini file has a simple format, where each line controls the auto-start of a specific instance by using the following format:
{instance_name}:{port}:{start_query_service}:{start_maint_service}

For example, with an instance named 'demo', listening at port 9111 (default), with auto-start of both services:
demo:9111:yes:yes

Attaching Additional Jethro Hosts to an Instance

Once a Jethro instance is created, additional Jethro hosts can be configured to access the instance. That enables Jethro to support more concurrent users, as well as to provide high-availability, by using Client-side load balancing where each SQL command is directed to a different Jethro host.


To attach a Jethro host to an existing instance:

  1. Prepare a new Jethro host, by following these steps:
  2. Set up the Host.
  3. Install Jethro software.
  4. Verify connectivity.
  5. Run the following command to attach the new host to the existing instance, providing the instance name, the instance directory, and the location and size of the local cache directory (similar to the create-instance command):

    JethroAdmin attach-instance {instance_name}-storage-path={jethro_storage_path} -cache-path={jethro_local_cache_path}-cache-size={size in GB}
    
    #For example:
    JethroAdmin attach-instance demo -storage-path=/user/jethro/instances -cache-path=/mnt/jethro_local_cache -cache-size=80G

Listing Locally Attached Instances

After running either the create-instance or the attach-instance command, the local Jethro host is attached to the HDFS instance. In other words, the HDFS instance is referred from the local Jethro host .
To list all instances that are attached to the local Jethro host, run:

JethroAdmin list-instances

Reviewing Log Files

All log files which contain information with regard to the Jethro services can be found under /var/log/jethro/{instance_name}:

  1. jethro_loader.log – Displays all information regarding JethroLoader's operation
  2. jethroserver.log – Stores all queries run on Jethro, with details such as the query plans and running time
  3. jethro.log – A generic log, featuring more detailed log messages
  4. jethro_maint.log – Displays all information regarding JethroMaint's operations
  5. services.log – Displays information regarding the service itself, including all issues encountered during service startup or shutdown
  6. monitor.logDisplays all information regarding JethroMonitor's operations

Reviewing Configuration Files

The instance configuration files reside under $JETHRO_HOME/instances/{instance_name}:

Removing Jethro

When removing Jethro, you may choose either of the following options:

Detaching an Instance

To detach a Jethro host from an existing instance, run:

JethroAdmin detach-instance {instance-name}


#For example:
JethroAdmin detach-instance demo

The detach command also stops all local services that may be running on this instance.

If needed, you can later attach a Jethro host again to the same instance, by running the following command: JethroAdmin attach-instance.

Deleting an Instance

If the instance to be deleted is attached to several Jethro hosts, ensure that you detach the instance from all hosts but one, and then run the delete operation from the remaining host.

to delete an instance, run:

JethroAdmin delete-instance {instance_name};


#For example: 
JethroAdmin delete-instance demo

Removing Jethro Software

To remove Jethro software, Switch to user root and then run:

rpm -e jethro

Removing the Jethro software does not delete any instance, because the instances are shared across hosts. If you want to delete an instance, you should do it before you uninstall Jethro software.