Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# pyenv python configuration file
.python-version

# Editor configuration files
.remote-sync.json
File renamed without changes.
107 changes: 107 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
======================================
DSE Cassandra topology for clusterdock
======================================

This repository houses the **DSE Cassandra** topology for `clusterdock`_.

.. _clusterdock: https://github.com/clusterdock/clusterdock

Usage
=====

Assuming you've already installed **clusterdock** (if not, go `read the docs`_),
you use this topology by cloning it to a local folder and then running commands
with the ``clusterdock`` script:

.. _read the docs: http://clusterdock.readthedocs.io/en/latest/

.. code-block:: console

$ git clone https://github.com/clusterdock/topology_dse.git
$ clusterdock start topology_dse
2017-09-20 10:17:38 PM clusterdock.models INFO Starting cluster on network (cluster) ...
2017-09-20 10:17:38 PM clusterdock.models INFO Starting node node-1.cluster ...
2017-09-20 10:17:39 PM clusterdock.models INFO Starting node node-2.cluster ...
2017-09-20 10:17:40 PM clusterdock.topology_dse.start INFO Updating DSE configurations and starting DSE nodes ...
Restarting DSE daemon : dse
DSE daemon starting with only Cassandra enabled (edit /etc/default/dse to enable other features)
Restarting DSE daemon : dse
DSE daemon starting with only Cassandra enabled (edit /etc/default/dse to enable other features)
2017-09-20 10:18:40 PM clusterdock.topology_dse.start INFO Validating DSE service health ...
2017-09-20 10:18:53 PM clusterdock.topology_dse.start INFO DSE cluster is available and its contacts are: node-1.cluster,node-2.cluster
2017-09-20 10:18:53 PM clusterdock.topology_dse.start INFO From its node, DSE can be accessed with: cqlsh -u cassandra -p cassandra
2017-09-20 10:18:53 PM clusterdock.cli INFO Cluster started successfully (total time: 1m 14s).

To start a Kerberos-based DSE cluster:

.. code-block:: console

$ clusterdock start --kerberos topology_dse
2017-09-20 10:21:54 PM clusterdock.models INFO Starting cluster on network (cluster) ...
2017-09-20 10:21:54 PM clusterdock.models INFO Starting node kdc.cluster ...
2017-09-20 10:21:56 PM clusterdock.models INFO Starting node node-1.cluster ...
2017-09-20 10:21:57 PM clusterdock.models INFO Starting node node-2.cluster ...
2017-09-20 10:21:57 PM clusterdock.topology_dse.start INFO Updating KDC configurations ...
2017-09-20 10:21:59 PM clusterdock.topology_dse.start INFO Starting KDC ...
2017-09-20 10:22:01 PM clusterdock.topology_dse.start INFO Validating KDC service health ...
2017-09-20 10:22:01 PM clusterdock.topology_dse.start INFO Creating `dse` and `HTTP` Kerberos principals for DSE nodes ...
2017-09-20 10:22:02 PM clusterdock.topology_dse.start INFO Updating DSE configurations and starting DSE nodes ...
Restarting DSE daemon : dse
DSE daemon starting with only Cassandra enabled (edit /etc/default/dse to enable other features)
Restarting DSE daemon : dse
DSE daemon starting with only Cassandra enabled (edit /etc/default/dse to enable other features)
2017-09-20 10:23:02 PM clusterdock.topology_dse.start INFO Validating DSE service health ...
2017-09-20 10:23:15 PM clusterdock.topology_dse.start INFO DSE cluster is available and its contacts are: node-1.cluster,node-2.cluster
2017-09-20 10:23:15 PM clusterdock.topology_dse.start INFO From its node, DSE can be accessed with: cqlsh -u cassandra -p cassandra
2017-09-20 10:23:15 PM clusterdock.cli INFO Cluster started successfully (total time: 1m 20s).

To see full usage instructions for the ``start`` action, use ``-h``/``--help``:

.. code-block:: console

$ clusterdock start topology_dse -h
usage: clusterdock start [--always-pull] [--namespace ns] [--network nw]
[-o sys] [-r url] [-h]
[--dse-cluster-name DSE_CLUSTER_NAME] [--kerberos]
[--kerberos-config-directory path]
[--kerberos-principals princ1,princ2,...]
[--kdc-node node [node ...]]
[--nodes node [node ...]]
topology

Start a DSE cluster

positional arguments:
topology A clusterdock topology directory

optional arguments:
--always-pull Pull latest images, even if they're available locally
(default: False)
--namespace ns Namespace to use when looking for images (default:
None)
--network nw Docker network to use (default: cluster)
-o sys, --operating-system sys
Operating system to use for cluster nodes (default:
None)
-r url, --registry url
Docker Registry from which to pull images (default:
docker.io)
-h, --help show this help message and exit

DSE arguments:
--dse-cluster-name DSE_CLUSTER_NAME
DSE cluster name to use. (default: Test Cluster)
--kerberos If specified, sets up Kerberos based DSE cluster with
a KDC node. (default: False)
--kerberos-config-directory path
If specified, mounts this directory to KDC container
for Kerberos config files. (default:
~/.clusterdock/kerberos)
--kerberos-principals princ1,princ2,...
If specified, a comma-separated list of Kerberos user
principals to create in KDC. (default: None)

Node groups:
--nodes node [node ...]
Nodes of the nodes group (default: ['node-1',
'node-2'])
12 changes: 12 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
56 changes: 56 additions & 0 deletions images/centos6.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM clusterdock/topology_nodebase:centos6.8

ARG JDK_URL=http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
ARG JCE_URL=http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip
ARG JDK_DIRECTORY=/usr/java/jdk1.8.0_131
ARG DSE_VERSION=5.1.3-1
ARG DSE_REPO_URL

RUN echo ${DSE_REPO_URL} > /etc/yum/vars/dse_repo_url
ADD dse.repo /etc/yum.repos.d/

RUN yum -y update && \
yum -y install unzip \
scl-utils \
centos-release-scl-rh \
krb5-workstation \
krb5-devel \
gcc \
python26-kerberos

# Java setup
RUN wget --no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" -O /tmp/jdk.tar.gz \
"${JDK_URL}" && \
mkdir -p /usr/java && \
tar xf /tmp/jdk.tar.gz -C /usr/java && \
rm -f /tmp/jdk.tar.gz

RUN wget --no-check-certificate \
--no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -O /tmp/unlimited_jce_policy.zip \
"${JCE_URL}" && \
unzip -jo -d ${JDK_DIRECTORY}/jre/lib/security /tmp/unlimited_jce_policy.zip && \
rm -f /tmp/unlimited_jce_policy.zip

# Make the installed Java as default.
RUN update-alternatives --install "/usr/bin/java" "java" "${JDK_DIRECTORY}/bin/java" 1
RUN update-alternatives --set java ${JDK_DIRECTORY}/bin/java

# Add Python 2.7 as needed by DSE's cqlsh tool - needs to follow after scl-utils install.
RUN yum -y install dse-full-${DSE_VERSION} \
python27 && \
yum clean all

# Install Kerberos Python package as required by DSE's cqlsh tool.
RUN . /opt/rh/python27/enable && pip install pure-sasl kerberos
5 changes: 5 additions & 0 deletions images/centos6.8/dse.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[datastax]
name = DataStax Repo for DataStax Enterprise
baseurl=$dse_repo_url
enabled=1
gpgcheck=0
Loading