一.hadoop安装
(一).参考
https://blog.csdn.net/hliq5399/article/details/78193113
https://www.cnblogs.com/zhuxiaojie/p/7384677.html
https://blog.csdn.net/heyutao007/article/details/5725379
https://www.cnblogs.com/youqc/p/9075334.html
(二).概述
日志在logs目录下
yarn的ResourceManager监控 http://localhost:8088/cluster
NodeManager监控 8042
hdfs监控 http://localhost:50070/dfshealth.html#tab-overview
如果打不开dfs管理页面,在hdfs-site.xml中添加dfs.http.address
启动:
sbin/hadoop-daemon.sh start namenode
sbin/hadoop-daemon.sh start datanode
sbin/hadoop-daemon.sh start secondarynamenode
sbin/yarn-daemon.sh start resourcemanager
sbin/yarn-daemon.sh start nodemanager
停止:
sbin/hadoop-daemon.sh stop namenode
sbin/hadoop-daemon.sh stop datanode
sbin/yarn-daemon.sh stop resourcemanager
sbin/yarn-daemon.sh stop nodemanager
编译WordCount.java
编译时把package xxx的包路径注释掉
javac -classpath `$HADOOP_HOME/bin/hadoop classpath` WordCount.java
jar cf wc.jar WordCount*.class
$HADOOP_HOME/bin/hadoop jar wc.jar WordCount /WordCount/input/ /WordCount/output/
$HADOOP_HOME/bin/hadoop fs -cat /WordCount/output/part-r-00000
运行计数:
上传测试文件
bin/hdfs dfs -put /opt/data/wc.input /wordcountdemo/input
计数
bin/yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.2.jar wordcount /wordcountdemo/input /wordcountdemo/output
二.hbase安装
(一).参考
https://stackoverflow.com/questions/23049777/hbase-regionserver-error-telling-master-we-are-up
https://www.iteye.com/blog/kabike-2111791
https://www.jianshu.com/p/510e1d599123
(二).问题:
1.如何实现类似sql语句的查询,实现where条件查询,和mybatis的结合
2.三个月内的数据实时查询,三个月前的数据如何热备份并清空之前数据,避免文件太大.
3.如何建立二级索引,范围检索
三.hive安装
(一).参考
https://blog.csdn.net/u010429286/article/details/70054118
https://www.jianshu.com/p/01bb375625f1
./schematool -dbType mysql -initSchema
log位置 /private/var/folders/xy/qpmnp74j31n6vq9x5h3q4v0c0000gn/T/feivirus/hive.log
(二).问题
1.和hbase结合时怎么多表join
2.怎么和mybatis结合
四.elasticsearch安装
(一).问题
1.如何通过es实现hbase中数据的二级索引
五.flume安装
(一).问题
1.三个月前的数据做冷备,怎么备份。实时只查三个月数据。通过flume如何实现日志备份到文件,后期可以导入数据到hbase中.
(二).参考
https://blog.csdn.net/feinifi/article/details/73929015
https://www.cnblogs.com/smartloli/p/9984140.html
https://blog.csdn.net/liuxiao723846/article/details/63342490
http://bigdataer.net/?p=646
(三).概述
./flume-ng agent -c ../conf -f ../conf/netcat.conf -n agent -Dflume.root.logger=INFO,console,LOGFILE
六.Kafka安装
(一).问题
(二).参考
https://www.jianshu.com/p/552ab3e23c96
https://www.cnblogs.com/expiator/p/9990171.html
bin/kafka-server-start.sh config/server.properties
./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic_wakandacore_journey_modification_qa --from-beginning
bin/kafka-topics.sh --list --zookeeper localhost:2181
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server 127.0.0.1:9092 --list
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server 127.0.0.1:9092 --group wakanda.black.panther.qa --describe
bin/kafka-topics.sh --zookeeper 127.0.0.1:2181 --topic wakanda.black.panther.qa --describe
七.phoenix安装
(一).问题
(二).参考
https://yq.aliyun.com/articles/703234
https://www.jianshu.com/p/d862337247b1
https://phoenix.apache.org/
https://blog.csdn.net/zlj_blog/article/details/76173844
http://www.codeclip.com/3670.html
拷贝所有jar到hbase的lib下
插入值如果是字符串要用单引号引起来,切记不能用双引号!!!
表名如果要体现小写效果,必须要用双引号!!!
表名和列族以及列名需要用双引号括起来,因为HBase是区分大小写的,如果不用双引号括起来的话Phoenix在创建表的时候会自动将小写转换为大写字母,这样HBase中会创建另外一张表.
hbase默认rowkey列名是"ROW"
示例:
create table "gps" (
"ROW" varchar not null primary key,
"cf_gps"."device_no" varchar,
"cf_gps"."latitude" varchar,
"cf_gps"."longitude" varchar,
"cf_gps"."direction" float,
"cf_gps"."speed" float,
"cf_gps"."timestamp" bigint,
"cf_gps"."acc" integer
);
upsert into "gps" ("ROW", "device_no","latitude", "longitude", "direction", "speed", "timestamp", "acc") values('1','123456', '89.87', '99.89', 123.12, 60, 123123, 1);