-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cassandra from console.txt
52 lines (34 loc) · 1.13 KB
/
Cassandra from console.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CASSANDRA:
/cassandra/bin/cassandra #(находясь на worker2 - запускает базу, если она упала)
/cassandra/bin/cqlsh 10.0.0.18 #(подключиться к касандре через консоль)
#создать схему
CREATE KEYSPACE lesson7
WITH REPLICATION = {
'class' : 'SimpleStrategy', 'replication_factor' : 1 } ;
CREATE TABLE animals
(id int,
name text,
size text,
primary key (id));
insert into animals (id, name, size)
values (3, 'Deer', 'Big');
select * from animals;
#апдейт записи 3
insert into animals (id, name)
values (3, 'Doe' );
insert into animals (id, name)
values (5, 'Snake');
#не сработает
delete id from animals where id = 3;
delete from animals where id = 3;
insert into animals (id, name, size)
values (3, null, null);
HBASE (на любой ноде):
hbase shell
create_namespace 'lesson7'
create 'lesson7:animals', 'name', 'size'
put 'lesson7:animals', '3', 'name', 'Deer'
put 'lesson7:animals', '3', 'size', 'Big'
put 'lesson7:animals', '5', 'name', 'Snake'
put 'lesson7:animals', '3', 'name', 'Doe'
delete 'lesson7:animals', '5'