# Cluster Setup - Overview
### Table of Contents:
- [Building a New Cassandra cluster](#building-a-new-cassandra-cluster)
- [Install cassandra.toolkit on existing cluster](#installing-cassandratoolkit-on-your-cluster)
- [Step 1: Create and Populate Ansible Config Files](#step-1-create-and-populate-ansible-config-files)
- [Step 2: Verify Access To Your Nodes](#step-2-verify-access-to-your-nodes)
- [Step 3: Install the Toolkit onto Your Nodes](#step-3-install-the-toolkit-onto-your-nodes)
- [Step 4: Restart Cluster to Enable JMX](#step-4-restart-cluster-to-enable-jmx-if-needed)
- [Step 5: Start Containers Using Docker Compose](#step-5-start-containers-using-docker-compose)
- [Debugging](#Debugging)
- [What's Next](#whats-next)
Cassandra.toolkit makes it easy to setup all the tools you will need for building, managing, and monitoring your Cassandra cluster. Whether you already have a Cassandra cluster or need to create your cluster, we have you covered. Just follow instructions below to get started.
### What Configuration Technologies Used
To make the setup process easy, we will use the following configuration and platform technologies to setup Cassandra.toolkit on your cluster:
- [Ansible](https://github.com/ansible/ansible)
- [Docker](https://www.docker.com/)
Continue on below to get started using these technologies to get everything setup.
# Building a New Cassandra Cluster
To start you will need a Cassandra Cluster. Other tutorials walk you through this process, so we will defer to them. Some ways to do this include:
- [Apache Cassandra - Getting Started Guide](https://cassandra.apache.org/doc/latest/getting_started/)
- [Datastax Enterprise Documentation](https://docs.datastax.com/)
- [Datastax Enterprise Installation Guide](https://docs.datastax.com/en/landing_page/doc/landing_page/installProducts.html)
- [Ansible Installation](https://github.com/locp/ansible-role-cassandra)
Note that you will need to know the ips of the nodes in your cluster for the next step.
Once your cluster is up and running, continue to the next step to install Cassandra.toolkit on your cluster.
# Installing Cassandra.toolkit on your cluster
Now that your Cassandra cluster is up and running, you are ready to install the toolkit onto your cluster.
## Step 1: Create and Populate Ansible Config Files
You will need to create a `hosts.ini` with all the needed Cassandra hosts for Ansible to use. You will also need to set your `group_vars/all.yml` file for your ansible environment. [See instructions here](./setup.ansible-config-files.md).
## Step 2: Verify Access To Your Nodes
Next we will make sure you can access all apache-cassandra or dse cluster nodes you want the tools for. If you haven't installed ansible already, you can refer to the [official instructions here](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
Refer to the `hosts.ini` file in your env using `-i`, and use the `cassandra-hello.yml` playbook.
For example, if you are using the `testing` environment:
```
# assuming current dir is this project root, docs/setup:
ansible-playbook -i ./config/ansible/envs/testing/hosts.ini ./src/ansible/playbooks/cassandra-hello.yml
```
If it worked, then now you are ready to run the ansible playbook and install cassandra.toolkit to your Cassandra cluster! If not, you might want to [go back to the instructions for setting your hosts.ini file](./setup.ansible-config-files.md#Step-12-list-all-hosts-in-hostsini) before trying again.
## Step 3: Install the Toolkit onto Your Nodes
### Run the Ansible Playbook
Finally you are ready to install the toolkit onto your nodes using Ansible Playbook. Be sure to pass in the arguments corresponding to the tools you chose from [Step 1.3](./setup.ansible-config-files.md#step-13-choose-what-tools-to-install).
Below are some examples to get you started, assuming and env called `testing`. Most of the args passed in using `-e` can also be passed in using `envs/<your-env>/group_vars/all.yml`, besides AWS credentials.
<br/>
### Examples
#### Example A: With Defaults Only
This is the basic ansible-playbook command. This will only install tools based on variables set in `envs/<YOUR ENV>/group_vars/all.yml`.
```
# assuming this docs/setup dir is the current dir, and <YOUR ENV> is "testing":
ansible-playbook -i ./config/ansible/envs/testing/hosts.ini ./src/ansible/playbooks/cassandra-tools-install.yml
```
#### Example B: Enable CLI Features
This installs all the medusa for backups, filebeat for monitoring, and reaper for repairs. This provides a strong stack across the board, but does not have any live metric monitoring dashboard like Datastax MCAC.
Again, note that args passed in using `-e` can also be set in your `group_vars/all.yml` file, though we recommend not setting AWS credentials in that file, but passing them in here instead.
```
# assuming this docs/setup dir is the current dir, and <YOUR ENV> is "testing":
ansible-playbook -i ./config/ansible/envs/testing/hosts.ini ./src/ansible/playbooks/cassandra-tools-install.yml \
-e "install_filebeat=True" \
-e "enable_jmx=True" \
-e 'create_reaper_db=True' \
-e 'install_medusa=True' \
-e 'aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' \
-e 'aws_access_key_id=AKIAIOSFODNN7EXAMPLE
```
#### Example C: Enable Metric Visualization using Datastax MCAC
This includes CLI tools from Example B, as well as Datastax MCAC for monitoring using a dashboard.
```
# assuming this docs/setup dir is the current dir, and <YOUR ENV> is "testing":
ansible-playbook -i ./config/ansible/envs/testing/hosts.ini ./src/ansible/playbooks/cassandra-tools-install.yml \
-e "install_filebeat=True" \
-e "enable_jmx=True" \
-e 'create_reaper_db=True' \
-e 'install_medusa=True' \
-e 'aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' \
-e 'aws_access_key_id=AKIAIOSFODNN7EXAMPLE \
-e 'install_datastax_mcac=True'
```
If `enable_jmx=True` (whether by passing in as an arg with `-e` or by setting in `group_vars/all.yml`), continue on to Step 4. If not, you can skip to [Step 5](#step-5-start-containers-using-docker-compose).
## Step 4: Restart Cluster to Enable JMX (If Needed)
If installation was run with `enable_jmx=True` then your cluster has to be restarted to allow new jmx configs to be enabled. However, if `enable_jmx=False` then you can skip this step.
```
ansible-playbook -i ./config/ansible/envs/testing/hosts.ini ./src/ansible/playbooks/cassandra-restart-service.yml
```
## Step 5: Start Containers Using Docker Compose
Now that the tools are installed on our cluster, we're finally ready to start up our toolkit. Docker Compose makes it easy to start everything at once. Simply run the following command:
```
docker-compose -f ./src/ansible/artifacts/docker/docker-compose.yml up -d
```
This will start the following containers, depending on what tools you decided to install earlier:
- `elasticsearch` - ingests logs from cassandra hosts received from filebeat
- `kibana` - visualize elasticsearch data
- `prometheus` - ingests metrics from cassandra hosts
- `grafana` - visualize cassandra metrics received from prometheus server
- `cassandra-reaper` - performs repairs on cassandra cluster
In a separate shell you can check that all containers are running and healthy by running `docker ps`. Output should look something like this (again, depending on what tools you decided to install earlier):
```
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f80d5376a0e9 thelastpickle/cassandra-reaper:latest "/usr/local/bin/entr…" 24 seconds ago Up 18 seconds 0.0.0.0:8080-8081->8080-8081/tcp cassandra-reaper
cc40031372d0 grafana/grafana:6.5.1 "/run.sh" 2 hours ago Up 20 seconds 0.0.0.0:3000->3000/tcp
没有合适的资源?快使用搜索试试~ 我知道了~
一组Cassandra工具,用于备份、恢复、监控、修复和管理ApacheCassandraDatastax集群_Jinj.zip
共100个文件
md:28个
yml:27个
sh:10个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 137 浏览量
2023-04-28
14:05:26
上传
评论
收藏 498KB ZIP 举报
温馨提示
一组Cassandra工具,用于备份、恢复、监控、修复和管理ApacheCassandraDatastax集群_Jinj.zip
资源推荐
资源详情
资源评论
收起资源包目录
一组Cassandra工具,用于备份、恢复、监控、修复和管理ApacheCassandraDatastax集群_Jinj.zip (100个子文件)
article.conf 489B
Dockerfile 2KB
Dockerfile 211B
Dockerfile 203B
deployment.drawio 10KB
all.yml.example 1KB
all.yml.example 1KB
ansible.cfg.example 207B
hosts.ini.example 195B
hosts.ini.example 195B
.gitignore 1KB
.gitignore 158B
.gitignore 59B
medusa.ini 3KB
cassandra_default.json.j2 115KB
cassandra_default.json.j2 115KB
tablesnap.service.j2 568B
cassandra_exporter.service.j2 493B
prometheus.yml.j2 363B
tg_mcac.json.j2 256B
datasources.yml.j2 198B
datasources.yml.j2 198B
sample.yaml.j2 163B
sample.yaml.j2 163B
NodeAnalyzer_folders.jpg 60KB
LICENSE 11KB
setup.ansible-config-files.md 14KB
README.md 9KB
README.md 9KB
setup.test-cluster.md 7KB
CONTRIBUTING.md 6KB
setup.monitoring.md 4KB
maintenance.live-monitoring.md 3KB
setup.backups.md 3KB
README.md 3KB
setup.recommendations.md 2KB
setup.debugging.md 2KB
maintenance.offline-monitoring.md 2KB
README.md 2KB
README.md 2KB
README.md 1KB
setup.repairs.md 1KB
README.md 1004B
README.md 920B
README.md 750B
README.md 632B
README.md 345B
README.md 297B
README.md 222B
README.md 183B
setup.install-ansible.md 102B
README.md 83B
README.md 68B
README.md 0B
.placeholder 0B
.placeholder 0B
.placeholder 0B
mcac-01.png 158KB
deployment.png 134KB
stargate-swagger.png 80KB
__init__.py 0B
__init__.py 0B
elastic.repo 213B
start-grafana.sh 1KB
start-reaper.sh 979B
start-prometheus.sh 724B
start-elasticsearch.sh 626B
start-kibana.sh 457B
start-master.sh 434B
start-worker.sh 343B
nodetool.receive.sh 222B
build-images.sh 184B
start-spark-cluster.sh 53B
docker-compose.yml 3KB
cassandra-tools-install.yml 3KB
config.yml 2KB
main.yml 2KB
filebeat.yml 1KB
main.yml 1KB
main.yml 1KB
main.yml 1KB
main.yml 1KB
exporter-standalone.yml 1KB
main.yml 1KB
main.yml 933B
main.yml 922B
docker-compose.yml 800B
all.yml 778B
cassandra-restart-service.yml 660B
docker-compose.yml 628B
exporter-as-jvm-agent.yml 444B
cassandra-hello.yml 376B
main.yml 344B
main.yml 99B
main.yml 84B
main.yml 78B
main.yml 44B
main.yml 44B
main.yml 29B
all.yml 0B
共 100 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功