The Jetpack installer includes:
- Jetpack command line utility
- Configuration scripts to make an instance a cluster member
- Chef client 11
- Various other utilities which interface with CycleCloud
All Jetpack files are installed inside a singular directory tree.
In addition to creating this directory, the Jetpack installer:
- Creates system init startup scripts which configure an instance as a cluster member
- Creates udev rules on Linux
- Creates the ‘cyclecloud’ user with administrative sudo privileges
- Installs the HealthCheck service
- Sets the environment variable CYCLECLOUD_HOME
Please note that the Jetpack installer for Windows disables the firewall, which is officially discouraged by Microsoft. We recommend you reenable it but leave open the ports detailed in the section on firewalls.
Important directories within your Jetpack installation:
|bin||Useful binaries and scripts.|
|config||User defined and cluster defined configuration files and scripts.|
|logs||Logs generated by joining a cluster and converging the instance, of particular interest is the chef-client.log which contains the results from converging Chef recipes.|
|system||Internal files. We don’t recommend directly using or accessing any files in this directory as they will change significantly from release to release.|
Firewalls and Jetpack
CycleCloud requires that the following ports be open on your instance for incoming connections:
- TCP port 22 – SSH (Secure Shell) for Linux only
- TCP port 3389 – RDP (Remote Desktop Protocol) for Windows only
Blocking outgoing connections is not recommended. These connection settings fulfil only the most basic requirements to be part of a CycleCloud cluster. Any applications you install may have additional requirements.
The HealthCheck Service
The HealthCheck service executes user-defined scripts to determine an instance’s current viability as a cluster member. Scripts may be written in Python or be Bash (Linux) or batch (Windows) scripts. If the script exits with a code of 254, the instance will be terminated. Other non-zero return codes are treated as unknown and are logged to CycleCloud. Checks are stored in /opt/cycle/jetpack/config/healthcheck.d on Linux and in C:\cycle\jetpack\config\healthcheck.d on Windows.
To delay a HealthCheck related termination, use the jetpack keepalive command.
Jetpack Command Line Tool
The Jetpack command-line tool, located at /opt/cycle/jetpack/bin/jetpack or C:\cycle\jetpack\bin\jetpack, provides a useful set of subcommands for manipulating the current instance and interacting with CycleCloud.
|jetpack config||Retrieve a configuration value.|
|jetpack converge||Execute a Chef converge.|
|jetpack keepalive||Delay system termination by the HealthCheck Service.|
|jetpack log||Log a message to CycleCloud cluster UI.|
|jetpack send||Send an arbitrary AMQP message to the CycleCloud server.|
This command can be used to fetch information passed to an instance through the original cluster template. This exposes all the system properties made available via Ohai, a subset of an instance’s own cloud provider metadata, and information about the parent CycleCloud cluster.
This command downloads any Chef cookbooks or cluster-init scripts defined in the cluster template, then executes a Chef converge and subsequently executes cluster-init.
This command interacts with the HealthCheck service to delay the termination of instance due to a failing HealthCheck. Termination can be delayed for a fixed period or indefinitely. By default, termination is delayed for one hour.
To delay system termination by one hour:
$ jetpack keepalive
To disable the HealthCheck service entirely, i.e. delay termination indefinitely:
$ jetpack keepalive forever
To delay system termination by two days:
$ jetpack keepalive 2d
This command sends a log message back to CycleCloud. The message will appear in cycle_server.log, the main event log, and the Cluster UI page.
Each message has two properties level and priority. The level property indicates the type of message. Valid levels are ‘info’, ‘warn’, and ‘error’. The level does not indicate importance of a given message. For example, some errors are trivial and some informational messages critical. Priority indicates the importance of the message. Valid priority values are ‘low’, ‘medium’, and ‘high’. Only messages with a priority of medium or higher are displayed on the Cluster UI page. This is so that the UI page is not inundated with low priority messages.
To send an informational log message that will appear on the Cluster UI page:
$ jetpack log 'system is now ready'
To send a low priority log message that you do not want to appear on the Cluster UI page:
$ jetpack log 'system is now ready' --priority low
By default, messages with a level of error have a high priority. To send an error message:
$ jetpack log 'the machine cannot process jobs' --level error
To send a trivial error message:
$ jetpack log 'the machine cannot process jobs' --level error --priority low
This is an advanced command that you can use to send an arbitrary AMQP message to CycleCloud. It is most useful if you have created a CycleCloud plugin that can process that information.
You can send arbitrary strings or files with specified AMQP routing keys.