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
19 changes: 15 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ services:
image: hugegraph/pd
container_name: pd
hostname: pd
network_mode: host
ports:
- "8620:8620"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8620"]
test: ["CMD", "curl", "-f", "http://localhost:8620/v1/health"]
interval: 10s
timeout: 5s
retries: 3
volumes:
- ./pd-conf:/hugegraph-pd/conf

store:
image: hugegraph/store
container_name: store
hostname: store
network_mode: host
ports:
- "8520:8520"
depends_on:
pd:
condition: service_healthy
Expand All @@ -42,12 +46,17 @@ services:
interval: 10s
timeout: 5s
retries: 3
volumes:
- ./store-conf/application.yml:/hugegraph-store/conf/application.yml

server:
image: hugegraph/server
container_name: server
hostname: server
network_mode: host
ports:
- "8080:8080"
environment:
- hugegraph.pd.peers=pd:8686
depends_on:
store:
condition: service_healthy
Expand All @@ -56,3 +65,5 @@ services:
interval: 10s
timeout: 5s
retries: 3
volumes:
- ./server-conf:/hugegraph-server/conf
72 changes: 72 additions & 0 deletions docker/pd-conf/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# 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'
# TODO: handle the license file later (PDConfig)
license:
verify-path: ./conf/verify-license.json
license-path: ./conf/hugegraph.license
grpc:
port: 8686
host: pd

server:
# REST service port number
port: 8620

pd:
data-path: ./pd_data
patrol-interval: 1800
initial-store-count: 1
initial-store-list: store:8500

raft:
address: pd:8610
peers-list: pd:8610

store:
# The time when the store went offline. After that time, the store is considered permanently unavailable, and the replica is allocated to another machine, in seconds
max-down-time: 172800
# Specifies whether to enable store monitoring data storage
monitor_data_enabled: true
# The interval between monitoring data, minute, hour, second
# default: 1 min * 1 day = 1440
monitor_data_interval: 1 minute
# Retention time of monitoring data is 1 day; day, month, year
monitor_data_retention: 1 day

partition:
# Default number of replicas per partition
default-shard-count: 1
# The default maximum number of replicas per machine
# the initial number of partitions= store-max-shard-count * store-number / default-shard-count
store-max-shard-count: 12
72 changes: 72 additions & 0 deletions docker/pd-conf/application.yml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# 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
logging:
config: file:./conf/log4j2.xml

management:
metrics:
export:
prometheus:
enabled: true
endpoints:
web:
exposure:
include: "*"

grpc:
port: $GRPC_PORT$
# grpc's service address,
# Note: You need to change to the local actual Iv 4 address when deploying.
host: $GRPC_HOST$
netty-server:
max-inbound-message-size: 100MB

server:
port : $SERVER_PORT$

pd:
# Cluster ID: to distinguish different PD clusters

patrol-interval: 2147483647
data-path: $PD_DATA_PATH$

raft:
address: $RAFT_ADDRESS$
# raft cluster
peers-list: $RAFT_PEERS_LIST$
# The interval between snapshot generation, in seconds
snapshotInterval: 300
metrics: true
store:
# If the store heartbeat timeout period exceeds this time, the store is temporarily unavailable and the leader is transferred to another replica in seconds
keepAlive-timeout: 60
# The time when the store went offline. After that time, the store is considered permanently unavailable, and the replica is allocated to another machine, in seconds
max-down-time: 1800
partition:
# The default total number of partitions
default-total-count: 30
# Default number of replicas per partition
default-shard-count: 3

discovery:
# After the client registers, the maximum number of heartbeats is not reached, and after that, the
previous registration information will be deleted
heartbeat-try-count: 3
135 changes: 135 additions & 0 deletions docker/pd-conf/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?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-pd</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"
bufferedIO="true" bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY" />
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n" />
<!--JsonLayout compact="true" eventEol="true" complete="true" locationInfo="true">
<KeyValuePair key="timestamp" value="$${date:yyyy-MM-dd HH:mm:ss.SSS}"/>
</JsonLayout-->
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="128MB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<!-- Keep 5 files per day & auto delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="16">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log" />
<!-- Limit log amount & size -->
<IfAny>
<IfAccumulatedFileSize exceeds="2GB" />
<IfAccumulatedFileCount exceeds="100" />
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>

<!-- jraft server log config -->
<RollingRandomAccessFile name="raft_file" fileName="${LOG_PATH}/${FILE_NAME}_raft.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
bufferedIO="true" bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY" />
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n" />
<!--JsonLayout compact="true" eventEol="true" complete="true" locationInfo="true">
<KeyValuePair key="timestamp" value="$${date:yyyy-MM-dd HH:mm:ss.SSS}"/>
</JsonLayout-->
<!-- Trigger after exceeding 1day or 50MB -->
<Policies>
<SizeBasedTriggeringPolicy size="128MB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<!-- Keep 5 files per day & auto Delete after over 2GB or 100 files -->
<DefaultRolloverStrategy max="16">
<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"
bufferedIO="true" bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY" />
<!-- Use a simple format for audit log to speed up -->
<!-- PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} - %m%n"/ -->
<JsonLayout compact="true" eventEol="true" locationInfo="true">
<KeyValuePair key="timestamp" value="$${date:yyyy-MM-dd HH:mm:ss.SSS}" />
</JsonLayout>
<!-- Trigger after exceeding 1hour or 500MB -->
<Policies>
<SizeBasedTriggeringPolicy size="512MB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<!-- Keep 2 files per hour & auto delete [after 60 days] or [over 5GB or 500 files] -->
<DefaultRolloverStrategy max="16">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.gz" />
<IfLastModified age="60d" />
<IfAny>
<IfAccumulatedFileSize exceeds="5GB" />
<IfAccumulatedFileCount exceeds="500" />
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</appenders>

<loggers>
<root level="INFO">
<appender-ref ref="file" />
</root>
<logger name="com.alipay.sofa" level="INFO" additivity="false">
<appender-ref ref="raft_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 -->
<logger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="file" />
<appender-ref ref="console" />
</logger>
</loggers>
</configuration>
6 changes: 6 additions & 0 deletions docker/pd-conf/verify-license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"subject": "hugegraph-license",
"public_alias": "publiccert",
"store_ticket": "803b6cc3-d144-47e8-948f-ec8b39c8881e",
"publickey_path": "/public-certs.store"
}
39 changes: 39 additions & 0 deletions docker/server-conf/computer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# 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.
#
# common parameters
common: {
worker_heap: 10000,
vertex_input_dir: /data,
workers: 51,
zookeeper_list: "127.0.0.1:2181",
max_edges_per_segment: 10485760,
edges_immutable: true,
partitions: 255,
compute_threads: 5,
input_threads: 5,
message_async: false,
message_queue_size: 1000,
message_send_threads: 10,
messages_per_segment: 104857600,
hugegraph_url: "http://server:8080",
hugegraph_name: hugegraph,
hugegraph_timeout: 60
}

env: {
computer_home: /home/computer
}
Loading
Loading