refactor(docker): migrate single-node compose from host to bridge networking (#2952)

* docker: migrate from host to bridge networking

Replace network_mode: host with explicit port mappings and add configuration
volumes for PD, Store, and Server services to support macOS/Windows Docker.

- Remove host network mode from all services
- Add explicit port mappings (8620, 8520, 8080)
- Add configuration directories with volume mounts
- Update healthcheck endpoints
- Add PD peers environment variable
This commit is contained in:
Himanshu Verma 2026-03-20 13:51:59 +05:30 committed by GitHub
parent 62bcdc5d78
commit 0154c06422
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 640 additions and 1710 deletions

View File

@ -1,63 +0,0 @@
#
# 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.
#
spring:
application:
name: hugegraph-pd
management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"
logging:
config: 'file:./conf/log4j2.xml'
license:
verify-path: ./conf/verify-license.json
license-path: ./conf/hugegraph.license
grpc:
port: 8686
host: 127.0.0.1
server:
port: 8620
pd:
data-path: ./pd_data
patrol-interval: 1800
initial-store-count: 3
initial-store-list: 127.0.0.1:8500,127.0.0.1:8501,127.0.0.1:8502
raft:
address: 127.0.0.1:8610
peers-list: 127.0.0.1:8610,127.0.0.1:8611,127.0.0.1:8612
store:
max-down-time: 172800
monitor_data_enabled: true
monitor_data_interval: 1 minute
monitor_data_retention: 1 day
initial-store-count: 1
partition:
default-shard-count: 1
store-max-shard-count: 12

View File

@ -1,63 +0,0 @@
#
# 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.
#
spring:
application:
name: hugegraph-pd
management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"
logging:
config: 'file:./conf/log4j2.xml'
license:
verify-path: ./conf/verify-license.json
license-path: ./conf/hugegraph.license
grpc:
port: 8687
host: 127.0.0.1
server:
port: 8621
pd:
data-path: ./pd_data
patrol-interval: 1800
initial-store-count: 3
initial-store-list: 127.0.0.1:8500,127.0.0.1:8501,127.0.0.1:8502
raft:
address: 127.0.0.1:8611
peers-list: 127.0.0.1:8610,127.0.0.1:8611,127.0.0.1:8612
store:
max-down-time: 172800
monitor_data_enabled: true
monitor_data_interval: 1 minute
monitor_data_retention: 1 day
initial-store-count: 1
partition:
default-shard-count: 1
store-max-shard-count: 12

View File

@ -1,63 +0,0 @@
#
# 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.
#
spring:
application:
name: hugegraph-pd
management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"
logging:
config: 'file:./conf/log4j2.xml'
license:
verify-path: ./conf/verify-license.json
license-path: ./conf/hugegraph.license
grpc:
port: 8688
host: 127.0.0.1
server:
port: 8622
pd:
data-path: ./pd_data
patrol-interval: 1800
initial-store-count: 3
initial-store-list: 127.0.0.1:8500,127.0.0.1:8501,127.0.0.1:8502
raft:
address: 127.0.0.1:8612
peers-list: 127.0.0.1:8610,127.0.0.1:8611,127.0.0.1:8612
store:
max-down-time: 172800
monitor_data_enabled: true
monitor_data_interval: 1 minute
monitor_data_retention: 1 day
initial-store-count: 1
partition:
default-shard-count: 1
store-max-shard-count: 12

View File

@ -1,57 +0,0 @@
#
# 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.
#
pdserver:
address: 127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"
grpc:
host: 127.0.0.1
port: 8500
netty-server:
max-inbound-message-size: 1000MB
raft:
disruptorBufferSize: 1024
address: 127.0.0.1:8510
max-log-file-size: 600000000000
snapshotInterval: 1800
server:
port: 8520
app:
data-path: ./storage
spring:
application:
name: store-node-grpc-server
profiles:
active: default
include: pd
logging:
config: 'file:./conf/log4j2.xml'
level:
root: info

View File

@ -1,57 +0,0 @@
#
# 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.
#
pdserver:
address: 127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"
grpc:
host: 127.0.0.1
port: 8501
netty-server:
max-inbound-message-size: 1000MB
raft:
disruptorBufferSize: 1024
address: 127.0.0.1:8511
max-log-file-size: 600000000000
snapshotInterval: 1800
server:
port: 8521
app:
data-path: ./storage
spring:
application:
name: store-node-grpc-server
profiles:
active: default
include: pd
logging:
config: 'file:./conf/log4j2.xml'
level:
root: info

View File

@ -1,57 +0,0 @@
#
# 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.
#
pdserver:
address: 127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"
grpc:
host: 127.0.0.1
port: 8502
netty-server:
max-inbound-message-size: 1000MB
raft:
disruptorBufferSize: 1024
address: 127.0.0.1:8512
max-log-file-size: 600000000000
snapshotInterval: 1800
server:
port: 8522
app:
data-path: ./storage
spring:
application:
name: store-node-grpc-server
profiles:
active: default
include: pd
logging:
config: 'file:./conf/log4j2.xml'
level:
root: info

View File

@ -1,19 +0,0 @@
# auth config: org.apache.hugegraph.auth.HugeFactoryAuthProxy
gremlin.graph=org.apache.hugegraph.HugeFactory
# cache config
vertex.cache_type=l2
edge.cache_type=l2
store=hugegraph
backend=hstore
serializer=binary
# pd config
pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
# task config
task.scheduler_type=local
task.schedule_period=10
task.retry=0
task.wait_timeout=10

View File

@ -1,25 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8181
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}

View File

@ -1,127 +0,0 @@
#
# 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.
#
# host and port of gremlin server, need to be consistent with host and port in rest-server.properties
host: 127.0.0.1
port: 8181
# timeout in ms of gremlin query
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
# don't set graph at here, this happens after support for dynamically adding graph
graphs: {
}
scriptEngines: {
gremlin-groovy: {
staticImports: [
org.opencypher.gremlin.process.traversal.CustomPredicates.*',
org.opencypher.gremlin.traversal.CustomFunctions.*
],
plugins: {
org.apache.hugegraph.plugin.HugeGraphGremlinPlugin: {},
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {
classImports: [
java.lang.Math,
org.apache.hugegraph.backend.id.IdGenerator,
org.apache.hugegraph.type.define.Directions,
org.apache.hugegraph.type.define.NodeRole,
org.apache.hugegraph.masterelection.GlobalMasterInfo,
org.apache.hugegraph.util.DateUtil,
org.apache.hugegraph.traversal.algorithm.CollectionPathsTraverser,
org.apache.hugegraph.traversal.algorithm.CountTraverser,
org.apache.hugegraph.traversal.algorithm.CustomizedCrosspointsTraverser,
org.apache.hugegraph.traversal.algorithm.CustomizePathsTraverser,
org.apache.hugegraph.traversal.algorithm.FusiformSimilarityTraverser,
org.apache.hugegraph.traversal.algorithm.HugeTraverser,
org.apache.hugegraph.traversal.algorithm.JaccardSimilarTraverser,
org.apache.hugegraph.traversal.algorithm.KneighborTraverser,
org.apache.hugegraph.traversal.algorithm.KoutTraverser,
org.apache.hugegraph.traversal.algorithm.MultiNodeShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.NeighborRankTraverser,
org.apache.hugegraph.traversal.algorithm.PathsTraverser,
org.apache.hugegraph.traversal.algorithm.PersonalRankTraverser,
org.apache.hugegraph.traversal.algorithm.SameNeighborTraverser,
org.apache.hugegraph.traversal.algorithm.ShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.SubGraphTraverser,
org.apache.hugegraph.traversal.algorithm.TemplatePathsTraverser,
org.apache.hugegraph.traversal.algorithm.steps.EdgeStep,
org.apache.hugegraph.traversal.algorithm.steps.RepeatEdgeStep,
org.apache.hugegraph.traversal.algorithm.steps.WeightedEdgeStep,
org.apache.hugegraph.traversal.optimize.ConditionP,
org.apache.hugegraph.traversal.optimize.Text,
org.apache.hugegraph.traversal.optimize.TraversalUtil,
org.opencypher.gremlin.traversal.CustomFunctions,
org.opencypher.gremlin.traversal.CustomPredicate
],
methodImports: [
java.lang.Math#*,
org.opencypher.gremlin.traversal.CustomPredicate#*,
org.opencypher.gremlin.traversal.CustomFunctions#*
]
},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {
files: [scripts/empty-sample.groovy]
}
}
}
}
serializers:
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
metrics: {
consoleReporter: {enabled: false, interval: 180000},
csvReporter: {enabled: false, interval: 180000, fileName: ./metrics/gremlin-server-metrics.csv},
jmxReporter: {enabled: false},
slf4jReporter: {enabled: false, interval: 180000},
gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
graphiteReporter: {enabled: false, interval: 180000}
}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
enabled: false
}

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!-- Config will be auto loaded every 60s -->
<configuration status="error" monitorInterval="60">
<properties>
<property name="LOG_PATH">logs</property>
<property name="FILE_NAME">hugegraph-server</property>
</properties>
<appenders>
<Console name="console" target="SYSTEM_OUT">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
</Console>
<!-- Normal server log config -->
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="50MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="5">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log"/>
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB"/>
<IfAccumulatedFileCount exceeds="100"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<!-- Separate & compress audit log, buffer size is 512KB -->
<RollingRandomAccessFile name="audit" fileName="${LOG_PATH}/audit-${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<!-- Use simple format for audit log to speed up -->
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
<!-- Trigger after exceeding 1hour or 500MB -->
<Policies>
<SizeBasedTriggeringPolicy size="500MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
<DefaultRolloverStrategy max="2">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.gz"/>
<IfLastModified age="60d"/>
<IfAny>
<IfAccumulatedFileSize exceeds="5GB"/>
<IfAccumulatedFileCount exceeds="500"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<!-- Slow query log config -->
<RollingRandomAccessFile name="slowQueryLog" fileName="${LOG_PATH}/slow_query.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/slow_query_log-%d{yyyy-MM-dd}-%i.log"
immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="50MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="5">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log"/>
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB"/>
<IfAccumulatedFileCount exceeds="100"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</appenders>
<loggers>
<root level="INFO">
<appender-ref ref="file"/>
</root>
<logger name="org.apache.cassandra" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.hadoop" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.zookeeper" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="com.datastax.driver" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="com.alipay.sofa" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="io.netty" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.commons" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<!-- Use mixed async way to output logs -->
<AsyncLogger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="file"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.auth" level="INFO" additivity="false">
<appender-ref ref="audit"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.api.filter.AuthenticationFilter" level="INFO" additivity="false">
<appender-ref ref="audit"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.api.filter.AccessLogFilter" level="INFO" additivity="false">
<appender-ref ref="slowQueryLog"/>
</AsyncLogger>
</loggers>
</configuration>

View File

@ -1,30 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8181
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
# The duplication of HugeGraphIoRegistry is meant to fix a bug in the
# 'org.apache.tinkerpop.gremlin.driver.Settings:from(Configuration)' method.
ioRegistries: [
org.apache.hugegraph.io.HugeGraphIoRegistry,
org.apache.hugegraph.io.HugeGraphIoRegistry
]
}
}

View File

@ -1,25 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8181
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}

View File

@ -1,29 +0,0 @@
# bind url
restserver.url=127.0.0.1:8081
# gremlin server url, need to be consistent with host and port in gremlin-server.yaml
gremlinserver.url=127.0.0.1:8181
graphs=./conf/graphs
# configuration of arthas
arthas.telnet_port=8562
arthas.http_port=8561
arthas.ip=127.0.0.1
arthas.disabled_commands=jad
# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa
# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
rpc.server_port=8091
# lightweight load balancing (beta)
server.id=server-1
server.role=master
# slow query log
log.slow_query_threshold=1000

View File

@ -1,19 +0,0 @@
# auth config: org.apache.hugegraph.auth.HugeFactoryAuthProxy
gremlin.graph=org.apache.hugegraph.HugeFactory
# cache config
vertex.cache_type=l2
edge.cache_type=l2
store=hugegraph
backend=hstore
serializer=binary
# pd config
pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
# task config
task.scheduler_type=local
task.schedule_period=10
task.retry=0
task.wait_timeout=10

View File

@ -1,25 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}

View File

@ -1,127 +0,0 @@
#
# 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.
#
# host and port of gremlin server, need to be consistent with host and port in rest-server.properties
host: 127.0.0.1
port: 8182
# timeout in ms of gremlin query
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
# don't set graph at here, this happens after support for dynamically adding graph
graphs: {
}
scriptEngines: {
gremlin-groovy: {
staticImports: [
org.opencypher.gremlin.process.traversal.CustomPredicates.*',
org.opencypher.gremlin.traversal.CustomFunctions.*
],
plugins: {
org.apache.hugegraph.plugin.HugeGraphGremlinPlugin: {},
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {
classImports: [
java.lang.Math,
org.apache.hugegraph.backend.id.IdGenerator,
org.apache.hugegraph.type.define.Directions,
org.apache.hugegraph.type.define.NodeRole,
org.apache.hugegraph.masterelection.GlobalMasterInfo,
org.apache.hugegraph.util.DateUtil,
org.apache.hugegraph.traversal.algorithm.CollectionPathsTraverser,
org.apache.hugegraph.traversal.algorithm.CountTraverser,
org.apache.hugegraph.traversal.algorithm.CustomizedCrosspointsTraverser,
org.apache.hugegraph.traversal.algorithm.CustomizePathsTraverser,
org.apache.hugegraph.traversal.algorithm.FusiformSimilarityTraverser,
org.apache.hugegraph.traversal.algorithm.HugeTraverser,
org.apache.hugegraph.traversal.algorithm.JaccardSimilarTraverser,
org.apache.hugegraph.traversal.algorithm.KneighborTraverser,
org.apache.hugegraph.traversal.algorithm.KoutTraverser,
org.apache.hugegraph.traversal.algorithm.MultiNodeShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.NeighborRankTraverser,
org.apache.hugegraph.traversal.algorithm.PathsTraverser,
org.apache.hugegraph.traversal.algorithm.PersonalRankTraverser,
org.apache.hugegraph.traversal.algorithm.SameNeighborTraverser,
org.apache.hugegraph.traversal.algorithm.ShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.SubGraphTraverser,
org.apache.hugegraph.traversal.algorithm.TemplatePathsTraverser,
org.apache.hugegraph.traversal.algorithm.steps.EdgeStep,
org.apache.hugegraph.traversal.algorithm.steps.RepeatEdgeStep,
org.apache.hugegraph.traversal.algorithm.steps.WeightedEdgeStep,
org.apache.hugegraph.traversal.optimize.ConditionP,
org.apache.hugegraph.traversal.optimize.Text,
org.apache.hugegraph.traversal.optimize.TraversalUtil,
org.opencypher.gremlin.traversal.CustomFunctions,
org.opencypher.gremlin.traversal.CustomPredicate
],
methodImports: [
java.lang.Math#*,
org.opencypher.gremlin.traversal.CustomPredicate#*,
org.opencypher.gremlin.traversal.CustomFunctions#*
]
},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {
files: [scripts/empty-sample.groovy]
}
}
}
}
serializers:
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
metrics: {
consoleReporter: {enabled: false, interval: 180000},
csvReporter: {enabled: false, interval: 180000, fileName: ./metrics/gremlin-server-metrics.csv},
jmxReporter: {enabled: false},
slf4jReporter: {enabled: false, interval: 180000},
gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
graphiteReporter: {enabled: false, interval: 180000}
}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
enabled: false
}

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!-- Config will be auto loaded every 60s -->
<configuration status="error" monitorInterval="60">
<properties>
<property name="LOG_PATH">logs</property>
<property name="FILE_NAME">hugegraph-server</property>
</properties>
<appenders>
<Console name="console" target="SYSTEM_OUT">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
</Console>
<!-- Normal server log config -->
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="50MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="5">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log"/>
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB"/>
<IfAccumulatedFileCount exceeds="100"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<!-- Separate & compress audit log, buffer size is 512KB -->
<RollingRandomAccessFile name="audit" fileName="${LOG_PATH}/audit-${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<!-- Use simple format for audit log to speed up -->
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
<!-- Trigger after exceeding 1hour or 500MB -->
<Policies>
<SizeBasedTriggeringPolicy size="500MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
<DefaultRolloverStrategy max="2">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.gz"/>
<IfLastModified age="60d"/>
<IfAny>
<IfAccumulatedFileSize exceeds="5GB"/>
<IfAccumulatedFileCount exceeds="500"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<!-- Slow query log config -->
<RollingRandomAccessFile name="slowQueryLog" fileName="${LOG_PATH}/slow_query.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/slow_query_log-%d{yyyy-MM-dd}-%i.log"
immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="50MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="5">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log"/>
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB"/>
<IfAccumulatedFileCount exceeds="100"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</appenders>
<loggers>
<root level="INFO">
<appender-ref ref="file"/>
</root>
<logger name="org.apache.cassandra" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.hadoop" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.zookeeper" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="com.datastax.driver" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="com.alipay.sofa" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="io.netty" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.commons" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<!-- Use mixed async way to output logs -->
<AsyncLogger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="file"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.auth" level="INFO" additivity="false">
<appender-ref ref="audit"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.api.filter.AuthenticationFilter" level="INFO" additivity="false">
<appender-ref ref="audit"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.api.filter.AccessLogFilter" level="INFO" additivity="false">
<appender-ref ref="slowQueryLog"/>
</AsyncLogger>
</loggers>
</configuration>

View File

@ -1,30 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
# The duplication of HugeGraphIoRegistry is meant to fix a bug in the
# 'org.apache.tinkerpop.gremlin.driver.Settings:from(Configuration)' method.
ioRegistries: [
org.apache.hugegraph.io.HugeGraphIoRegistry,
org.apache.hugegraph.io.HugeGraphIoRegistry
]
}
}

View File

@ -1,27 +0,0 @@
# bind url
restserver.url=127.0.0.1:8082
# gremlin server url, need to be consistent with host and port in gremlin-server.yaml
gremlinserver.url=127.0.0.1:8182
graphs=./conf/graphs
# configuration of arthas
arthas.telnet_port=8572
arthas.http_port=8571
arthas.ip=127.0.0.1
arthas.disabled_commands=jad
# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa
# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
rpc.server_port=8092
#rpc.server_timeout=30
# lightweight load balancing (beta)
server.id=server-2
server.role=worker

View File

@ -1,19 +0,0 @@
# auth config: org.apache.hugegraph.auth.HugeFactoryAuthProxy
gremlin.graph=org.apache.hugegraph.HugeFactory
# cache config
vertex.cache_type=l2
edge.cache_type=l2
store=hugegraph
backend=hstore
serializer=binary
# pd config
pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688
# task config
task.scheduler_type=local
task.schedule_period=10
task.retry=0
task.wait_timeout=10

View File

@ -1,25 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8183
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}

View File

@ -1,127 +0,0 @@
#
# 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.
#
# host and port of gremlin server, need to be consistent with host and port in rest-server.properties
host: 127.0.0.1
port: 8183
# timeout in ms of gremlin query
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
# don't set graph at here, this happens after support for dynamically adding graph
graphs: {
}
scriptEngines: {
gremlin-groovy: {
staticImports: [
org.opencypher.gremlin.process.traversal.CustomPredicates.*',
org.opencypher.gremlin.traversal.CustomFunctions.*
],
plugins: {
org.apache.hugegraph.plugin.HugeGraphGremlinPlugin: {},
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {
classImports: [
java.lang.Math,
org.apache.hugegraph.backend.id.IdGenerator,
org.apache.hugegraph.type.define.Directions,
org.apache.hugegraph.type.define.NodeRole,
org.apache.hugegraph.masterelection.GlobalMasterInfo,
org.apache.hugegraph.util.DateUtil,
org.apache.hugegraph.traversal.algorithm.CollectionPathsTraverser,
org.apache.hugegraph.traversal.algorithm.CountTraverser,
org.apache.hugegraph.traversal.algorithm.CustomizedCrosspointsTraverser,
org.apache.hugegraph.traversal.algorithm.CustomizePathsTraverser,
org.apache.hugegraph.traversal.algorithm.FusiformSimilarityTraverser,
org.apache.hugegraph.traversal.algorithm.HugeTraverser,
org.apache.hugegraph.traversal.algorithm.JaccardSimilarTraverser,
org.apache.hugegraph.traversal.algorithm.KneighborTraverser,
org.apache.hugegraph.traversal.algorithm.KoutTraverser,
org.apache.hugegraph.traversal.algorithm.MultiNodeShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.NeighborRankTraverser,
org.apache.hugegraph.traversal.algorithm.PathsTraverser,
org.apache.hugegraph.traversal.algorithm.PersonalRankTraverser,
org.apache.hugegraph.traversal.algorithm.SameNeighborTraverser,
org.apache.hugegraph.traversal.algorithm.ShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser,
org.apache.hugegraph.traversal.algorithm.SubGraphTraverser,
org.apache.hugegraph.traversal.algorithm.TemplatePathsTraverser,
org.apache.hugegraph.traversal.algorithm.steps.EdgeStep,
org.apache.hugegraph.traversal.algorithm.steps.RepeatEdgeStep,
org.apache.hugegraph.traversal.algorithm.steps.WeightedEdgeStep,
org.apache.hugegraph.traversal.optimize.ConditionP,
org.apache.hugegraph.traversal.optimize.Text,
org.apache.hugegraph.traversal.optimize.TraversalUtil,
org.opencypher.gremlin.traversal.CustomFunctions,
org.opencypher.gremlin.traversal.CustomPredicate
],
methodImports: [
java.lang.Math#*,
org.opencypher.gremlin.traversal.CustomPredicate#*,
org.opencypher.gremlin.traversal.CustomFunctions#*
]
},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {
files: [scripts/empty-sample.groovy]
}
}
}
}
serializers:
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
- {className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
metrics: {
consoleReporter: {enabled: false, interval: 180000},
csvReporter: {enabled: false, interval: 180000, fileName: ./metrics/gremlin-server-metrics.csv},
jmxReporter: {enabled: false},
slf4jReporter: {enabled: false, interval: 180000},
gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
graphiteReporter: {enabled: false, interval: 180000}
}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
enabled: false
}

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!-- Config will be auto loaded every 60s -->
<configuration status="error" monitorInterval="60">
<properties>
<property name="LOG_PATH">logs</property>
<property name="FILE_NAME">hugegraph-server</property>
</properties>
<appenders>
<Console name="console" target="SYSTEM_OUT">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
</Console>
<!-- Normal server log config -->
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="50MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="5">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log"/>
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB"/>
<IfAccumulatedFileCount exceeds="100"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<!-- Separate & compress audit log, buffer size is 512KB -->
<RollingRandomAccessFile name="audit" fileName="${LOG_PATH}/audit-${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/audit-${FILE_NAME}-%d{yyyy-MM-dd-HH}-%i.gz"
bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<!-- Use simple format for audit log to speed up -->
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
<!-- Trigger after exceeding 1hour or 500MB -->
<Policies>
<SizeBasedTriggeringPolicy size="500MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
<DefaultRolloverStrategy max="2">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.gz"/>
<IfLastModified age="60d"/>
<IfAny>
<IfAccumulatedFileSize exceeds="5GB"/>
<IfAccumulatedFileCount exceeds="500"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<!-- Slow query log config -->
<RollingRandomAccessFile name="slowQueryLog" fileName="${LOG_PATH}/slow_query.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/slow_query_log-%d{yyyy-MM-dd}-%i.log"
immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="50MB"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="5">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log"/>
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB"/>
<IfAccumulatedFileCount exceeds="100"/>
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</appenders>
<loggers>
<root level="INFO">
<appender-ref ref="file"/>
</root>
<logger name="org.apache.cassandra" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.hadoop" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.zookeeper" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="com.datastax.driver" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="com.alipay.sofa" level="WARN" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="io.netty" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<logger name="org.apache.commons" level="INFO" additivity="false">
<appender-ref ref="file"/>
</logger>
<!-- Use mixed async way to output logs -->
<AsyncLogger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="file"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.auth" level="INFO" additivity="false">
<appender-ref ref="audit"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.api.filter.AuthenticationFilter" level="INFO" additivity="false">
<appender-ref ref="audit"/>
</AsyncLogger>
<AsyncLogger name="org.apache.hugegraph.api.filter.AccessLogFilter" level="INFO" additivity="false">
<appender-ref ref="slowQueryLog"/>
</AsyncLogger>
</loggers>
</configuration>

View File

@ -1,30 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8183
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
# The duplication of HugeGraphIoRegistry is meant to fix a bug in the
# 'org.apache.tinkerpop.gremlin.driver.Settings:from(Configuration)' method.
ioRegistries: [
org.apache.hugegraph.io.HugeGraphIoRegistry,
org.apache.hugegraph.io.HugeGraphIoRegistry
]
}
}

View File

@ -1,25 +0,0 @@
#
# 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.
#
hosts: [localhost]
port: 8183
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}

View File

@ -1,26 +0,0 @@
# bind url
restserver.url=127.0.0.1:8083
# gremlin server url, need to be consistent with host and port in gremlin-server.yaml
gremlinserver.url=127.0.0.1:8183
graphs=./conf/graphs
# configuration of arthas
arthas.telnet_port=8582
arthas.http_port=8581
arthas.ip=127.0.0.1
arthas.disabled_commands=jad
# authentication configs
# choose 'org.apache.hugegraph.auth.StandardAuthenticator' or a custom implementation
#auth.authenticator=
# for admin password, By default, it is pa and takes effect upon the first startup
#auth.admin_pa=pa
# rpc server configs for multi graph-servers or raft-servers
rpc.server_host=127.0.0.1
rpc.server_port=8093
# lightweight load balancing (beta)
server.id=server-3
server.role=worker

View File

@ -15,166 +15,210 @@
# limitations under the License.
#
# TODO: reuse the configs for same type containers
# User could modify the node nums and the port by themselves
version: "3"
name: hugegraph-3x3
networks:
hg-net:
driver: bridge
volumes:
hg-pd0-data:
hg-pd1-data:
hg-pd2-data:
hg-store0-data:
hg-store1-data:
hg-store2-data:
# ── Shared service defaults ──────────────────────────────────────────
# TODO: remove volume mounts below once images are published with new entrypoints
x-pd-common: &pd-common
image: hugegraph/pd:${HUGEGRAPH_VERSION:-latest}
pull_policy: missing
restart: unless-stopped
networks: [hg-net]
entrypoint: ["/hugegraph-pd/docker-entrypoint.sh"]
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8620/v1/health >/dev/null || exit 1"]
interval: 15s
timeout: 10s
retries: 30
start_period: 120s
x-store-common: &store-common
image: hugegraph/store:${HUGEGRAPH_VERSION:-latest}
pull_policy: missing
restart: unless-stopped
networks: [hg-net]
depends_on:
pd0: { condition: service_healthy }
pd1: { condition: service_healthy }
pd2: { condition: service_healthy }
entrypoint: ["/hugegraph-store/docker-entrypoint.sh"]
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8520/v1/health >/dev/null || exit 1"]
interval: 15s
timeout: 15s
retries: 40
start_period: 120s
x-server-common: &server-common
image: hugegraph/server:${HUGEGRAPH_VERSION:-latest}
pull_policy: missing
restart: unless-stopped
networks: [hg-net]
depends_on:
store0: { condition: service_healthy }
store1: { condition: service_healthy }
store2: { condition: service_healthy }
entrypoint: ["/hugegraph-server/docker-entrypoint.sh"]
environment:
STORE_REST: store0:8520
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/versions >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 30
start_period: 60s
# ── Services ──────────────────────────────────────────────────────────
services:
# --- PD cluster (3 nodes) ---
pd0:
image: hugegraph/pd
container_name: pd0
<<: *pd-common
container_name: hg-pd0
hostname: pd0
network_mode: host
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8620"]
interval: 10s
timeout: 5s
retries: 3
networks: [ hg-net ]
environment:
HG_PD_GRPC_HOST: pd0
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd0:8610
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
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
ports: ["8620:8620", "8686:8686"]
volumes:
- ./configs/application-pd0.yml:/hugegraph-pd/conf/application.yml
- hg-pd0-data:/hugegraph-pd/pd_data
- ../hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh:/hugegraph-pd/docker-entrypoint.sh
pd1:
image: hugegraph/pd
container_name: pd1
<<: *pd-common
container_name: hg-pd1
hostname: pd1
network_mode: host
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8621"]
interval: 10s
timeout: 5s
retries: 3
networks: [ hg-net ]
environment:
HG_PD_GRPC_HOST: pd1
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd1:8610
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
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
ports: ["8621:8620", "8687:8686"]
volumes:
- ./configs/application-pd1.yml:/hugegraph-pd/conf/application.yml
- hg-pd1-data:/hugegraph-pd/pd_data
- ../hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh:/hugegraph-pd/docker-entrypoint.sh
pd2:
image: hugegraph/pd
container_name: pd2
<<: *pd-common
container_name: hg-pd2
hostname: pd2
network_mode: host
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8622"]
interval: 10s
timeout: 5s
retries: 3
networks: [ hg-net ]
environment:
HG_PD_GRPC_HOST: pd2
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd2:8610
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
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
ports: ["8622:8620", "8688:8686"]
volumes:
- ./configs/application-pd2.yml:/hugegraph-pd/conf/application.yml
- hg-pd2-data:/hugegraph-pd/pd_data
- ../hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh:/hugegraph-pd/docker-entrypoint.sh
# --- Store cluster (3 nodes) ---
store0:
image: hugegraph/store
container_name: store0
<<: *store-common
container_name: hg-store0
hostname: store0
network_mode: host
depends_on:
pd0:
condition: service_healthy
pd1:
condition: service_healthy
pd2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8520"]
interval: 10s
timeout: 5s
retries: 3
environment:
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
HG_STORE_GRPC_HOST: store0
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store0:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports: ["8500:8500", "8510:8510", "8520:8520"]
volumes:
- ./configs/application-store0.yml:/hugegraph-store/conf/application.yml
- hg-store0-data:/hugegraph-store/storage
- ../hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh:/hugegraph-store/docker-entrypoint.sh
store1:
image: hugegraph/store
container_name: store1
<<: *store-common
container_name: hg-store1
hostname: store1
network_mode: host
depends_on:
pd0:
condition: service_healthy
pd1:
condition: service_healthy
pd2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8521"]
interval: 10s
timeout: 5s
retries: 3
environment:
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
HG_STORE_GRPC_HOST: store1
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store1:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports: ["8501:8500", "8511:8510", "8521:8520"]
volumes:
- ./configs/application-store1.yml:/hugegraph-store/conf/application.yml
- hg-store1-data:/hugegraph-store/storage
- ../hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh:/hugegraph-store/docker-entrypoint.sh
store2:
image: hugegraph/store
container_name: store2
<<: *store-common
container_name: hg-store2
hostname: store2
network_mode: host
depends_on:
pd0:
condition: service_healthy
pd1:
condition: service_healthy
pd2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8522"]
interval: 10s
timeout: 5s
retries: 3
environment:
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
HG_STORE_GRPC_HOST: store2
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store2:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports: ["8502:8500", "8512:8510", "8522:8520"]
volumes:
- ./configs/application-store2.yml:/hugegraph-store/conf/application.yml
- hg-store2-data:/hugegraph-store/storage
- ../hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh:/hugegraph-store/docker-entrypoint.sh
# --- Server cluster (3 nodes) ---
server0:
<<: *server-common
container_name: hg-server0
hostname: server0
ports: ["8080:8080"]
volumes:
- ../hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:/hugegraph-server/docker-entrypoint.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-storage.sh:/hugegraph-server/bin/wait-storage.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-partition.sh:/hugegraph-server/bin/wait-partition.sh
server1:
image: hugegraph/server
container_name: server1
<<: *server-common
container_name: hg-server1
hostname: server1
network_mode: host
depends_on:
store0:
condition: service_healthy
store1:
condition: service_healthy
store2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081"]
interval: 10s
timeout: 5s
retries: 3
ports: ["8081:8080"]
volumes:
- ./configs/server1-conf:/hugegraph-server/conf
- ../hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:/hugegraph-server/docker-entrypoint.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-storage.sh:/hugegraph-server/bin/wait-storage.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-partition.sh:/hugegraph-server/bin/wait-partition.sh
server2:
image: hugegraph/server
container_name: server2
<<: *server-common
container_name: hg-server2
hostname: server2
network_mode: host
depends_on:
store0:
condition: service_healthy
store1:
condition: service_healthy
store2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082"]
interval: 10s
timeout: 5s
retries: 3
ports: ["8082:8080"]
volumes:
- ./configs/server2-conf:/hugegraph-server/conf
server3:
image: hugegraph/server
container_name: server3
hostname: server3
network_mode: host
depends_on:
store0:
condition: service_healthy
store1:
condition: service_healthy
store2:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083"]
interval: 10s
timeout: 5s
retries: 3
volumes:
- ./configs/server3-conf:/hugegraph-server/conf
- ../hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:/hugegraph-server/docker-entrypoint.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-storage.sh:/hugegraph-server/bin/wait-storage.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-partition.sh:/hugegraph-server/bin/wait-partition.sh

View File

@ -0,0 +1,106 @@
#
# 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.
#
name: hugegraph-single
networks:
hg-net:
driver: bridge
volumes:
hg-pd-data:
hg-store-data:
services:
pd:
build:
context: ..
dockerfile: hugegraph-pd/Dockerfile
container_name: hg-pd
hostname: pd
restart: unless-stopped
networks: [hg-net]
environment:
HG_PD_GRPC_HOST: pd
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd:8610
HG_PD_RAFT_PEERS_LIST: pd:8610
HG_PD_INITIAL_STORE_LIST: store:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
ports:
- "8620:8620"
volumes:
- hg-pd-data:/hugegraph-pd/pd_data
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8620/v1/health >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
store:
build:
context: ..
dockerfile: hugegraph-store/Dockerfile
container_name: hg-store
hostname: store
restart: unless-stopped
networks: [hg-net]
depends_on:
pd:
condition: service_healthy
environment:
HG_STORE_PD_ADDRESS: pd:8686
HG_STORE_GRPC_HOST: store
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports:
- "8520:8520"
volumes:
- hg-store-data:/hugegraph-store/storage
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8520/v1/health >/dev/null || exit 1"]
interval: 10s
timeout: 10s
retries: 30
start_period: 30s
server:
build:
context: ..
dockerfile: hugegraph-server/Dockerfile-hstore
container_name: hg-server
hostname: server
restart: unless-stopped
networks: [hg-net]
depends_on:
store:
condition: service_healthy
environment:
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd:8686
ports:
- "8080:8080"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/versions >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 30
start_period: 60s

View File

@ -14,45 +14,119 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# TODO: remove volume mounts below once images are published with new entrypoints
name: hugegraph-single
version: "3"
networks:
hg-net:
driver: bridge
volumes:
hg-pd-data:
hg-store-data:
services:
pd:
image: hugegraph/pd
container_name: pd
image: hugegraph/pd:${HUGEGRAPH_VERSION:-latest}
pull_policy: always
container_name: hg-pd
hostname: pd
network_mode: host
restart: unless-stopped
networks: [hg-net]
entrypoint: ["/hugegraph-pd/docker-entrypoint.sh"]
environment:
HG_PD_GRPC_HOST: pd
HG_PD_GRPC_PORT: "8686"
HG_PD_REST_PORT: "8620"
HG_PD_RAFT_ADDRESS: pd:8610
HG_PD_RAFT_PEERS_LIST: pd:8610
HG_PD_INITIAL_STORE_LIST: store:8500
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
ports:
- "8620:8620"
volumes:
- hg-pd-data:/hugegraph-pd/pd_data
- ../hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh:/hugegraph-pd/docker-entrypoint.sh
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8620"]
test: ["CMD-SHELL", "curl -fsS http://localhost:8620/v1/health >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 3
retries: 12
start_period: 30s
store:
image: hugegraph/store
container_name: store
image: hugegraph/store:${HUGEGRAPH_VERSION:-latest}
pull_policy: always
container_name: hg-store
hostname: store
network_mode: host
restart: unless-stopped
networks: [hg-net]
entrypoint: ["/hugegraph-store/docker-entrypoint.sh"]
depends_on:
pd:
condition: service_healthy
environment:
HG_STORE_PD_ADDRESS: pd:8686
HG_STORE_GRPC_HOST: store
HG_STORE_GRPC_PORT: "8500"
HG_STORE_REST_PORT: "8520"
HG_STORE_RAFT_ADDRESS: store:8510
HG_STORE_DATA_PATH: /hugegraph-store/storage
ports:
- "8520:8520"
volumes:
- hg-store-data:/hugegraph-store/storage
- ../hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh:/hugegraph-store/docker-entrypoint.sh
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8520"]
test: ["CMD-SHELL", "curl -fsS http://localhost:8520/v1/health >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 3
timeout: 10s
retries: 30
start_period: 60s
server:
image: hugegraph/server
container_name: server
image: hugegraph/server:${HUGEGRAPH_VERSION:-latest}
pull_policy: always
container_name: hg-server
hostname: server
network_mode: host
restart: unless-stopped
networks: [hg-net]
entrypoint: ["/hugegraph-server/docker-entrypoint.sh"]
depends_on:
store:
condition: service_healthy
environment:
HG_SERVER_BACKEND: hstore
HG_SERVER_PD_PEERS: pd:8686
ports:
- "8080:8080"
volumes:
- ../hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:/hugegraph-server/docker-entrypoint.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-storage.sh:/hugegraph-server/bin/wait-storage.sh
- ../hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-partition.sh:/hugegraph-server/bin/wait-partition.sh
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/versions >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 3
retries: 30
start_period: 60s

68
hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh Normal file → Executable file
View File

@ -15,8 +15,72 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -euo pipefail
# start hugegraph pd
./bin/start-hugegraph-pd.sh -j "$JAVA_OPTS"
log() { echo "[hugegraph-pd-entrypoint] $*"; }
require_env() {
local name="$1"
if [[ -z "${!name:-}" ]]; then
echo "ERROR: missing required env '${name}'" >&2; exit 2
fi
}
json_escape() {
local s="$1"
s=${s//\\/\\\\}; s=${s//\"/\\\"}; s=${s//$'\n'/}
printf "%s" "$s"
}
migrate_env() {
local old_name="$1" new_name="$2"
if [[ -n "${!old_name:-}" && -z "${!new_name:-}" ]]; then
log "WARN: deprecated env '${old_name}' detected; mapping to '${new_name}'"
export "${new_name}=${!old_name}"
fi
}
migrate_env "GRPC_HOST" "HG_PD_GRPC_HOST"
migrate_env "RAFT_ADDRESS" "HG_PD_RAFT_ADDRESS"
migrate_env "RAFT_PEERS" "HG_PD_RAFT_PEERS_LIST"
migrate_env "PD_INITIAL_STORE_LIST" "HG_PD_INITIAL_STORE_LIST"
# ── Required vars ─────────────────────────────────────────────────────
require_env "HG_PD_GRPC_HOST"
require_env "HG_PD_RAFT_ADDRESS"
require_env "HG_PD_RAFT_PEERS_LIST"
require_env "HG_PD_INITIAL_STORE_LIST"
: "${HG_PD_GRPC_PORT:=8686}"
: "${HG_PD_REST_PORT:=8620}"
: "${HG_PD_DATA_PATH:=/hugegraph-pd/pd_data}"
: "${HG_PD_INITIAL_STORE_COUNT:=1}"
SPRING_APPLICATION_JSON="$(cat <<JSON
{
"grpc": { "host": "$(json_escape "${HG_PD_GRPC_HOST}")",
"port": "$(json_escape "${HG_PD_GRPC_PORT}")" },
"server": { "port": "$(json_escape "${HG_PD_REST_PORT}")" },
"raft": { "address": "$(json_escape "${HG_PD_RAFT_ADDRESS}")",
"peers-list": "$(json_escape "${HG_PD_RAFT_PEERS_LIST}")" },
"pd": { "data-path": "$(json_escape "${HG_PD_DATA_PATH}")",
"initial-store-list": "$(json_escape "${HG_PD_INITIAL_STORE_LIST}")" ,
"initial-store-count": ${HG_PD_INITIAL_STORE_COUNT} }
}
JSON
)"
export SPRING_APPLICATION_JSON
log "effective config:"
log " grpc.host=${HG_PD_GRPC_HOST}"
log " grpc.port=${HG_PD_GRPC_PORT}"
log " server.port=${HG_PD_REST_PORT}"
log " raft.address=${HG_PD_RAFT_ADDRESS}"
log " raft.peers-list=${HG_PD_RAFT_PEERS_LIST}"
log " pd.initial-store-list=${HG_PD_INITIAL_STORE_LIST}"
log " pd.initial-store-count=${HG_PD_INITIAL_STORE_COUNT}"
log " pd.data-path=${HG_PD_DATA_PATH}"
./bin/start-hugegraph-pd.sh -j "${JAVA_OPTS:-}"
tail -f /dev/null

View File

View File

@ -62,7 +62,7 @@ RUN set -x \
# 2. Init docker script
COPY hugegraph-server/hugegraph-dist/docker/scripts/remote-connect.groovy ./scripts
COPY hugegraph-server/hugegraph-dist/docker/scripts/detect-storage.groovy ./scripts
#COPY hugegraph-server/hugegraph-dist/docker/scripts/detect-storage.groovy ./scripts
COPY hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh .
RUN chmod 755 ./docker-entrypoint.sh

View File

@ -15,32 +15,78 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -euo pipefail
# create a folder to save the docker-related file
DOCKER_FOLDER='./docker'
mkdir -p $DOCKER_FOLDER
DOCKER_FOLDER="./docker"
INIT_FLAG_FILE="init_complete"
GRAPH_CONF="./conf/graphs/hugegraph.properties"
if [ ! -f "${DOCKER_FOLDER}/${INIT_FLAG_FILE}" ]; then
# wait for storage backend
./bin/wait-storage.sh
if [ -z "$PASSWORD" ]; then
echo "init hugegraph with non-auth mode"
mkdir -p "${DOCKER_FOLDER}"
log() { echo "[hugegraph-server-entrypoint] $*"; }
set_prop() {
local key="$1" val="$2" file="$3"
local esc_key esc_val
esc_key=$(printf '%s' "$key" | sed -e 's/[][(){}.^$*+?|\\/]/\\&/g')
esc_val=$(printf '%s' "$val" | sed -e 's/[&|\\]/\\&/g')
if grep -qE "^[[:space:]]*${esc_key}[[:space:]]*=" "${file}"; then
sed -ri "s|^([[:space:]]*${esc_key}[[:space:]]*=).*|\\1${esc_val}|" "${file}"
else
printf '%s=%s\n' "$key" "$val" >> "${file}"
fi
}
migrate_env() {
local old_name="$1" new_name="$2"
if [[ -n "${!old_name:-}" && -z "${!new_name:-}" ]]; then
log "WARN: deprecated env '${old_name}' detected; mapping to '${new_name}'"
export "${new_name}=${!old_name}"
fi
}
migrate_env "BACKEND" "HG_SERVER_BACKEND"
migrate_env "PD_PEERS" "HG_SERVER_PD_PEERS"
# ── Map env → properties file ─────────────────────────────────────────
[[ -n "${HG_SERVER_BACKEND:-}" ]] && set_prop "backend" "${HG_SERVER_BACKEND}" "${GRAPH_CONF}"
[[ -n "${HG_SERVER_PD_PEERS:-}" ]] && set_prop "pd.peers" "${HG_SERVER_PD_PEERS}" "${GRAPH_CONF}"
# ── Build wait-storage env ─────────────────────────────────────────────
WAIT_ENV=()
[[ -n "${HG_SERVER_BACKEND:-}" ]] && WAIT_ENV+=("hugegraph.backend=${HG_SERVER_BACKEND}")
[[ -n "${HG_SERVER_PD_PEERS:-}" ]] && WAIT_ENV+=("hugegraph.pd.peers=${HG_SERVER_PD_PEERS}")
# ── Init store (once) ─────────────────────────────────────────────────
if [[ ! -f "${DOCKER_FOLDER}/${INIT_FLAG_FILE}" ]]; then
if (( ${#WAIT_ENV[@]} > 0 )); then
env "${WAIT_ENV[@]}" ./bin/wait-storage.sh
else
./bin/wait-storage.sh
fi
if [[ -z "${PASSWORD:-}" ]]; then
log "init hugegraph with non-auth mode"
./bin/init-store.sh
else
echo "init hugegraph with auth mode"
log "init hugegraph with auth mode"
./bin/enable-auth.sh
echo "$PASSWORD" | ./bin/init-store.sh
echo "${PASSWORD}" | ./bin/init-store.sh
fi
# create a flag file to avoid re-init when restarting
touch ${DOCKER_FOLDER}/${INIT_FLAG_FILE}
touch "${DOCKER_FOLDER}/${INIT_FLAG_FILE}"
else
echo "Hugegraph Initialization already done. Skipping re-init..."
log "HugeGraph initialization already done. Skipping re-init..."
fi
# start hugegraph-server
# remove "-g zgc" now, which is only available on ARM-Mac with java > 13
./bin/start-hugegraph.sh -j "$JAVA_OPTS"
STORE_REST="${STORE_REST:-store:8520}"
export STORE_REST
./bin/start-hugegraph.sh -j "${JAVA_OPTS:-}" -t 120
# Post-startup cluster stabilization check
./bin/wait-partition.sh || log "WARN: partitions not assigned yet"
tail -f /dev/null

View File

@ -1,3 +1,4 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@ -6,7 +7,7 @@
# (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
# 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,
@ -14,12 +15,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
hosts: [localhost]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [org.apache.hugegraph.io.HugeGraphIoRegistry]
}
}
set -euo pipefail
: "${STORE_REST:?STORE_REST not set}"
timeout "${WAIT_PARTITION_TIMEOUT_S:-120}s" bash -c '
until curl -fsS "http://${STORE_REST}" 2>/dev/null | \
grep -q "\"partitionCount\":[1-9]"
do
echo "Waiting for partition assignment..."
sleep 5
done
'
echo "Partitions detected:"
URL="http://${STORE_REST}/v1/partitions"
echo "$URL"
curl -v "$URL"

View File

@ -29,11 +29,15 @@ function abs_path() {
BIN=$(abs_path)
TOP="$(cd "$BIN"/../ && pwd)"
GRAPH_CONF="$TOP/conf/graphs/hugegraph.properties"
WAIT_STORAGE_TIMEOUT_S=120
DETECT_STORAGE="$TOP/scripts/detect-storage.groovy"
WAIT_STORAGE_TIMEOUT_S=300
. "$BIN"/util.sh
log() {
echo "[wait-storage] $1"
}
PD_AUTH_ARGS="-u ${PD_AUTH_USER:-store}:${PD_AUTH_PASSWORD:-admin}"
function key_exists {
local key=$1
@ -70,7 +74,58 @@ done < <(env | sort -r | awk -F= '{ st = index($0, "="); print $1 " " substr($0,
# wait for storage
if env | grep '^hugegraph\.' > /dev/null; then
if [ -n "${WAIT_STORAGE_TIMEOUT_S:-}" ]; then
timeout "${WAIT_STORAGE_TIMEOUT_S}s" bash -c \
"until bin/gremlin-console.sh -- -e $DETECT_STORAGE > /dev/null 2>&1; do echo \"Hugegraph server are waiting for storage backend...\"; sleep 5; done"
PD_PEERS="${hugegraph_pd_peers:-}"
if [ -z "$PD_PEERS" ]; then
PD_PEERS=$(grep -E "^\s*pd\.peers\s*=" "$GRAPH_CONF" | sed 's/.*=\s*//' | tr -d ' ')
fi
if [ -n "$PD_PEERS" ]; then
: "${HG_SERVER_PD_REST_ENDPOINT:=}"
if [ -n "${HG_SERVER_PD_REST_ENDPOINT}" ]; then
PD_REST_LIST="${HG_SERVER_PD_REST_ENDPOINT}"
else
PD_REST_LIST=$(echo "$PD_PEERS" | sed 's/:8686/:8620/g')
fi
export PD_REST_LIST
log "PD REST peers = $PD_REST_LIST"
log "Timeout = ${WAIT_STORAGE_TIMEOUT_S}s"
timeout "${WAIT_STORAGE_TIMEOUT_S}s" bash -c "
log() { echo '[wait-storage] '\"\$1\"; }
check_any_pd() {
for peer in \$(echo \"\$PD_REST_LIST\" | tr ',' ' '); do
if curl ${PD_AUTH_ARGS} -f -s http://\${peer}/v1/health >/dev/null 2>&1; then
echo \"\$peer\"
return 0
fi
done
return 1
}
until PD_REST=\$(check_any_pd); do
log 'No PD peer ready yet, retrying in 5s'
sleep 5
done
log \"PD health check PASSED via \$PD_REST\"
until curl ${PD_AUTH_ARGS} -f -s \
http://\${PD_REST}/v1/stores 2>/dev/null | \
grep -qi '\"state\"[[:space:]]*:[[:space:]]*\"Up\"'; do
log 'No Up store yet, retrying in 5s'
sleep 5
done
log 'Store registration check PASSED'
log 'Storage backend is VIABLE'
" || { echo "[wait-storage] ERROR: Timeout waiting for storage backend"; exit 1; }
else
log "No pd.peers configured, skipping storage wait"
fi
fi
fi

View File

@ -15,8 +15,67 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -euo pipefail
# start hugegraph store
./bin/start-hugegraph-store.sh -j "$JAVA_OPTS"
log() { echo "[hugegraph-store-entrypoint] $*"; }
require_env() {
local name="$1"
if [[ -z "${!name:-}" ]]; then
echo "ERROR: missing required env '${name}'" >&2; exit 2
fi
}
json_escape() {
local s="$1"
s=${s//\\/\\\\}; s=${s//\"/\\\"}; s=${s//$'\n'/}
printf "%s" "$s"
}
# ── Guard deprecated vars ─────────────────────────────────────────────
migrate_env() {
local old_name="$1" new_name="$2"
if [[ -n "${!old_name:-}" && -z "${!new_name:-}" ]]; then
log "WARN: deprecated env '${old_name}' detected; mapping to '${new_name}'"
export "${new_name}=${!old_name}"
fi
}
migrate_env "PD_ADDRESS" "HG_STORE_PD_ADDRESS"
migrate_env "GRPC_HOST" "HG_STORE_GRPC_HOST"
migrate_env "RAFT_ADDRESS" "HG_STORE_RAFT_ADDRESS"
# ── Required vars ─────────────────────────────────────────────────────
require_env "HG_STORE_PD_ADDRESS"
require_env "HG_STORE_GRPC_HOST"
require_env "HG_STORE_RAFT_ADDRESS"
# ── Defaults ──────────────────────────────────────────────────────────
: "${HG_STORE_GRPC_PORT:=8500}"
: "${HG_STORE_REST_PORT:=8520}"
: "${HG_STORE_DATA_PATH:=/hugegraph-store/storage}"
# ── Build SPRING_APPLICATION_JSON ─────────────────────────────────────
SPRING_APPLICATION_JSON="$(cat <<JSON
{
"pdserver": { "address": "$(json_escape "${HG_STORE_PD_ADDRESS}")" },
"grpc": { "host": "$(json_escape "${HG_STORE_GRPC_HOST}")",
"port": "$(json_escape "${HG_STORE_GRPC_PORT}")" },
"raft": { "address": "$(json_escape "${HG_STORE_RAFT_ADDRESS}")" },
"server": { "port": "$(json_escape "${HG_STORE_REST_PORT}")" },
"app": { "data-path": "$(json_escape "${HG_STORE_DATA_PATH}")" }
}
JSON
)"
export SPRING_APPLICATION_JSON
log "effective config:"
log " pdserver.address=${HG_STORE_PD_ADDRESS}"
log " grpc.host=${HG_STORE_GRPC_HOST}"
log " grpc.port=${HG_STORE_GRPC_PORT}"
log " raft.address=${HG_STORE_RAFT_ADDRESS}"
log " server.port=${HG_STORE_REST_PORT}"
log " app.data-path=${HG_STORE_DATA_PATH}"
./bin/start-hugegraph-store.sh -j "${JAVA_OPTS:-}"
tail -f /dev/null