Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Deploy Cherami as a cluster

Xu Ning edited this page Jan 16, 2017 · 2 revisions

[draft, work in progress]

This article describes the procedure to deploy Cherami as a cluster.

Planning

Cherami is designed to run as a cluster, because messages are replicated 3 times (configurable) across different machines to protect against hardware failures. You should use dedicated hardware to run Cherami, as it will be resource consuming. Additionally, Cherami depends on Cassandra to store its metadata. If you don't already have an available Cassandra cluster to use, you need to plan for it as well.

Small scale deployment

A recommended small scale cluster should have at least 5 different machines, if your replication factor is 3. We don't recommend having equal number of machines than the replication factor, because message publishing will not work if the system cannot find enough machines to satisfy the replication factor.

Cherami itself consists of multiple roles: frontend, input, storage, output, controller, which can be instantiated on each machine using the same cherami-server executable. For a small cluster, it should be OK to run all roles in each machine, e.g. ./cherami-server start all.

In a small scale cluster it maybe OK to colocate the Cassandra cluster with Cherami, as we don't expect the amount of data and IO on Cassandra to affect the operations of Cherami in this scale.

Large scale deployment

For a large scale deployment, you need to plan the number of instances and the placement of each role:

  1. You will need fewer number of controllers (probably 3-5).
  2. The metadata Cassandra deployment should run on dedicated machines.
  3. You may want to separate out input and output roles, as they may contend on memory, CPU and network resources (in that order)

Example to deploy Cherami in a small cluster of 5 machines

Preparation: edit config/cluster.yaml to modify some values:

ringhost IPs:... cassandra IPs: UUIDs storage directories

Setup Cassandra schema (for new cassandra deployment only. To upgrade schema, use cherami-cassandra-tool):

  1. run clients/metadata/schema/metadata_keyspace.cql against your cassandra using cqlsh. You may want to adjust the replication factor. cqlsh $ip -f clients/metadata/schema/metadata_keyspace.cql

  2. run clients/metadata/schema/metadata.cql against your cassandra using cqlsh.

cqlsh $ip -k cherami -f clients/metadata/schema/metadata.cql

For each host: CHERAMI_ENVIRONMENT=cluster ./cherami-server start all