Skip to content

Commit 55e227a

Browse files
committed
docker: address maintainer feedback — pull_policy missing, remove sed blocks, fix network config
1 parent 6a4c567 commit 55e227a

File tree

5 files changed

+25
-47
lines changed

5 files changed

+25
-47
lines changed

docker/docker-compose-3pd-3store-3server.yml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
# Licensed to the Apache Software Foundation (ASF) under one or more
33
# contributor license agreements. See the NOTICE file distributed with
44
# this work for additional information regarding copyright ownership.
@@ -20,9 +20,6 @@ name: hugegraph-3x3
2020
networks:
2121
hg-net:
2222
driver: bridge
23-
ipam:
24-
config:
25-
- subnet: 172.20.0.0/24
2623

2724
volumes:
2825
hg-pd0-data:
@@ -36,8 +33,9 @@ volumes:
3633

3734
x-pd-common: &pd-common
3835
image: hugegraph/pd:${HUGEGRAPH_VERSION:-latest}
39-
pull_policy: always
36+
pull_policy: missing
4037
restart: unless-stopped
38+
networks: [hg-net]
4139
entrypoint: ["/hugegraph-pd/docker-entrypoint.sh"]
4240
healthcheck:
4341
test: ["CMD-SHELL", "curl -fsS http://localhost:8620/v1/health >/dev/null || exit 1"]
@@ -48,7 +46,7 @@ x-pd-common: &pd-common
4846

4947
x-store-common: &store-common
5048
image: hugegraph/store:${HUGEGRAPH_VERSION:-latest}
51-
pull_policy: always
49+
pull_policy: missing
5250
restart: unless-stopped
5351
networks: [hg-net]
5452
depends_on:
@@ -65,7 +63,7 @@ x-store-common: &store-common
6563

6664
x-server-common: &server-common
6765
image: hugegraph/server:${HUGEGRAPH_VERSION:-latest}
68-
pull_policy: always
66+
pull_policy: missing
6967
restart: unless-stopped
7068
networks: [hg-net]
7169
depends_on:
@@ -76,7 +74,7 @@ x-server-common: &server-common
7674
environment:
7775
STORE_REST: store0:8520
7876
HG_SERVER_BACKEND: hstore
79-
HG_SERVER_PD_PEERS: 172.20.0.10:8686,172.20.0.11:8686,172.20.0.12:8686
77+
HG_SERVER_PD_PEERS: pd0:8686,pd1:8686,pd2:8686
8078
healthcheck:
8179
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/versions >/dev/null || exit 1"]
8280
interval: 10s
@@ -92,15 +90,13 @@ services:
9290
<<: *pd-common
9391
container_name: hg-pd0
9492
hostname: pd0
95-
networks:
96-
hg-net:
97-
ipv4_address: 172.20.0.10
93+
networks: [ hg-net ]
9894
environment:
99-
HG_PD_GRPC_HOST: 172.20.0.10
95+
HG_PD_GRPC_HOST: pd0
10096
HG_PD_GRPC_PORT: "8686"
10197
HG_PD_REST_PORT: "8620"
102-
HG_PD_RAFT_ADDRESS: 172.20.0.10:8610
103-
HG_PD_RAFT_PEERS_LIST: 172.20.0.10:8610,172.20.0.11:8610,172.20.0.12:8610
98+
HG_PD_RAFT_ADDRESS: pd0:8610
99+
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
104100
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
105101
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
106102
HG_PD_INITIAL_STORE_COUNT: 3
@@ -113,15 +109,13 @@ services:
113109
<<: *pd-common
114110
container_name: hg-pd1
115111
hostname: pd1
116-
networks:
117-
hg-net:
118-
ipv4_address: 172.20.0.11
112+
networks: [ hg-net ]
119113
environment:
120-
HG_PD_GRPC_HOST: 172.20.0.11
114+
HG_PD_GRPC_HOST: pd1
121115
HG_PD_GRPC_PORT: "8686"
122116
HG_PD_REST_PORT: "8620"
123-
HG_PD_RAFT_ADDRESS: 172.20.0.11:8610
124-
HG_PD_RAFT_PEERS_LIST: 172.20.0.10:8610,172.20.0.11:8610,172.20.0.12:8610
117+
HG_PD_RAFT_ADDRESS: pd1:8610
118+
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
125119
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
126120
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
127121
HG_PD_INITIAL_STORE_COUNT: 3
@@ -134,15 +128,13 @@ services:
134128
<<: *pd-common
135129
container_name: hg-pd2
136130
hostname: pd2
137-
networks:
138-
hg-net:
139-
ipv4_address: 172.20.0.12
131+
networks: [ hg-net ]
140132
environment:
141-
HG_PD_GRPC_HOST: 172.20.0.12
133+
HG_PD_GRPC_HOST: pd2
142134
HG_PD_GRPC_PORT: "8686"
143135
HG_PD_REST_PORT: "8620"
144-
HG_PD_RAFT_ADDRESS: 172.20.0.12:8610
145-
HG_PD_RAFT_PEERS_LIST: 172.20.0.10:8610,172.20.0.11:8610,172.20.0.12:8610
136+
HG_PD_RAFT_ADDRESS: pd2:8610
137+
HG_PD_RAFT_PEERS_LIST: pd0:8610,pd1:8610,pd2:8610
146138
HG_PD_INITIAL_STORE_LIST: store0:8500,store1:8500,store2:8500
147139
HG_PD_DATA_PATH: /hugegraph-pd/pd_data
148140
HG_PD_INITIAL_STORE_COUNT: 3
@@ -157,7 +149,7 @@ services:
157149
container_name: hg-store0
158150
hostname: store0
159151
environment:
160-
HG_STORE_PD_ADDRESS: 172.20.0.10:8686,172.20.0.11:8686,172.20.0.12:8686
152+
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
161153
HG_STORE_GRPC_HOST: store0
162154
HG_STORE_GRPC_PORT: "8500"
163155
HG_STORE_REST_PORT: "8520"
@@ -173,7 +165,7 @@ services:
173165
container_name: hg-store1
174166
hostname: store1
175167
environment:
176-
HG_STORE_PD_ADDRESS: 172.20.0.10:8686,172.20.0.11:8686,172.20.0.12:8686
168+
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
177169
HG_STORE_GRPC_HOST: store1
178170
HG_STORE_GRPC_PORT: "8500"
179171
HG_STORE_REST_PORT: "8520"
@@ -189,7 +181,7 @@ services:
189181
container_name: hg-store2
190182
hostname: store2
191183
environment:
192-
HG_STORE_PD_ADDRESS: 172.20.0.10:8686,172.20.0.11:8686,172.20.0.12:8686
184+
HG_STORE_PD_ADDRESS: pd0:8686,pd1:8686,pd2:8686
193185
HG_STORE_GRPC_HOST: store2
194186
HG_STORE_GRPC_PORT: "8500"
195187
HG_STORE_REST_PORT: "8520"

hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,5 @@ log " pd.initial-store-list=${HG_PD_INITIAL_STORE_LIST}"
8282
log " pd.initial-store-count=${HG_PD_INITIAL_STORE_COUNT}"
8383
log " pd.data-path=${HG_PD_DATA_PATH}"
8484

85-
log "Patching conf/application.yml with cluster settings..."
86-
sed -i "s|address: 127.0.0.1:8610|address: ${HG_PD_RAFT_ADDRESS}|" conf/application.yml
87-
sed -i "s|peers-list: 127.0.0.1:8610|peers-list: ${HG_PD_RAFT_PEERS_LIST}|" conf/application.yml
88-
sed -i "s|initial-store-list: 127.0.0.1:8500|initial-store-list: ${HG_PD_INITIAL_STORE_LIST}|" conf/application.yml
89-
sed -i "s|initial-store-count: 1|initial-store-count: ${HG_PD_INITIAL_STORE_COUNT}|" conf/application.yml
90-
sed -i "s|host: 127.0.0.1|host: ${HG_PD_GRPC_HOST}|" conf/application.yml
91-
9285
./bin/start-hugegraph-pd.sh -j "${JAVA_OPTS:-}"
9386
tail -f /dev/null

hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ else
8181
log "HugeGraph initialization already done. Skipping re-init..."
8282
fi
8383

84-
./bin/start-hugegraph.sh -j "${JAVA_OPTS:-}" -t 120
85-
86-
STORE_REST="${STORE_REST:-hg-store:8520}"
84+
STORE_REST="${STORE_REST:-store:8520}"
8785
export STORE_REST
8886

87+
./bin/start-hugegraph.sh -j "${JAVA_OPTS:-}" -t 120
88+
8989
# Post-startup cluster stabilization check
9090
./bin/wait-partition.sh || log "WARN: partitions not assigned yet"
9191

hugegraph-server/hugegraph-dist/src/assembly/static/bin/wait-storage.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ log() {
3737
echo "[wait-storage] $1"
3838
}
3939

40-
# Hardcoded PD auth
41-
PD_AUTH_ARGS="-u store:admin"
42-
log "PD auth forced to store:admin"
40+
PD_AUTH_ARGS="-u ${PD_AUTH_USER:-store}:${PD_AUTH_PASSWORD:-admin}"
4341

4442
function key_exists {
4543
local key=$1

hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,5 @@ log " raft.address=${HG_STORE_RAFT_ADDRESS}"
7777
log " server.port=${HG_STORE_REST_PORT}"
7878
log " app.data-path=${HG_STORE_DATA_PATH}"
7979

80-
log "Patching conf/application.yml with cluster settings..."
81-
sed -i "s|address: localhost:8686|address: ${HG_STORE_PD_ADDRESS}|" conf/application.yml
82-
sed -i "s|host: 127.0.0.1|host: ${HG_STORE_GRPC_HOST}|" conf/application.yml
83-
sed -i "s|address: 127.0.0.1:8510|address: ${HG_STORE_RAFT_ADDRESS}|" conf/application.yml
84-
8580
./bin/start-hugegraph-store.sh -j "${JAVA_OPTS:-}"
8681
tail -f /dev/null

0 commit comments

Comments
 (0)