参考Flink官方example
1 | https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/wordcount/WordCount.java |
pom
1 | <!--flink--> |
代码
1 | package com.xxx.xx.flink; |
运行参数

结果
参考Flink官方example
1 | https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/wordcount/WordCount.java |
pom
1 | <!--flink--> |
代码
1 | package com.xxx.xx.flink; |
运行参数
结果
可以使用CM提供的api查询cdh集群的信息
1 | http://cloudera.github.io/cm_api/ |
7.0.3的api文档
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/index.html |
查询impala query的api
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/json_ApiImpalaQuery.html |
比如
1 | https://xxxx:7180/api/v9/clusters/dev-cdh/services/impala/impalaQueries?from=2020-03-10T06:26:01.927Z |
支持的参数如图所示
查询yarn上query的api
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/resource_YarnApplicationsResource.html |
本来想cdh集成flink,但是我的cdh版本为5.16.2,参考了下面的issue可能cdh版本太低,至少要cdh6
1 | https://github.com/pkeropen/flink-parcel/issues |
进行独立安装
1 | wget https://archive.apache.org/dist/flink/flink-1.10.0/flink-1.10.0-bin-scala_2.11.tgz |
安装路径
1 | /home/lintong/software/apache/flink-1.10.0 |
/etc/profile添加,并source /etc/profile
1 | #flink |
下载flink-shaded-hadoop-2-uber-2.7.5-7.0.jar包,放到flink的lib目录下
1 | wget https://repo1.maven.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.7.5-7.0/flink-shaded-hadoop-2-uber-2.7.5-7.0.jar |
1.hive sql提交到yarn上面执行之后,将会成为MR任务执行
正在运行的MR任务的application查看的url,不同类似的任务查看的url可能会不同,比如Spark,Flink等
1 | http://xxxx:8088/cluster/app/application_158225xxxxx_0316 |
运行结束的MR任务的查看url
1 | http://xxxx:19888/jobhistory/job/job_1582255xxxx_0316 |
具体hive sql的具体执行用户,sql内容等信息到配置进行查看
1 | http://xxxx:19888/ws/v1/history/mapreduce/jobs/job_15822552xxxxx_0298/conf |
1.yarn top,查看yarn上面的资源使用情况
2.队列使用状态
1 | queue -status root.xxx_common |
3.查看yarn上运行的任务列表,如果集群有krb认证的话,需要先kinit,认证后可以看到所有正在运行的任务
1 | yarn application -list |
结果
1 | Total number of applications (application-types: [] and states: [SUBMITTED, ACCEPTED, RUNNING]):12 |
使用状态进行筛选
1 | yarn application -list -appStates RUNNING |
Shard是什么?
在下面的文档中进行了介绍
1 | https://www.elastic.co/guide/cn/elasticsearch/guide/current/kagillion-shards.html |
1.一个分片的底层即为一个 Lucene 索引,会消耗一定文件句柄、内存、以及 CPU 运转。
2.每一个搜索请求都需要命中索引中的每一个分片,如果每一个分片都处于不同的节点还好, 但如果多个分片都需要在同一个节点上竞争使用相同的资源就有些糟糕了。
3.用于计算相关度的词项统计信息是基于分片的。如果有许多分片,每一个都只有很少的数据会导致很低的相关度。
在官方文档中介绍了clusters, nodes, and shards的关系
1 | https://www.elastic.co/guide/en/elasticsearch/reference/current/scalability.html |
1.一个Es的索引实际上是一个或者多个的物理shard的组合
2.Shard有两种:一种是primaries and replicas,即主分片和副本分片。索引中的每一个文档都属于一个主分片,副本分片是主分片的拷贝
在最新的mac catalina系统中,已经从karabiner更名为karabiner-elements,安装的版本为Karabiner-Elements-12.9.0
下载地址:https://pqrs.org/osx/karabiner/
安装后会有两个应用,一个是Karabiner-Elements,一个是Karabiner-EventViewer,修改键位使用的是Karabiner-Elements
安装的时候会提示添加权限
安装后可以在下面的网址导入你想要修改的组合键方案,组合键的是complex_modifications,单个键是simple_modifications
参考:https://juejin.im/post/5daec26a51882575d50cd0aa
1.查看brew当前源
1 | git -C "$(brew --repo)" remote -v |
2.改成清华的源
1 | git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git |
已经修改成清华的源
1 | git -C "$(brew --repo)" remote -v |
或者改成中科大的源
1 | # 替换 Homebrew |
如果想还原
1.在 ~/.zshrc 中添加
1 | source ~/.bash_profile |
参考:https://blog.csdn.net/qq_18505715/article/details/83276208
2.比如mac的git命令补全不生效,可以参考如下文章添加
https://blog.csdn.net/WinWill2012/article/details/71774461
1 | source ~/.git-completion.bash |
3.调整mac终端颜色和全路径显示
1 | export PS1="%n@%m %0~ $ " |