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:

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 is run under the jethro OS user, so no root privileges is required. It allows selecting a specific instance and/or service to start or stop.

Here's some common examples:

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:

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

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

Setting up Kerberos Instance

Jethro's current support for accessing a Kerberized Hadoop cluster requires the administrator to manually run the kinit utility, which is used for obtaining and caching Kerberos ticket-granting tickets for Jethro services. This needs to be done for every Jethro host, as follows:

  1. As jethro user, run kinit to generate a cache file per each Jethro service/utility (JethroServer, JethroMaint and JethroLoader):

    kinit -k -t jethro.hadoop.keytab -c jethro.server.cache jethro 
    kinit -k -t jethro.hadoop.keytab -c jethro.maint.cache jethro 
    kinit -k -t jethro.hadoop.keytab -c jethro.loader.cache jethro 

    It is recommended to ask for a renewable ticket with long expiration time (based on your site policies), for example adding a -r999d

  2. In the $JETHRO_HOME/instances/instance_name/local-conf.ini file, remove all comments from the following parameters and set each parameter to the full path of the corresponding cache file:


 Because these steps must be repeated when the tickets expire, it is advisable to have a ticket with a long lifetime. In addition, to avoid service disruption, ensure that you periodically renew the Kerberos tickets before they expire, for example by running kinit -R from a cron job.

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

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.