# Multi-Server Start Commands Use the same packaged jar on both servers. Do not switch code comments before packaging. Requirements: - Build once: `mvn clean package -DskipTests` - Use profile: `server` - Put JVM options before `-jar` - Pass `AIIMAGE_INSTANCE_ID` and Redis address from the startup command - Result file job MQ is expected to stay enabled in packaged `server` deployments - Use `https://oss.aishufu.top` for the MinIO SDK and public object URLs; `https://minio.aishufu.top` is the management console only 1Panel server 121: Environment variables: ```env SPRING_PROFILES_ACTIVE=server AIIMAGE_INSTANCE_ID=server-121 AIIMAGE_REDIS_HOST=192.168.0.172 AIIMAGE_REDIS_PORT=16379 AIIMAGE_REDIS_PASSWORD=B6COTcY094TYe545 AIIMAGE_REDIS_DATABASE=0 AIIMAGE_SERVER_PORT=18080 AIIMAGE_STORAGE_LOCAL_TEMP_DIR=/app/data/tmp AIIMAGE_OSS_ENDPOINT=https://oss.aishufu.top AIIMAGE_OSS_PUBLIC_ENDPOINT=https://oss.aishufu.top AIIMAGE_RESULT_FILE_JOB_MQ_ENABLED=true AIIMAGE_ROCKETMQ_NAME_SERVER=121.196.149.225:9876 AIIMAGE_TRANSIENT_STORAGE_ENDPOINT=http://121.196.149.225:9000 AIIMAGE_SIMILAR_ASIN_IMAGE_DOWNLOAD_POOL_SIZE=2 ``` Recommended startup command: ```bash java -Xmx2048M -Xms2048M -jar /app/aiimage-backend-0.0.1-SNAPSHOT.jar ``` Baota server 111: ```bash /www/server/java/jdk-21.0.2/bin/java -Xmx1024M -Xms256M -jar /app/java/aiimage-backend-0.0.1-SNAPSHOT.jar --spring.profiles.active=server --aiimage.instance-id=server-111 --spring.data.redis.host=47.111.163.154 --spring.data.redis.port=16379 --spring.data.redis.password=B6COTcY094TYe545 --server.port=18080 --aiimage.storage.local-temp-dir=/app/data/tmp --aiimage.oss.endpoint=https://oss.aishufu.top --aiimage.oss.public-endpoint=https://oss.aishufu.top ``` Optional Baota server 121 command: ```bash /www/server/java/jdk-21.0.2/bin/java -Xmx1024M -Xms256M -jar /app/java/aiimage-backend-0.0.1-SNAPSHOT.jar --spring.profiles.active=server --aiimage.instance-id=server-121 --spring.data.redis.host=192.168.0.172 --spring.data.redis.port=16379 --spring.data.redis.password=B6COTcY094TYe545 --server.port=18080 --aiimage.storage.local-temp-dir=/app/data/tmp --aiimage.oss.endpoint=https://oss.aishufu.top --aiimage.oss.public-endpoint=https://oss.aishufu.top ``` Successful startup should show a line similar to: ```text [instance] resolved instanceId=server-121 source=configured ``` or: ```text [instance] resolved instanceId=server-111 source=configured ``` If the instanceId in the log does not match the startup command, the actual process was not started with the expected command. For the 4-core production host, set the Java container CPU limit to 2.5 cores in 1Panel (container resources / CPU limit). Keep `AIIMAGE_SIMILAR_ASIN_IMAGE_DOWNLOAD_POOL_SIZE=2`. The application also clamps this pool to half of the JVM-visible processors as a second guard.