#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
base_dir=/usr/local/testdemo
echo $base_dir
for file in $base_dir/libs/*.jar;
do
CLASSPATH=$CLASSPATH:$file
done
echo $CLASSPATH
if [ -z "$KAFKA_PERF_OPTS" ]; then
KAFKA_OPTS="-Xmx512M -server -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
fi
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi
java $KAFKA_OPTS -cp $CLASSPATH kafka.examples.SimpleConsumerDemo
分享到:
相关推荐
linux通用版本jar启动脚本傻瓜式启动 sh run.sh start 启动 sh run.sh stop 停止 nohup java -jar XXX.jar & nohup 意思是不挂断运行命令,当账户退出或终端关闭时,程序仍然运行
spring boot、springcloud项目一般为jar包形式运行,每次启动及关闭输命令很不爽,切且vm调优比较麻烦,编写shell脚本,将JVM调优参数及日常命令进行封装,操作简单,还不易出错,妙哉妙哉,此脚本已在我司正式使用...
基于springboot打包的jar包启动脚本与关闭脚本,脚本内配置端口,外置配置文件等。 window+Linux两种
startup.sh linux 启动jar包命令startup.sh linux 启动jar包命令startup.sh linux 启动jar包命令startup.sh linux 启动jar包命令startup.sh linux 启动jar包命令
脚本上有备注,将java项目打为jar包后,替换jar的包名为项目包名即可,log文件会自动生成,方便好用。
jar包在linux服务器上启动的通用命令构建脚本
自定义shell脚本,实现项目的启动,停止,状态
Shell脚本一键启动和停止jar,包含启动所有,启动指定的jar,停止所有,停止指定的jar,重启所有的jar
linux 一键启动 jar包 批处理脚本,适用于java 项目,spring boot 一键启动,停止,重启 等,代码简洁,可直接使用.
通过参数可以实现目录下所有jar的循环启动以及单个目录下的jar包启动。 适用人群:生产环境运维人员,需要大量启动jar包的人员、需要设置开机自启动jar包的人员。 使用方法:(1)通过sh autoStart.sh可以启动目录下...
Linux下启动和停止jar包运行的脚本
sh脚本启动java -jar
jar包启动脚本,需修改项目名称linux环境下
linux下jar包启动脚本,实测可用,只需修改你的环境变量和应用名称
linux服务器下jar包启动脚本:start.sh
电脑一开机就执行bat批处理来启动jar包,设置间隔时间来达到批量启动顺序有依赖关系的jar包
springboot jar包启动脚本, 适用于快速启动,删除, 重启, 以及查看状态. 命令 sh jar-script.sh 可以查看启动方式
以下展示启动脚本示例,过程中遇到的问题,以及相关的解决办法。 1、启动脚本 #!/bin/sh export EUREKA=ruoyi-eureka-1.0.2-SNAPSHOT.jar export CONFIG=ruoyi-config-1.0.2-SNAPSHOT.jar export AUTH=ruoyi-auth-...
windows 系统下启动与结束java的jar包的脚本(包括如何设置进程名称)