Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docker/docker-compose-3pd-3store-3server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ x-server-common: &server-common
STORE_REST: store0:8520
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686
STDOUT_MODE: "true"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/versions >/dev/null || exit 1"]
interval: 10s
Expand All @@ -96,6 +97,7 @@ services:
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
HG_PD_INITIAL_STORE_COUNT: 3
STDOUT_MODE: "true"
ports: ["8620:8620", "8686:8686"]
volumes:
- hg-pd0-data:/hugegraph-pd/pd_data
Expand All @@ -114,6 +116,7 @@ services:
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
HG_PD_INITIAL_STORE_COUNT: 3
STDOUT_MODE: "true"
ports: ["8621:8620", "8687:8686"]
volumes:
- hg-pd1-data:/hugegraph-pd/pd_data
Expand All @@ -132,6 +135,7 @@ services:
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
HG_PD_INITIAL_STORE_COUNT: 3
STDOUT_MODE: "true"
ports: ["8622:8620", "8688:8686"]
volumes:
- hg-pd2-data:/hugegraph-pd/pd_data
Expand All @@ -148,6 +152,7 @@ services:
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store0:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
STDOUT_MODE: "true"
ports: ["8500:8500", "8510:8510", "8520:8520"]
volumes:
- hg-store0-data:/hugegraph-store/storage
Expand All @@ -163,6 +168,7 @@ services:
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store1:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
STDOUT_MODE: "true"
ports: ["8501:8500", "8511:8510", "8521:8520"]
volumes:
- hg-store1-data:/hugegraph-store/storage
Expand All @@ -178,6 +184,7 @@ services:
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store2:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
STDOUT_MODE: "true"
ports: ["8502:8500", "8512:8510", "8522:8520"]
volumes:
- hg-store2-data:/hugegraph-store/storage
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ services:
HG_PD_RAFT_PEERS_LIST: pd:8610
HG_PD_INITIAL_STORE_LIST: store:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
STDOUT_MODE: true
ports:
- "8620:8620"
volumes:
Expand Down Expand Up @@ -71,6 +72,7 @@ services:
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
STDOUT_MODE: true
ports:
- "8520:8520"
volumes:
Expand All @@ -96,6 +98,7 @@ services:
environment:
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd:8686
STDOUT_MODE: true
ports:
- "8080:8080"
healthcheck:
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ services:
HG_PD_RAFT_PEERS_LIST: pd:8610
HG_PD_INITIAL_STORE_LIST: store:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
STDOUT_MODE: true
ports:
- "8620:8620"
volumes:
Expand Down Expand Up @@ -69,6 +70,7 @@ services:
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
STDOUT_MODE: true
ports:
- "8520:8520"
volumes:
Expand All @@ -93,6 +95,7 @@ services:
environment:
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd:8686
STDOUT_MODE: true
ports:
- "8080:8080"
healthcheck:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,13 @@ echo "Starting HugeGraphPDServer..."
JVM_OPTIONS="-Dlog4j.configurationFile=${CONF}/log4j2.xml -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"

# Turn on security check
exec ${JAVA} -Dname="HugeGraphPD" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml ${LIB}/hg-pd-service-*.jar >> ${OUTPUT} 2>&1 &
if [[ "${STDOUT_MODE:-false}" == "true" ]]; then
exec ${JAVA} -Dname="HugeGraphPD" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml ${LIB}/hg-pd-service-*.jar &
else
exec ${JAVA} -Dname="HugeGraphPD" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml ${LIB}/hg-pd-service-*.jar >> ${OUTPUT} 2>&1 &
fi

PID="$!"
# Write pid to file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

<loggers>
<root level="INFO">
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
Comment on lines 116 to 120
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the other dist configs, adding console to <root> won’t surface logs from any additivity="false" loggers that only write to raft_file/file. If the goal is comprehensive docker logs output, consider also wiring console into those additivity=false logger definitions (this matches the wiring used in hg-pd-service/src/main/resources/log4j2.xml).

Copilot uses AI. Check for mistakes.
<logger name="com.alipay.sofa" level="INFO" additivity="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ if [ "${OPEN_TELEMETRY}" == "true" ]; then
fi

# Turn on security check
exec ${JAVA} -Dname="HugeGraphServer" ${JVM_OPTIONS} ${JAVA_OPTIONS} -cp ${CLASSPATH}: \
org.apache.hugegraph.dist.HugeGraphServer ${GREMLIN_SERVER_CONF} ${REST_SERVER_CONF} \
>> ${OUTPUT} 2>&1
if [[ "${STDOUT_MODE:-false}" == "true" ]]; then
exec ${JAVA} -Dname="HugeGraphServer" ${JVM_OPTIONS} ${JAVA_OPTIONS} -cp ${CLASSPATH}: \
org.apache.hugegraph.dist.HugeGraphServer ${GREMLIN_SERVER_CONF} ${REST_SERVER_CONF}
else
exec ${JAVA} -Dname="HugeGraphServer" ${JVM_OPTIONS} ${JAVA_OPTIONS} -cp ${CLASSPATH}: \
org.apache.hugegraph.dist.HugeGraphServer ${GREMLIN_SERVER_CONF} ${REST_SERVER_CONF} \
>> ${OUTPUT} 2>&1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,26 @@ if [[ $PRELOAD == "true" ]]; then
sed -i -e '/registerBackends/d; /serverStarted/d' "${SCRIPTS}/${EXAMPLE_SCRIPT}"
fi

# TODO: show the output message in hugegraph-server.sh when start the server
if [[ $DAEMON == "true" ]]; then
echo "Starting HugeGraphServer in daemon mode..."
Copy link
Copy Markdown
Member

@imbajin imbajin Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The safer, lower-risk approach is to add an explicit switch for Docker/stdout mode instead of removing >> ${OUTPUT} 2>&1 from the default startup path.

That keeps the binary-package flow unchanged and still lets containers stream clean logs via docker logs when the switch is enabled.

Default package: start-*.sh -> exec java -> >> logs/*.log 2>&1

Docker package:   entrypoint -> set STDOUT_MODE=true -> exec java -> stdout + console appender

I would keep the file-based behavior by default, then enable stdout only in the Docker entrypoint and wire the console appender in the matching log config.

"${BIN}"/hugegraph-server.sh "${CONF}/${GREMLIN_SERVER_CONF}" "${CONF}"/rest-server.properties \
"${OPEN_SECURITY_CHECK}" "${USER_OPTION}" "${GC_OPTION}" "${OPEN_TELEMETRY}" \
>>"${LOGS}"/hugegraph-server.log 2>&1 &
if [[ "${STDOUT_MODE:-false}" == "true" ]]; then
"${BIN}"/hugegraph-server.sh "${CONF}/${GREMLIN_SERVER_CONF}" "${CONF}"/rest-server.properties \
"${OPEN_SECURITY_CHECK}" "${USER_OPTION}" "${GC_OPTION}" "${OPEN_TELEMETRY}" &
else
"${BIN}"/hugegraph-server.sh "${CONF}/${GREMLIN_SERVER_CONF}" "${CONF}"/rest-server.properties \
"${OPEN_SECURITY_CHECK}" "${USER_OPTION}" "${GC_OPTION}" "${OPEN_TELEMETRY}" \
>>"${LOGS}"/hugegraph-server.log 2>&1 &
fi
else
echo "Starting HugeGraphServer in foreground mode..."
"${BIN}"/hugegraph-server.sh "${CONF}/${GREMLIN_SERVER_CONF}" "${CONF}"/rest-server.properties \
"${OPEN_SECURITY_CHECK}" "${USER_OPTION}" "${GC_OPTION}" "${OPEN_TELEMETRY}" \
>>"${LOGS}"/hugegraph-server.log 2>&1
if [[ "${STDOUT_MODE:-false}" == "true" ]]; then
"${BIN}"/hugegraph-server.sh "${CONF}/${GREMLIN_SERVER_CONF}" "${CONF}"/rest-server.properties \
"${OPEN_SECURITY_CHECK}" "${USER_OPTION}" "${GC_OPTION}" "${OPEN_TELEMETRY}"
else
"${BIN}"/hugegraph-server.sh "${CONF}/${GREMLIN_SERVER_CONF}" "${CONF}"/rest-server.properties \
"${OPEN_SECURITY_CHECK}" "${USER_OPTION}" "${GC_OPTION}" "${OPEN_TELEMETRY}" \
>>"${LOGS}"/hugegraph-server.log 2>&1
fi
fi

PID="$!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@

<loggers>
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
<logger name="org.apache.cassandra" level="INFO" additivity="false">
Expand All @@ -129,6 +130,7 @@
</logger>
<!-- Use mixed async way to output logs -->
<AsyncLogger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.auth" level="INFO" additivity="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,16 @@ fi

echo "Starting HG-StoreServer..."

exec ${JAVA} -Dname="HugeGraphStore" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml \
${LIB}/hg-store-node-*.jar >> ${OUTPUT} 2>&1 &
# Turn on security check
if [[ "${STDOUT_MODE:-false}" == "true" ]]; then
exec ${JAVA} -Dname="HugeGraphStore" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml \
${LIB}/hg-store-node-*.jar &
else
exec ${JAVA} -Dname="HugeGraphStore" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml \
${LIB}/hg-store-node-*.jar >> ${OUTPUT} 2>&1 &
fi

PID="$!"
# Write pid to file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@

<loggers>
<root level="INFO">
<appender-ref ref="console"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

‼️ Same issue in the store config: the root console appender does not cover the additivity="false" logger blocks below, so io.netty / org.apache.commons / com.alipay.sofa output is still invisible in docker logs. If the goal is a complete container stream, those explicit loggers need console as well.

<appender-ref ref="file"/>
</root>
Comment on lines 118 to 122
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the console appender to the root logger won’t make logs from loggers with additivity="false" appear in docker logs. In this config, com.alipay.sofa (and other explicitly configured loggers) only write to raft_file/file, so raft/third‑party logs will still be missing from stdout. Consider also adding a console appender-ref to those additivity=false loggers (or revisiting additivity) to fully achieve the Docker logging goal.

Copilot uses AI. Check for mistakes.
<logger name="com.alipay.sofa" level="INFO" additivity="false">
Expand Down
Loading