数据源相关命令整理

数据源相关命令整理

1.hbase

查询数据

count ‘hbase_gp_batch_0122’,INTERVAL => 5000000,CACHE => 5000000

2.kafka

./kafka-console-consumer.sh --bootstrap-server
service-kafka-bigdata-broker-2:9092 --topic kafka_mongo_test
–from-beginning

展示所有topic:

kafka-topics.sh --zookeeper hdhost01:24002/kafka --list

创建topic:

kafka-topics.sh --zookeeper
hdhost01:24002,hdhost02:24002,hdhost03:24002/kafka --create --topic
mq_hbase_kerberos_mongo_0313 --partitions 6 --replication-factor 2

查看topic相关信息:

kafka-topics.sh --zookeeper
hdhost01:24002,hdhost02:24002,hdhost03:24002/kafka --describe --topic
BIGDATA_TEST_TOPIC

生产数据:

kafka-console-producer.sh --broker-list
hdhost01:21007,hdhost02:21007,hdhost03:21007 --topic
BIGDATA_TEST_TOPIC --producer.config
/opt/hadoopclient/Kafka/kafka/config/producer.properties

消费数据:

kafka-console-consumer.sh --topic BIGDATA_TEST_TOPIC
–bootstrap-server hdhost01:21007,hdhost02:21007,hdhost03:21007 --from-beginning --consumer.config /opt/hadoopclient/Kafka/kafka/config/consumer.properties

3.hive

执行hive,进入hive窗口
查看所有的database

show databases

查看table在hdfs上的存储路径

show create table M_BD_T_GAS_ORDER_INFO_H

创建分区表

create EXTERNAL table ddlpartition3(f1 string,f2 bigint,f3 string)
PARTITIONED BY(year int,month int,day int) STORED AS PARQUET location ‘hdfs://bigdata-batch:8020/tmp/hive/ddlpartition3’

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值