runzhliu 2022-01-26 13:06:50 阅读数:786
Reference sources are as follows .
https://github.com/brownsys/zookeeper-benchmark
Using open source tools ZooKeeper Performance testing , Refer to official documentation , adopt mvn -DZooKeeperVersion=<version> package
package . But for ease of use , I type all the dependency packages into a big one jar It's packed , So in pom.xml Add the following plug-ins to the file , Then execute the order mvn assembly:assembly
that will do .
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.1</version> <configuration> <archive> <manifest> <!-- function jar Main class to run at package time , Class full name required --> <mainClass>edu.brown.cs.zkbenchmark.ZooKeeperBenchmark</mainClass> <!-- Specify project or not classpath Dependence under --> <addClasspath>true</addClasspath> <!-- Declare prefix when specifying dependency --> <classpathPrefix>./lib/</classpathPrefix> <!-- Depends on whether to use a unique version number with a timestamp , Such as :xxx-1.3.0-20121225.012733.jar--> <useUniqueVersions>false</useUniqueVersions> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.5</version> <configuration> <archive> <manifest> <mainClass>edu.brown.cs.zkbenchmark.ZooKeeperBenchmark</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin>
After packing , Make a simple image .
FROM openjdk:oraclelinux7 WORKDIR /zk-benchmark COPY Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo RUN yum install vim-minimal COPY ./target/zkbenchmark-0.1-SNAPSHOT-jar-with-dependencies.jar . COPY benchmark.conf .
java -jar zkbenchmark-0.1-SNAPSHOT-jar-with-dependencies.jar --conf /path/to/benchmark.conf
copyright:author[runzhliu],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201261306476590.html