# caf-server **Repository Path**: ubml/caf-server ## Basic Information - **Project Name**: caf-server - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-17 - **Last Updated**: 2023-11-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CAF Server [๐Ÿ‡จ๐Ÿ‡ณ็ฎ€ไฝ“ไธญๆ–‡](README.md) | [๐Ÿ‡บ๐Ÿ‡ธEnglish](README.en.md) ## Contents [[_TOC_]] ## ๐Ÿš€ Quick Start ### Download CAF Server with cURL ```shell curl -O https://caf.inspures.com/releases/latest/caf-server-full-latest.tar.gz tar -xzvf ./caf-server-full.tar.gz ``` ### Start CAF Server as a background sevice ```shell ./caf-server-full-latest/bin/startup.sh ``` ### Shutdown CAF Server Execute the following will attempt to stop the CAF Server gracefully. But it will not affect the foreground service started with the `caf-server.sh run` command. ```shell ./caf-server-full-latest/bin/shutdown.sh ``` Usually large Java applications are difficult to shut down quickly. The following command can be used to force kill the process after waiting for a grace period (5 seconds by default). ```shell ./caf-server-full-latest/bin/shutdown.sh -force ``` Or you can also specify a grace period (in seconds). ```shell ./caf-server-full-latest/bin/shutdown.sh 30 -force ``` ## ๐Ÿง— Advanced Start CAF in the current window. To stop the CAF Server running in the current window, you need to press `ctrl` + `c`. ```shell ./caf-server-full-latest/bin/caf-server.sh run ``` Start CAF Server with a remote debugger (listening *:5005 by default). ```shell ./caf-server-full-latest/bin/caf-server.sh debug -remote ``` ## ๐ŸŽ› Configurations Customize your own deployment environment by modifying `$CAF_HOME/bin/config.sh`. All available configuration items are provided with examples in this file, uncomment to customize the configuration. Specify a dedicated JDK: ```conf # 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 ``` Custom JVM memory options ```conf # 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" ``` Add additional Java Runtime arguments: ```conf # 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" ``` Change the file path of the CAF Server console output: ```conf # CAF Server console file (Optional) # Full path to a file where stdout and stderr will be redirected. CAF_OUT=$CAF_BASE/nohup.out ``` Change the listening port for remote debugging: ```conf # CAF Server debugger address (Optional) # Only available in debug mode. JPDA_ADDRESS=0.0.0.0:8000 ``` Change the server path name: ```conf # 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 ``` Change the default stop grace period (in seconds): ```conf # 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 ``` Enable CAF parallel initializing: ```conf # 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 ``` ## ๐Ÿ“– Reference ```shell Usage: caf-server.sh ( commands ... ) commands: debug Start CAF Server in a debugger debug -remote Start CAF Server with remote debugger run Start CAF Server in the current window start Start CAF Server in a separate window stop Stop CAF Server, waiting up to 5 (by default) seconds for the process to end stop n Stop CAF Server, waiting up to n seconds for the process to end stop -force Stop CAF Server, wait up to 5 (by default) seconds and then use kill -KILL if still running stop n -force Stop CAF Server, wait up to n seconds and then use kill -KILL if still running ``` ## ๐Ÿ›  Contributing Please see [CONTRIBUTING](CONTRIBUTING.md) for more info.