Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed steps for installing cassandra2.2.4

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "detailed steps of installing cassandra 2.2.4". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and study and learn the "detailed steps of installing cassandra 2.2.4" together.

1. Prepare 5 Linux hosts

slightly

2. Close the firewall

service iptables stop

chkconfig iptables off

Edit/etc/hosts

node1

node2

node3

node4

node5

Download Cassandra

on node1.

to

http://cassandra.apache.org/download/

download

Or download it directly.

http://mirror.bit.edu.cn/apache/cassandra/2.2.4/apache-cassandra-2.2.4-bin.tar.gz

5, decompression

at node1

tar zxvf apache-cassandra-2.2.4-bin.tar.gz -C /

mv /apache-cassandra-2.2.4 /cassandra

Create nosql users on all nodes

useradd nosql

passwd nosql

7. Install jdk version 1.8 or above on all hosts

slightly

8. Edit the configuration file cassandra.yaml

at node1

vim /cassandra/conf/cassandra.yaml

data_file_directories:

- /cassandradata/data

commitlog_directory: /cassandradata/commitlog

saved_caches_direcotry: /cassandradata/saved_caches

num_tokens:256

- seeds: "node2,node3,node4,node5"

9. Edit the configuration file logback.xml

vim /cassandra/conf/logback.xml

Change:

/cassandradata/log/system.log

10. Distribute and create required folders

on node1.

scp -r /cassandra node2:/

scp -r /cassandra node3:/

scp -r /cassandra node4:/

scp -r /cassandra node5:/

mkdir /cassandradata/data -p

mkdir /cassandradata/commitlog -p

mkdir /cassandradata/saved_caches -p

11. Change ownership at all nodes

node2, node3, node4, node5

chown nosql.nosql /cassandra -R

chown nosql.nosql /cassandradata -R

12. Modify cassandra.yaml on each node accordingly

Take node2 for example.

listen_address: node2

Name nodes and so on.

13. Start in sequence

First seeds, then main

at node2

/cassandra/bin/cassandra -f

at node3

/cassandra/bin/cassandra -f

at node4

/cassandra/bin/cassandra -f

at node5

/cassandra/bin/cassandra -f

at node1

/cassandra/bin/cassandra -f

14. Start CLI at main

(Python version 2.7 or above is required)

/cassandra/bin/cqlsh node1

15. Testing

create keyspace mykeyspace

with replication={'class':'SimpleStrategy','replication_factor':1};

use mykeyspace;

create tables users(userid int primary key, fn text, ln text, number int);

insert into users(userid, number) values(1 ,2);

insert into users(userid, fn, ln, number) values(1, 'a', 'b', 3);

select avg(number) from users;

Note:

If such an error occurs:

No single argument constructor found for class [Ljava.lang.String;……

There may be a problem with the format of the cassandra.yaml configuration file

Attention!

data_file_directories:

- /cassandradata/data

Thank you for reading, the above is the "installation cassandra 2.2.4 detailed steps" of the content, after learning this article, I believe you have a deeper understanding of the installation cassandra 2.2.4 detailed steps this problem, the specific use of the situation also needs to be verified. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report