- 浏览: 2540933 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Apache Cassandra 2019 Cluster
Haha, it looks like continues hash to form the cluster and replica the data in nodes.
Try to Set Up Cassandra Manually
> wget http://mirrors.ibiblio.org/apache/cassandra/3.11.4/apache-cassandra-3.11.4-bin.tar.gz
Unzip and place in the working directory
> sudo ln -s /home/carl/tool/apache-cassandra-3.11.4 /opt/cassandra-3.11.4
> sudo ln -s /opt/cassandra-3.11.4 /opt/cassandra
Add the Cassandra to the Path
export PATH="/opt/cassandra/bin:$PATH"
Some important configurations in conf/cassandra.yaml
cluster_name: 'SillycatCluster'
- seeds: "ubuntu-master"
listen_address: ubuntu-master
native_transport_port: 9042
rpc_address: ubuntu-master
Command to start cassandra
> bin/cassandra -f
Check the status on ubuntu-master
> nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.101 103.66 KiB 256 100.0% 19b79248-63e2-4749-bf9d-5081f3d3ada0 rack1
Do the similar on ubuntu-dev2 and ubuntu-dev4
> wget http://mirrors.ibiblio.org/apache/cassandra/3.11.4/apache-cassandra-3.11.4-bin.tar.gz
Unzip and place in right directory, add to PATH
Change the conf/cassandra.yaml as follow:
cluster_name: 'SillycatCluster'
- seeds: "ubuntu-master"
listen_address: ubuntu-dev2 or listen_address: ubuntu-dev4
native_transport_port: 9042
rpc_address: ubuntu-dev2 or rpc_address: ubuntu-dev4
Start that and you can see this from ubuntu-master
> bin/cassandra -f
Check status
> nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.3 45.66 KiB 256 100.0% 5a91cb7e-0b4d-487a-b2bc-a5e13e26887a rack1
UN 192.168.56.101 108.61 KiB 256 100.0% 19b79248-63e2-4749-bf9d-5081f3d3ada0 rack1
3 nodes will be like this
> nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.3 93.96 KiB 256 65.2% 5a91cb7e-0b4d-487a-b2bc-a5e13e26887a rack1
UN 192.168.56.101 108.61 KiB 256 70.1% 19b79248-63e2-4749-bf9d-5081f3d3ada0 rack1
UN 192.168.56.103 26.22 KiB 256 64.7% 11aa7d21-7ce3-48dd-8921-e196feb74f42 rack1
Use my other machine to connect to the cluster
> cqlsh ubuntu-master 9042
Create the test key space
> CREATE KEYSPACE patient WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 2};
Create table to store the data
sillycat@cqlsh> CREATE TABLE patient.exam (
... patient_id int,
... id int,
... date timeuuid,
... details text,
... PRIMARY KEY (patient_id, id));
Insert some test data from other people’s blog
> INSERT INTO patient.exam (patient_id,id,date,details) values (1,1,now(),'first exam patient 1');
> INSERT INTO patient.exam (patient_id,id,date,details) values (1,2,now(),'second exam patient 1');
> INSERT INTO patient.exam (patient_id,id,date,details) values (2,1,now(),'first exam patient 2');
> INSERT INTO patient.exam (patient_id,id,date,details) values (3,1,now(),'first exam patient 3');
Query all the records for patient 1
> use patient;
> select * from exam where patient_id=1;
Connect to node ubuntu-dev2
> cqlsh ubuntu-dev2 9042
> desc keyspaces;
patient system_schema system_auth system system_distributed system_traces
> use patient;
You can see the same data there with the same commands
> select * from exam where patient_id=1;
The cluster works pretty well.
Seed is the contact nodes we need when other nodes start.
References:
https://sillycat.iteye.com/blog/2011992
https://www.ibm.com/developerworks/cn/opensource/ba-set-up-apache-cassandra-architecture/index.html
Haha, it looks like continues hash to form the cluster and replica the data in nodes.
Try to Set Up Cassandra Manually
> wget http://mirrors.ibiblio.org/apache/cassandra/3.11.4/apache-cassandra-3.11.4-bin.tar.gz
Unzip and place in the working directory
> sudo ln -s /home/carl/tool/apache-cassandra-3.11.4 /opt/cassandra-3.11.4
> sudo ln -s /opt/cassandra-3.11.4 /opt/cassandra
Add the Cassandra to the Path
export PATH="/opt/cassandra/bin:$PATH"
Some important configurations in conf/cassandra.yaml
cluster_name: 'SillycatCluster'
- seeds: "ubuntu-master"
listen_address: ubuntu-master
native_transport_port: 9042
rpc_address: ubuntu-master
Command to start cassandra
> bin/cassandra -f
Check the status on ubuntu-master
> nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.101 103.66 KiB 256 100.0% 19b79248-63e2-4749-bf9d-5081f3d3ada0 rack1
Do the similar on ubuntu-dev2 and ubuntu-dev4
> wget http://mirrors.ibiblio.org/apache/cassandra/3.11.4/apache-cassandra-3.11.4-bin.tar.gz
Unzip and place in right directory, add to PATH
Change the conf/cassandra.yaml as follow:
cluster_name: 'SillycatCluster'
- seeds: "ubuntu-master"
listen_address: ubuntu-dev2 or listen_address: ubuntu-dev4
native_transport_port: 9042
rpc_address: ubuntu-dev2 or rpc_address: ubuntu-dev4
Start that and you can see this from ubuntu-master
> bin/cassandra -f
Check status
> nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.3 45.66 KiB 256 100.0% 5a91cb7e-0b4d-487a-b2bc-a5e13e26887a rack1
UN 192.168.56.101 108.61 KiB 256 100.0% 19b79248-63e2-4749-bf9d-5081f3d3ada0 rack1
3 nodes will be like this
> nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.3 93.96 KiB 256 65.2% 5a91cb7e-0b4d-487a-b2bc-a5e13e26887a rack1
UN 192.168.56.101 108.61 KiB 256 70.1% 19b79248-63e2-4749-bf9d-5081f3d3ada0 rack1
UN 192.168.56.103 26.22 KiB 256 64.7% 11aa7d21-7ce3-48dd-8921-e196feb74f42 rack1
Use my other machine to connect to the cluster
> cqlsh ubuntu-master 9042
Create the test key space
> CREATE KEYSPACE patient WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 2};
Create table to store the data
sillycat@cqlsh> CREATE TABLE patient.exam (
... patient_id int,
... id int,
... date timeuuid,
... details text,
... PRIMARY KEY (patient_id, id));
Insert some test data from other people’s blog
> INSERT INTO patient.exam (patient_id,id,date,details) values (1,1,now(),'first exam patient 1');
> INSERT INTO patient.exam (patient_id,id,date,details) values (1,2,now(),'second exam patient 1');
> INSERT INTO patient.exam (patient_id,id,date,details) values (2,1,now(),'first exam patient 2');
> INSERT INTO patient.exam (patient_id,id,date,details) values (3,1,now(),'first exam patient 3');
Query all the records for patient 1
> use patient;
> select * from exam where patient_id=1;
Connect to node ubuntu-dev2
> cqlsh ubuntu-dev2 9042
> desc keyspaces;
patient system_schema system_auth system system_distributed system_traces
> use patient;
You can see the same data there with the same commands
> select * from exam where patient_id=1;
The cluster works pretty well.
Seed is the contact nodes we need when other nodes start.
References:
https://sillycat.iteye.com/blog/2011992
https://www.ibm.com/developerworks/cn/opensource/ba-set-up-apache-cassandra-architecture/index.html
发表评论
-
Update Site will come soon
2021-06-02 04:10 1672I am still keep notes my tech n ... -
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 467NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 361Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 364Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 421Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 465NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 285Serverless with NodeJS and Tenc ...
相关推荐
Title: Mastering Apache Cassandra, 2nd Edition Author: Nishant Neeraj Length: 322 pages Edition: 2 Language: English Publisher: Packt Publishing Publication Date: 2015-02-27 ISBN-10: 1784392618 ISBN-...
Learning Apache Cassandra - Second Edition by Sandeep Yarabarla English | 25 Apr. 2017 | ASIN: B01N52R0B5 | 360 Pages | AZW3 | 10.68 MB Key Features Install Cassandra and set up multi-node clusters ...
Apache Cassandra is the perfect choice for building fault tolerant and scalable databases. Implementing Cassandra will enable you to take advantage of its features which include replication of data ...
在本文中,我们将深入探讨如何将Spring Boot框架与Cassandra数据库集成,并利用Java Persistence API (JPA) 进行数据操作。Spring Boot以其简洁的配置和开箱即用的特性,已经成为Java开发中的首选框架之一。而...
Apache Cassandra 是一种分布式数据库系统,特别适合处理大量结构化和半结构化数据。它具有高度可扩展性和高可用性,是大数据场景中的常见选择。在Python开发中,有时我们需要快速地搭建测试环境来验证Cassandra的...
适用于Apache Cassandra的Prometheus和Grafana环境以下服务器与CentOS Linux release 7.8.2003 (Core) : 192.168.1.151 eternal1 eternal1....卡桑德拉(Apache Cassandra) 3节点Cassandra群集cluster_name: 'id_clus
在这个“vagrant-apache-cluster”项目中,它被用来配置一个包含多种组件的集群环境,这些组件包括Apache Kafka、Apache Zookeeper、Apache Cassandra以及Apache Ignite。 Apache Kafka 是一个分布式流处理平台,常...
**Elixir-Cassandra:Apache Cassandra的Elixir客户端** 在分布式数据存储的世界中,Apache Cassandra是一个高度可扩展且无中心的NoSQL数据库系统。Elixir,作为Erlang虚拟机上的函数式编程语言,以其并发性、容错...
Apache Cassandra 是一个分布式数据库系统,设计用于处理大规模数据,具有高可用性和可扩展性。它最初由 Facebook 开发,后来成为 Apache 软件基金会的顶级项目。在本示例中,我们将深入探讨如何使用 Java 和 ...
NetBackup™ Web UI Apache Cassandra 管理指南 NetBackup™ 10.1 版本的 Web UI Apache Cassandra 管理指南旨在帮助管理员管理 NetBackup™ 环境中的 Apache Cassandra 数据库。该指南详细介绍了 Cassandra 数据库...
木偶Cassandra模块(DSC)概述从[DataStax Community Edition] 安装Apache Cassandra。用法简单的例子: class { 'cassandra': cluster_name => 'YourCassandraCluster', seeds => [ '192.0.2.5', '192.0.2.23', '...
This is followed by an in-depth look at Cassandra's robust support for multiple data centers, and how to scale out a cluster. Next, the book explores the domain of application design, with chapters ...
ccm和ccmlib的目标是使在al CCM上轻松创建,管理和销毁小型Cassandra群集(Cassandra Cluster Manager)的脚本/库可在本地主机上创建,启动和删除Apache Cassandra群集。 ccm和ccmlib的目标是使在本地机器上轻松创建...
2. **Cassandra**: Cassandra是由Apache开发的分布式数据库系统,适用于大规模数据存储。它采用一致性哈希和Gossip协议实现节点间的通信,确保数据的一致性和可用性。Cassandra集群中的每个节点都可以作为读写入口,...
The rising popularity of Apache Cassandra rests on its ability to handle very large data sets that include hundreds of terabytes -- and that's why this distributed database has been chosen by ...
**lua-cassandra:Apache Cassandra的纯Lua驱动程序详解** `lua-cassandra`是一个针对Apache Cassandra数据库的纯Lua实现的客户端驱动程序,它允许Lua开发者直接在Lua环境中与Cassandra进行交互,无需借助其他语言...
卡桑德拉 在Debian / Ubuntu上安装和配置Apache Cassandra 3.x以及JMX Prometheus导出器。 经过测试: Debian 10.x :check_mark: Ubuntu 20.04.x :check_mark: Ubuntu 18.04.x :check_mark:测验为了尽可能与实际使用...