syuu1228 / scylla-machine-image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scylla Machine Image

Provides following

  • Create an image with pre-installed Scylla
  • Allow to configure the database when an instance is launched first time
  • Easy cluster creation

OS Package

RPM/DEB package that is pre-installed in the image. Responsible for configuring Scylla during first boot of the instance.

Create an image

AWS

aws/ami/build_ami.sh

Scylla AMI user-data Format v2

Scylla AMI user-data should be passed as a json object, as described below

see AWS docs for how to pass user-data into ec2 instances: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-add-user-data.html

EC2 User-Data

User Data that can pass when create EC2 instances

  • Object Properties
    • scylla_yaml (Scylla YAML) – Mapping of all fields that would pass down to scylla.yaml configuration file
    • scylla_startup_args (list) – embedded information about the user that created the issue (NOT YET IMPLEMENTED) (default=’[]’)
    • developer_mode (boolean) – Enables developer mode (default=’false’)
    • post_configuration_script (string) – A script to run once AMI first configuration is finished, can be a string encoded in base64. (default=’’)
    • post_configuration_script_timeout (int) – Time in seconds to limit the post_configuration_script (default=’600’)
    • start_scylla_on_first_boot (boolean) – If true, scylla-server would boot at AMI boot (default=’true’)

Scylla YAML

All fields that would pass down to scylla.yaml configuration file

see https://docs.scylladb.com/operating-scylla/scylla-yaml/ for all the possible configuration availble listed here only the one get defaults scylla AMI

  • Object Properties
    • cluster_name (string) – Name of the cluster (default=generated name that would work for only one node cluster)
    • experimental (boolean) – To enable all experimental features add to the scylla.yaml (default=’false’)
    • auto_bootstrap (boolean) – Enable auto bootstrap (default=’true’)
    • listen_address (string) – Defaults to ec2 instance private ip
    • broadcast_rpc_address (string) – Defaults to ec2 instance private ip
    • endpoint_snitch (string) – Defaults to ‘org.apache.cassandra.locator.Ec2Snitch’
    • rpc_address (string) – Defaults to ‘0.0.0.0’
    • seed_provider (mapping) – Defaults to ec2 instance private ip

Example usage of user-data

Spinning a new node connecting to “10.0.219.209” as a seed, and installing cloud-init-cfn package at first boot.

{
     "scylla_yaml": {
         "cluster_name": "test-cluster",
         "experimental": true,
         "seed_provider": [{"class_name": "org.apache.cassandra.locator.SimpleSeedProvider",
                            "parameters": [{"seeds": "10.0.219.209"}]}],
     },
     "post_configuration_script": "#! /bin/bash\nyum install cloud-init-cfn",
     "start_scylla_on_first_boot": true
}

Creating a Scylla cluster using the Machine Image

AWS - CloudFormation

Use template aws/cloudformation/scylla.yaml. Currently, maximum 10 nodes cluster is supported.

Building scylla-machine-image package

RedHat like - RPM

Currently the only supported mode is:

dist/redhat/build_rpm.sh --target centos7 --cloud-provider aws

Build using Docker

docker run -it -v $PWD:/scylla-machine-image -w /scylla-machine-image  --rm centos:7.2.1511 bash -c './dist/redhat/build_rpm.sh -t centos7 -c aws'

Building docs

python3 -m venv .venv
source .venv/bin/activate
pip install sphinx sphinx-jsondomain sphinx-markdown-builder
make html
make markdown

About

License:Apache License 2.0


Languages

Language:Python 80.5%Language:Shell 13.6%Language:Groovy 4.0%Language:Makefile 1.1%Language:Dockerfile 0.8%