- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我已经为我的 MapReduce 作业编写了一个 JMH 基准。如果我在本地模式下运行我的应用程序,它可以工作,但是当我在我的 hadoop 集群上使用 yarn 脚本运行它时,我会收到以下错误:
[cloudera@quickstart Desktop]$ ./launch_mapreduce.sh
# JMH 1.10 (released 5 days ago)
# VM invoker: /usr/java/jdk1.7.0_67-cloudera/jre/bin/java
# VM options: -Dproc_jar -Xmx1000m -Xms825955249 -Xmx825955249 -Djava.net.preferIPv4Stack=true -Dhadoop.log.dir=/usr/lib/hadoop-yarn/logs -Dyarn.log.dir=/usr/lib/hadoop-yarn/logs -Dhadoop.log.file=yarn.log -Dyarn.log.file=yarn.log -Dyarn.home.dir=/usr/lib/hadoop-yarn -Dhadoop.home.dir=/usr/lib/hadoop-yarn -Dhadoop.root.logger=INFO,console -Dyarn.root.logger=INFO,console -Djava.library.path=/usr/lib/hadoop/lib/native
# Warmup: 5 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: mgm.tp.bigdata.ma_mapreduce.MapReduceBenchmark.test
# Run progress: 0.00% complete, ETA 00:00:10
# Fork: 1 of 1
Error: Could not find or load main class org.openjdk.jmh.runner.ForkedMain
<forked VM failed with exit code 1>
<stdout last='20 lines'>
</stdout>
<stderr last='20 lines'>
Error: Could not find or load main class org.openjdk.jmh.runner.ForkedMain
</stderr>
# Run complete. Total time: 00:00:00
Benchmark Mode Cnt Score Error Units
我的 shell 脚本如下:
/usr/bin/yarn jar ma-mapreduce-benchmark.jar
我的基准选项是:
public static void main(String[] args) throws Exception {
Options opt = new OptionsBuilder()
.include(MapReduceBenchmark.class.getSimpleName())
.warmupIterations(5)
.measurementIterations(5)
.forks(1)
.build();
new Runner(opt).run();
}
最佳答案
在我看来,jhm 不适用于 hadoop 集群,因为在集群的每个节点中,基准测试想要启动一个自己的 jvm。那行不通,节点为并行化进行通信。首先,我测量程序执行的时间并重复此操作,最后我计算容错率。
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
public class MapReduceBenchmarkLauncher {
private static List<Long> times = new ArrayList<Long>();
public static void main(String[] args) throws Exception {
Properties pro = new Properties();
pro.load(MapReduceBenchmarkLauncher.class.getResourceAsStream("/config.properties"));
int benchRounds = Integer.parseInt(pro.getProperty("benchmark.rounds"));
for(int i=0;i<benchRounds;i++) {
JobMain jm = new JobMain();// app being tested
long start = System.nanoTime();
jm.run();
long end = System.nanoTime();
times.add(end-start);
}
writeTimekeepingToFile(times, "mapreduce_benchmark");
}
public static void writeTimekeepingToFile(List<Long> times, String benchfile) throws Exception {
// arithmetic mean
double am = 0;
for(int i=0;i<times.size();i++) {
am = am + times.get(i);
}
am = am / times.size();
// varinaz calculation
double v = 0;
for(int i=0;i<times.size();i++) {
v = v + (times.get(i)-am)*(times.get(i)-am); // no math lib, cause long
}
v = v / times.size();
// calculating standard deviation
double s = Math.sqrt(v);
// output
BufferedWriter br = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(benchfile), "utf-8"));
for(int i=0;i<times.size();i++) {
br.write("round "+(i+1)+": "+times.get(i)+" ns\n");
}
br.write("varianz: v="+v+"\n");
br.write("standard deviation: t=("+am+" \u00B1 "+s+") ns" );
br.close();
}
}
关于java - Hadoop YARN 上的 JMH 基准测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30892720/
YARN 中的 yarn-site.xml 与 yarn-default.xml 有什么区别?看起来yarn-default.xml 在Hadoop 2.2 中已被弃用? 最佳答案 在所有 Hadoo
我们有一个在 yarn 上运行的流媒体应用程序,我们希望确保它 24/7 全天候运行。 有没有办法告诉 yarn 在失败时自动重启特定的应用程序? 最佳答案 你试过了吗Hadoop Yarn - Re
我在根队列下有 4 个队列,配置如下。 |-------------|-----------------|---------------------|-------------------| | Qu
我正在使用 YARN(和 Dask)版本 Hadoop 2.7.3-amzn-1 在 AWS EMR 上构建应用程序。我正在尝试测试各种故障场景,并且我想模拟容器故障。我似乎找不到一种简单的方法来杀死
我想创建一个 cron 来通过它的应用程序名称杀死一个 yarn 应用程序(Spark)。但我发现 yarn 应用程序 -kill 需要一个应用程序 ID。是否有解决方案可以通过应用程序名称杀死它,或
我正在尝试从此链接运行通用入门套件:https://github.com/ng-seed/universal即使我按照步骤安装了 Yarn,当我运行命令来运行服务器时,它给了我以下错误: 错误:找不到
我正在尝试 YARN 2.2 中的分布式 Shell 示例,希望有人能澄清托管和非托管应用程序管理器之间的区别是什么? 例如以下几行出现在客户端代码中 // unmanaged AM appConte
我有一个像这样的工作区项目: /project - package.json /packages /project-a package.json
这两个到底做什么用,在哪里使用它们? yarn 安装 yarn 构建 最佳答案 简而言之,yarn install 是用于安装项目所有依赖项的命令,通常在 package.json 文件中分配。在大多
所以,到目前为止,似乎没有 yarn audit --fix ,所以我想弄清楚如何修复我的 yarn audit错误。 我试过 yarn upgrade它修复了一些错误(这很好),但仍然存在一些错误。
我正在使用一个使用 yarn 的 dockerized pyspark 集群。为了提高数据处理管道的效率,我想增加分配给 pyspark 执行程序和驱动程序的内存量。 这是通过将以下两个键值对添加到
我尝试重新安装yarn,但重新安装后发现这个问题,我尝试搜索互联网但没有找到解决方案。 fiii@neo:~$ yarn --version node:internal/modules/cjs/loa
我正在试验2号纱和植面。 我创建了一个新文件夹:/projects/yarn2/根据他们的安装指南https://yarnpkg.com/getting-started我跑了 cd /projects
我是hadoop和YARN的新手。启动hdfs之后,我使用软件包中提供的start-yarn.sh启动YARN并出现错误。 我在Ubuntu 18.04上使用hadoop 3.2.0,jdk-11。
Apache Spark最近更新了版本至0.8.1,新增了yarn-client模式。我的问题是,yarn-client 模式的真正含义是什么?在文档中它说: With yarn-client mod
我们有一个在 HDFS 2.7.3 上运行的 Spark 流应用程序,使用 Yarn 作为资源管理器....在运行应用程序时......这两个文件夹 /tmp/hadoop/data/nm-local
我的机器上的 yarn 命令有问题。我的机器上安装了 hadoop 和 yarn 包管理器(Javascript)。当我运行 yarn init 时,它调用 hadoop 的 YARN 并响应: Er
我正在尝试运行此处列出的简单 yarn 应用程序:https://github.com/hortonworks/simple-yarn-app 我是 Java 和 Hadoop 的初学者,当我尝试使用
我正在尝试使用 YARN node labels标记工作节点,但是当我在 YARN(Spark 或简单的 YARN 应用程序)上运行应用程序时,这些应用程序无法启动。 使用 Spark,指定 --co
我一直只使用 npm 而从不显式使用 yarn/webpack。我需要从这个 repo 运行代码: https://github.com/looker-open-source/custom_visua
我是一名优秀的程序员,十分优秀!