Skip to content

Commit e613598

Browse files
HDDS-12113. Move HAProxy test to HA environment (apache#8271)
Co-authored-by: Doroszlai, Attila <[email protected]>
1 parent d8a3915 commit e613598

File tree

12 files changed

+154
-151
lines changed

12 files changed

+154
-151
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ services:
3434
command: ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
3535
s3g1:
3636
<<: *s3-worker
37-
ports:
38-
- 9879:9878
3937
s3g2:
4038
<<: *s3-worker
41-
ports:
42-
- 9880:9878
4339
s3g3:
4440
<<: *s3-worker
45-
ports:
46-
- 9881:9878

hadoop-ozone/dist/src/main/compose/ozone/disabled-test-s3-haproxy.sh renamed to hadoop-ozone/dist/src/main/compose/ozone-ha/test-haproxy-s3g.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,26 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18+
#suite:HA-unsecure
19+
1820
COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1921
export COMPOSE_DIR
2022

2123
export SECURITY_ENABLED=false
2224
export COMPOSE_FILE=docker-compose.yaml:../common/s3-haproxy.yaml
25+
export OZONE_REPLICATION_FACTOR=3
26+
export SCM=scm1
2327

2428
# shellcheck source=/dev/null
2529
source "$COMPOSE_DIR/../testlib.sh"
2630

2731
start_docker_env
2832

2933
## Exclude virtual-host tests. This is tested separately as it requires additional config.
30-
execute_robot_test scm --exclude virtual-host s3
34+
exclude="--exclude virtual-host"
35+
for bucket in generated; do
36+
execute_robot_test ${SCM} -v BUCKET:${bucket} -N s3-${bucket} ${exclude} s3
37+
# some tests are independent of the bucket type, only need to be run once
38+
## Exclude awss3virtualhost.robot
39+
exclude="--exclude virtual-host --exclude no-bucket-type"
40+
done

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

Lines changed: 25 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
x-common-config:
18+
&common-config
19+
dns_search: .
20+
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
21+
volumes:
22+
- ../..:/opt/hadoop
23+
- ../_keytabs:/etc/security/keytabs
24+
- ./krb5.conf:/etc/krb5.conf
25+
env_file:
26+
- docker-config
27+
1728
services:
1829
kdc:
1930
image: ${OZONE_TESTKRB5_IMAGE}
@@ -44,12 +55,7 @@ services:
4455
ozone_net:
4556
ipv4_address: 172.25.0.101
4657
datanode1:
47-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
48-
dns_search: .
49-
volumes:
50-
- ../..:/opt/hadoop
51-
- ../_keytabs:/etc/security/keytabs
52-
- ./krb5.conf:/etc/krb5.conf
58+
<<: *common-config
5359
ports:
5460
- 19864:9999
5561
command: ["/opt/hadoop/bin/ozone","datanode"]
@@ -58,21 +64,14 @@ services:
5864
- "scm2.org: 172.25.0.117"
5965
- "scm3.org: 172.25.0.118"
6066
- "recon: 172.25.0.115"
61-
env_file:
62-
- docker-config
6367
environment:
6468
WAITFOR: scm3.org:9894
6569
OZONE_OPTS:
6670
networks:
6771
ozone_net:
6872
ipv4_address: 172.25.0.102
6973
datanode2:
70-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
71-
dns_search: .
72-
volumes:
73-
- ../..:/opt/hadoop
74-
- ../_keytabs:/etc/security/keytabs
75-
- ./krb5.conf:/etc/krb5.conf
74+
<<: *common-config
7675
ports:
7776
- 9866:9999
7877
command: ["/opt/hadoop/bin/ozone","datanode"]
@@ -81,21 +80,14 @@ services:
8180
- "scm2.org: 172.25.0.117"
8281
- "scm3.org: 172.25.0.118"
8382
- "recon: 172.25.0.115"
84-
env_file:
85-
- docker-config
8683
environment:
8784
WAITFOR: scm3.org:9894
8885
OZONE_OPTS:
8986
networks:
9087
ozone_net:
9188
ipv4_address: 172.25.0.103
9289
datanode3:
93-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
94-
dns_search: .
95-
volumes:
96-
- ../..:/opt/hadoop
97-
- ../_keytabs:/etc/security/keytabs
98-
- ./krb5.conf:/etc/krb5.conf
90+
<<: *common-config
9991
ports:
10092
- 9868:9999
10193
command: ["/opt/hadoop/bin/ozone","datanode"]
@@ -104,22 +96,15 @@ services:
10496
- "scm2.org: 172.25.0.117"
10597
- "scm3.org: 172.25.0.118"
10698
- "recon: 172.25.0.115"
107-
env_file:
108-
- docker-config
10999
environment:
110100
WAITFOR: scm3.org:9894
111101
OZONE_OPTS:
112102
networks:
113103
ozone_net:
114104
ipv4_address: 172.25.0.104
115105
om1:
116-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
117106
hostname: om1
118-
dns_search: .
119-
volumes:
120-
- ../..:/opt/hadoop
121-
- ../_keytabs:/etc/security/keytabs
122-
- ./krb5.conf:/etc/krb5.conf
107+
<<: *common-config
123108
ports:
124109
- 9880:9874
125110
- 9890:9872
@@ -128,8 +113,6 @@ services:
128113
WAITFOR: scm3.org:9894
129114
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
130115
OZONE_OPTS:
131-
env_file:
132-
- ./docker-config
133116
command: ["/opt/hadoop/bin/ozone","om"]
134117
extra_hosts:
135118
- "scm1.org: 172.25.0.116"
@@ -139,13 +122,8 @@ services:
139122
ozone_net:
140123
ipv4_address: 172.25.0.111
141124
om2:
142-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
143125
hostname: om2
144-
dns_search: .
145-
volumes:
146-
- ../..:/opt/hadoop
147-
- ../_keytabs:/etc/security/keytabs
148-
- ./krb5.conf:/etc/krb5.conf
126+
<<: *common-config
149127
ports:
150128
- 9882:9874
151129
- 9892:9872
@@ -154,8 +132,6 @@ services:
154132
WAITFOR: scm3.org:9894
155133
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
156134
OZONE_OPTS:
157-
env_file:
158-
- ./docker-config
159135
command: ["/opt/hadoop/bin/ozone","om"]
160136
extra_hosts:
161137
- "scm1.org: 172.25.0.116"
@@ -165,13 +141,8 @@ services:
165141
ozone_net:
166142
ipv4_address: 172.25.0.112
167143
om3:
168-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
169144
hostname: om3
170-
dns_search: .
171-
volumes:
172-
- ../..:/opt/hadoop
173-
- ../_keytabs:/etc/security/keytabs
174-
- ./krb5.conf:/etc/krb5.conf
145+
<<: *common-config
175146
ports:
176147
- 9884:9874
177148
- 9894:9872
@@ -180,8 +151,6 @@ services:
180151
WAITFOR: scm3.org:9894
181152
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
182153
OZONE_OPTS:
183-
env_file:
184-
- ./docker-config
185154
command: ["/opt/hadoop/bin/ozone","om"]
186155
extra_hosts:
187156
- "scm1.org: 172.25.0.116"
@@ -191,17 +160,10 @@ services:
191160
ozone_net:
192161
ipv4_address: 172.25.0.113
193162
httpfs:
194-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
195163
hostname: httpfs
196-
dns_search: .
197-
volumes:
198-
- ../..:/opt/hadoop
199-
- ../_keytabs:/etc/security/keytabs
200-
- ./krb5.conf:/etc/krb5.conf
164+
<<: *common-config
201165
ports:
202166
- 14000:14000
203-
env_file:
204-
- ./docker-config
205167
command: [ "/opt/hadoop/bin/ozone","httpfs" ]
206168
environment:
207169
OZONE-SITE.XML_hdds.scm.safemode.min.datanode: ${OZONE_SAFEMODE_MIN_DATANODES:-1}
@@ -210,31 +172,15 @@ services:
210172
ozone_net:
211173
ipv4_address: 172.25.0.119
212174
s3g:
213-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
214175
hostname: s3g
215-
dns_search: .
216-
volumes:
217-
- ../..:/opt/hadoop
218-
- ../_keytabs:/etc/security/keytabs
219-
- ./krb5.conf:/etc/krb5.conf
220-
ports:
221-
- 9878:9878
222-
env_file:
223-
- ./docker-config
224-
command: ["/opt/hadoop/bin/ozone","s3g"]
225-
environment:
226-
OZONE_OPTS:
176+
<<: *common-config
177+
command: ["ozone","s3g"]
227178
networks:
228179
ozone_net:
229-
ipv4_address: 172.25.0.114
180+
ipv4_address: 172.25.0.120
230181
scm1.org:
231-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
232182
hostname: scm1.org
233-
dns_search: .
234-
volumes:
235-
- ../..:/opt/hadoop
236-
- ../_keytabs:/etc/security/keytabs
237-
- ./krb5.conf:/etc/krb5.conf
183+
<<: *common-config
238184
ports:
239185
- 9990:9876
240186
- 9992:9860
@@ -256,18 +202,11 @@ services:
256202
ozone_net:
257203
ipv4_address: 172.25.0.116
258204
scm2.org:
259-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
260205
hostname: scm2.org
261-
dns_search: .
262-
volumes:
263-
- ../..:/opt/hadoop
264-
- ../_keytabs:/etc/security/keytabs
265-
- ./krb5.conf:/etc/krb5.conf
206+
<<: *common-config
266207
ports:
267208
- 9994:9876
268209
- 9996:9860
269-
env_file:
270-
- docker-config
271210
environment:
272211
WAITFOR: scm1.org:9894
273212
ENSURE_SCM_BOOTSTRAPPED: /data/metadata/scm/current/VERSION
@@ -285,18 +224,11 @@ services:
285224
ozone_net:
286225
ipv4_address: 172.25.0.117
287226
scm3.org:
288-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
289227
hostname: scm3.org
290-
dns_search: .
291-
volumes:
292-
- ../..:/opt/hadoop
293-
- ../_keytabs:/etc/security/keytabs
294-
- ./krb5.conf:/etc/krb5.conf
228+
<<: *common-config
295229
ports:
296230
- 9998:9876
297231
- 10002:9860
298-
env_file:
299-
- docker-config
300232
environment:
301233
WAITFOR: scm2.org:9894
302234
ENSURE_SCM_BOOTSTRAPPED: /data/metadata/scm/current/VERSION
@@ -314,17 +246,10 @@ services:
314246
ozone_net:
315247
ipv4_address: 172.25.0.118
316248
recon:
317-
image: ${OZONE_RUNNER_IMAGE}:${OZONE_RUNNER_VERSION}
318249
hostname: recon
319-
dns_search: .
320-
volumes:
321-
- ../..:/opt/hadoop
322-
- ../_keytabs:/etc/security/keytabs
323-
- ./krb5.conf:/etc/krb5.conf
250+
<<: *common-config
324251
ports:
325252
- 9888:9888
326-
env_file:
327-
- ./docker-config
328253
environment:
329254
OZONE_OPTS:
330255
command: ["/opt/hadoop/bin/ozone","recon"]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Simple configuration for an HTTP proxy listening on port 9878 on all
18+
# interfaces and forwarding requests to a multiple multiple S3 servers in round
19+
# robin fashion.
20+
global
21+
daemon
22+
maxconn 256
23+
24+
defaults
25+
mode http
26+
timeout connect 5000ms
27+
timeout client 50000ms
28+
timeout server 50000ms
29+
30+
frontend http-in
31+
bind *:9878
32+
default_backend servers
33+
34+
backend servers
35+
balance roundrobin
36+
server server1 172.25.0.121:9878 maxconn 32
37+
server server2 172.25.0.122:9878 maxconn 32
38+
server server3 172.25.0.123:9878 maxconn 32
39+
40+
frontend webadmin
41+
bind *:19878
42+
default_backend webadmin-servers
43+
44+
backend webadmin-servers
45+
balance roundrobin
46+
server server1 172.25.0.121:19878 maxconn 32
47+
server server2 172.25.0.122:19878 maxconn 32
48+
server server3 172.25.0.123:19878 maxconn 32

0 commit comments

Comments
 (0)