未加星标

[TIL] Cassandra Backup Survey

字体大小 | |
[数据库(综合) 所属分类 数据库(综合) | 发布者 店小二04 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏
Preface

Our cassandra instance sometime got crash mess amount of data. To backup those data to another storage is task need to do.

CQLSH First backup canssandra schema

Export entire schema of your cassandra.

cqlsh -e "DESC SCHEMA" > user_schema.cql

Or you can specific your keyspace here.

cqlsh -e "DESC SCHEMA" > user_schema.cql Export and Import cassandra data Export COPY <tablename> [ ( column [, ...] ) ] FROM ( '<filename>' | STDIN ) [ WITH <option>='value' [AND ...] ];

For example

cqlsh> COPY log.parts FROM STDIN;

Another example to transform output format

cqlsh> COPY log.chatlogs (ts, content, other) TO './chatlog.dat' ... WITH DELIMITER = '|' AND QUOTE = '''' AND ESCAPE = '''' AND NULL = '<null>'; Import cqlsh> COPY emp (empid,deptid,last_name,first_name) FROM 'temp.csv'; Troubleshooting Error for (-5813055698912042437, -5769658640073958582): Failed to connect to all replicas ['10.123.456.789'] for (-5813055698912042437, -5769658640073958582), errors: ['NoHostAvailable - (\'Unable to connect to any servers\', {\'10.123.456.789\': error(None, "Tried connecting to [(\'10.123.456.789\', 9042)]. Last error: timed out")})'] (will try again later attempt 1 of 5) Ans:

Because your cassandra has three partition, and it is in GCE. We only export one port for cqlsh remote connect. So, you could not get any data from your other two partition.

Try install cqlsh in GCE machine with pip install cqlsh . Got another error when do this.

'module' object has no attribute 'parse_options'

We could not use cqlsh from pip , suggestion use cassanra’s cqlsh. Refer jira

sudo docker run -it cassandra /usr/bin/cqlsh Refer:

本文数据库(综合)相关术语:系统安全软件

主题: CassandraTI
分页:12
转载请注明
本文标题:[TIL] Cassandra Backup Survey
本站链接:http://www.codesec.net/view/521619.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(29)