代码拉取完成,页面将自动刷新
[[TOC]]
curl -O https://caf.inspures.com/releases/latest/caf-server-full-latest.tar.gz
tar -xzvf ./caf-server-full.tar.gz
./caf-server-full-latest/bin/startup.sh
执行以下命令会优雅的关闭CAF Server,但是通过caf-server.sh run
命令启动的前台服务无法通过该命令停止。
./caf-server-full-latest/bin/shutdown.sh
通常的大型Java应用很难快速的关闭,执行以下命令可在等待宽限期(默认为5秒)后强制终止服务。
./caf-server-full-latest/bin/shutdown.sh -force
或者你可以自定义等待宽限期(按秒计算)
./caf-server-full-latest/bin/shutdown.sh 30 -force
在当前窗口前台启动CAF Server,要关闭前台启动的CAF Server需要通过组合健ctrl
+ c
来完成优雅停机。
./caf-server-full-latest/bin/caf-server.sh run
通过远程Debug模式启动CAF Server(默认监听5005端口)
./caf-server-full-latest/bin/caf-server.sh debug -remote
通过修改CAF Server的根目录的下bin/config.sh
来自定义配置环境变量。所有的可配置变量都在这个文件里,可以通过解开注释置项添加自定义配置。
指定JDK路径:
# Java Development Kit home path (Optional)
# Special Notice:
# 1. JRE is NOT supported for now, which may cause some functions to be unavailable.
# 2. Please do NOT change the default blank value unless you need to specify a dedicated JDK.
JAVA_HOME=/usr/Java/jdk1.8.0_181
自定义JVM内存选项
# CAF Server memory options (Optional)
# Used to specify the running memory size of CAF Server(eg: CAF_MEM_OPTS="-Xmx2048m -Xms512m").
CAF_MEM_OPTS="-Xmx2048m -Xms512m"
添加额外的Java运行时参数
# Additional Java Runtime arguments (Optional)
# Please clearly understand the purpose and impact of the arguments before modifying the default blank value
JAVA_OPTS="-XX:-DisableExplicitGC -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:gclog -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp"
修改CAF Server默认的控制台输出文件路径
# CAF Server console file (Optional)
# Full path to a file where stdout and stderr will be redirected.
CAF_OUT=$CAF_BASE/nohup.out
修改默认的Debug调试端口号
# CAF Server debugger address (Optional)
# Only available in debug mode.
JPDA_ADDRESS=0.0.0.0:8000
修改默认的盘根目录名
# CAF Server server path (Required)
# The default value of CAF_SERVER_PATH is "server".
# You can change it to another directory name, you should keep the following variable value matching with the actual directory name.
# Jstack is compatible with the old version, please ignore it.
CAF_SERVER_PATH=jstack
修改服务停止时的默认等待宽限期(以秒为单位)
# CAF Server stop grace period in Seconds (Optional)
# This value is the amount of time that CAF Server wait after sending a sigterm and give up waiting for the server to exit gracefully.
CAF_STOP_GRACE_PERIOD=30
开启CAF Server的并行启动功能
# CAF Server parallel init (Optional)
# When enabled, Spring Beans will be initialized in parallel.
# Optional values:
# true Beans will be initialized in parallel.
# false Beans will be initialized in the spring default way.
CAF_PARALLEL_INIT=true
Usage: caf-server.sh ( commands ... )
commands:
debug 以本地Debug方式启动CAF Server
debug -remote 以JPDA debugger方式启动CAF Server(默认5005端口调试)
run 通过前台服务的方式在当前窗口启动CAF Server
start 通过后台服务的方式启动CAF Server
stop 停止CAF Server,等待一定宽限期(默认5秒),过期后不做处理
stop n 停止CAF Server,等待n秒宽限期,过期后不做处理
stop -force 停止CAF Server,等待一定宽限期(默认5秒),过期后强制终止进程
stop n -force 停止CAF Server,等待n秒宽限期,过期后强制终止进程
详情参见 贡献指南。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。