Skip to content

Commit fca46ec

Browse files
authored
HDDS-14897. Add multiple S3 gateways to the rolling-upgrade suite (#10028)
1 parent 6c4d852 commit fca46ec

6 files changed

Lines changed: 76 additions & 28 deletions

File tree

hadoop-ozone/dist/src/main/compose/common/s3-haproxy.cfg

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,24 @@ frontend http-in
3333

3434
backend servers
3535
balance roundrobin
36-
server server1 s3g1:9878 maxconn 32
37-
server server2 s3g2:9878 maxconn 32
38-
server server3 s3g3:9878 maxconn 32
36+
option httpchk GET /
37+
http-check expect ! rstatus ^5
38+
server server1 s3g1:9878 maxconn 32 check
39+
server server2 s3g2:9878 maxconn 32 check
40+
server server3 s3g3:9878 maxconn 32 check
41+
retries 3
42+
option redispatch
3943

4044
frontend webadmin
4145
bind *:19878
4246
default_backend webadmin-servers
4347

4448
backend webadmin-servers
4549
balance roundrobin
46-
server server1 s3g1:19878 maxconn 32
47-
server server2 s3g2:19878 maxconn 32
48-
server server3 s3g3:19878 maxconn 32
50+
option httpchk GET /
51+
http-check expect ! rstatus ^5
52+
server server1 s3g1:19878 maxconn 32 check
53+
server server2 s3g2:19878 maxconn 32 check
54+
server server3 s3g3:19878 maxconn 32 check
55+
retries 3
56+
option redispatch

hadoop-ozone/dist/src/main/compose/testlib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ reorder_om_nodes() {
273273
local new_order="$1"
274274

275275
if [[ -n "${new_order}" ]] && [[ "${new_order}" != "om1,om2,om3" ]]; then
276-
for c in $(docker-compose ps | cut -f1 -d' ' | grep -v -e '^NAME$' -e '^om'); do
276+
for c in $(docker-compose ps | cut -f1 -d' ' | grep -v -e '^NAME$' -e '^om' -e 's3g-haproxy'); do
277277
docker exec "${c}" bash -c \
278278
"if [[ -f /etc/hadoop/ozone-site.xml ]]; then \
279279
sed -i -e 's/om1,om2,om3/${new_order}/' /etc/hadoop/ozone-site.xml; \

hadoop-ozone/dist/src/main/compose/upgrade/compose/ha/docker-compose.yaml

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ x-volumes:
7272
- &ozone-dir ../../../..:${OZONE_DIR}
7373
- &transformation ../../../../libexec/transformation.py:/opt/hadoop/libexec/transformation.py
7474

75+
x-s3-worker:
76+
&s3-worker
77+
command: ["ozone","s3g"]
78+
<<: *common-config
79+
environment:
80+
<<: *environment
81+
ports:
82+
- 9878
83+
- 19878
84+
7585
services:
7686
kdc:
7787
command: ["/opt/hadoop/compose/common/init-kdc.sh"]
@@ -264,19 +274,50 @@ services:
264274
- *krb5conf
265275
- *ozone-dir
266276
- *transformation
267-
s3g:
268-
command: ["ozone","s3g"]
269-
<<: *common-config
270-
environment:
271-
<<: *environment
277+
s3g-haproxy:
278+
image: haproxy:lts-alpine
272279
hostname: s3g
273280
networks:
274281
net:
275282
ipv4_address: 10.9.0.23
276283
ports:
277284
- 9878:9878
285+
- 19878:19878
286+
volumes:
287+
- ../../../common/s3-haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
288+
command: ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
289+
s3g1:
290+
<<: *s3-worker
291+
hostname: s3g1
292+
networks:
293+
net:
294+
ipv4_address: 10.9.0.24
295+
volumes:
296+
- ${OZONE_VOLUME}/s3g1:/data
297+
- *keytabs
298+
- *krb5conf
299+
- *ozone-dir
300+
- *transformation
301+
s3g2:
302+
<<: *s3-worker
303+
hostname: s3g2
304+
networks:
305+
net:
306+
ipv4_address: 10.9.0.25
307+
volumes:
308+
- ${OZONE_VOLUME}/s3g2:/data
309+
- *keytabs
310+
- *krb5conf
311+
- *ozone-dir
312+
- *transformation
313+
s3g3:
314+
<<: *s3-worker
315+
hostname: s3g3
316+
networks:
317+
net:
318+
ipv4_address: 10.9.0.26
278319
volumes:
279-
- ${OZONE_VOLUME}/s3g:/data
320+
- ${OZONE_VOLUME}/s3g3:/data
280321
- *keytabs
281322
- *krb5conf
282323
- *ozone-dir

hadoop-ozone/dist/src/main/compose/upgrade/compose/ha/load.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ export COMPOSE_FILE="$TEST_DIR/compose/ha/docker-compose.yaml"
2727
export OM_SERVICE_ID=omservice
2828
export SECURITY_ENABLED="true"
2929

30-
create_data_dirs dn{1..5} kms om{1..3} recon s3g scm{1..3}
30+
create_data_dirs dn{1..5} kms om{1..3} recon s3g{1..3} scm{1..3}
3131

3232
echo "Using docker cluster defined in $COMPOSE_FILE"

hadoop-ozone/dist/src/main/compose/upgrade/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RESULT_DIR="$ALL_RESULT_DIR" create_results_dir
3333

3434
# This is the version of Ozone that should use the runner image to run the
3535
# code that was built. Other versions will pull images from docker hub.
36-
run_test ha non-rolling-upgrade 2.1.0 "$OZONE_CURRENT_VERSION"
36+
# run_test ha non-rolling-upgrade 2.1.0 "$OZONE_CURRENT_VERSION"
3737
# run_test ha non-rolling-upgrade 2.0.0 "$OZONE_CURRENT_VERSION"
3838
#run_test non-ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
3939
#run_test ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
@@ -43,7 +43,7 @@ run_test ha non-rolling-upgrade 2.1.0 "$OZONE_CURRENT_VERSION"
4343
# run_test om-ha non-rolling-upgrade 1.1.0 "$OZONE_CURRENT_VERSION"
4444

4545
# Rolling upgrade test, commented out for now
46-
# run_test ha rolling-upgrade "$OZONE_CURRENT_VERSION" "$OZONE_CURRENT_VERSION"
46+
run_test ha rolling-upgrade "$OZONE_CURRENT_VERSION" "$OZONE_CURRENT_VERSION"
4747

4848
generate_report "upgrade" "$ALL_RESULT_DIR"
4949

hadoop-ozone/dist/src/main/compose/upgrade/upgrades/rolling-upgrade/driver.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,13 @@ rolling_restart_service() {
5454
fi
5555
fi
5656

57-
# The data generation/validation is doing S3 API tests, so skip it in case the S3 gateway is updated
58-
# TODO find a better solution
59-
if [[ ${SERVICE} != "s3g" ]]; then
60-
callback before_service_restart
61-
fi
57+
callback before_service_restart
6258

6359
# Restart service with new image.
6460
prepare_for_image "${OZONE_UPGRADE_TO}"
6561
create_containers "${SERVICE}"
6662

67-
# The data generation/validation is doing S3 API tests, so skip it in case the S3 gateway is updated
68-
if [[ ${SERVICE} != "s3g" ]]; then
69-
callback after_service_restart
70-
fi
63+
callback after_service_restart
7164

7265
# Service-specific readiness checks.
7366
case "${SERVICE}" in
@@ -81,6 +74,9 @@ rolling_restart_service() {
8174
dn*)
8275
wait_for_port "${SERVICE}" 9882 120
8376
;;
77+
s3g*)
78+
wait_for_port "${SERVICE}" 9878 120
79+
;;
8480
esac
8581
}
8682

@@ -112,14 +108,17 @@ for s in dn1 dn2 dn3 dn4 dn5; do
112108
rolling_restart_service "$s" "$OZONE_UPGRADE_TO"
113109
done
114110

111+
# OMs
115112
for s in om1 om2 om3; do
116113
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-2-${s}"
117114
rolling_restart_service "$s" "$OZONE_UPGRADE_TO"
118115
done
119116

120-
# S3 Gateway
121-
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-2-s3g"
122-
rolling_restart_service "s3g" "$OZONE_UPGRADE_TO"
117+
# S3 Gateways (s3g is HAProxy and does not need to be upgraded)
118+
for s in s3g1 s3g2 s3g3; do
119+
OUTPUT_NAME="${OZONE_UPGRADE_FROM}-${OZONE_UPGRADE_TO}-2-${s}"
120+
rolling_restart_service "$s" "$OZONE_UPGRADE_TO"
121+
done
123122

124123
# TODO Add downgrade scenario
125124

0 commit comments

Comments
 (0)