Skip to content

Commit dd26221

Browse files
committed
updating examples to use dynamic-haproxy
1 parent fd616dc commit dd26221

31 files changed

+46
-318
lines changed

example-enterprise-backup/docker-compose.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ services:
3030
lb:
3131
container_name: lb
3232
hostname: lb
33-
build: haproxy
33+
image: timveil/dynamic-haproxy:latest
3434
ports:
35-
- "5432:5432"
35+
- "26257:26257"
3636
- "8080:8080"
3737
- "8081:8081"
38+
environment:
39+
- NODES=crdb-0 crdb-1 crdb-2
3840
links:
3941
- crdb-0
4042
- crdb-1

example-enterprise-backup/haproxy/Dockerfile

-8
This file was deleted.

example-enterprise-backup/haproxy/haproxy.cfg

-40
This file was deleted.

example-haproxy-with-workload/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Simple 3 node CockroachDB cluster with HAProxy acting as load balancer
2020
While `.up.sh` will automatically initialize and run the `tpcc` workload, you can use the following command to restart the `tpcc` sample `workload` for 10 minutes. For more details see [this](https://www.cockroachlabs.com/docs/stable/cockroach-workload.html#run-the-tpcc-workload).
2121

2222
```bash
23-
docker-compose exec workload-client /cockroach/cockroach workload run tpcc --tolerate-errors --warehouses=3 --duration=10m "postgresql://root@lb:5432?sslmode=disable"
23+
docker-compose exec workload-client /cockroach/cockroach workload run tpcc --tolerate-errors --warehouses=3 --duration=10m "postgresql://root@lb:26257?sslmode=disable"
2424
```
2525

2626
### Open Interactive Shells

example-haproxy-with-workload/docker-compose.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ services:
2727
lb:
2828
container_name: lb
2929
hostname: lb
30-
build: haproxy
30+
image: timveil/dynamic-haproxy:latest
3131
ports:
32-
- "5432:5432"
32+
- "26257:26257"
3333
- "8080:8080"
3434
- "8081:8081"
35+
environment:
36+
- NODES=crdb-0 crdb-1 crdb-2
3537
links:
3638
- crdb-0
3739
- crdb-1

example-haproxy-with-workload/haproxy/Dockerfile

-9
This file was deleted.

example-haproxy-with-workload/haproxy/haproxy.cfg

-37
This file was deleted.

example-haproxy-with-workload/up.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ docker-compose up -d
66

77
sleep 10
88

9-
docker-compose exec workload-client /cockroach/cockroach workload init --warehouses=3 tpcc "postgresql://root@lb:5432?sslmode=disable"
10-
docker-compose exec workload-client /cockroach/cockroach workload run --warehouses=3 tpcc --tolerate-errors --duration=30m "postgresql://root@lb:5432?sslmode=disable"
9+
docker-compose exec workload-client /cockroach/cockroach workload init --warehouses=3 tpcc "postgresql://root@lb:26257?sslmode=disable"
10+
docker-compose exec workload-client /cockroach/cockroach workload run --warehouses=3 tpcc --tolerate-errors --duration=30m "postgresql://root@lb:26257?sslmode=disable"

example-haproxy/docker-compose.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ services:
2727
lb:
2828
container_name: lb
2929
hostname: lb
30-
build: haproxy
30+
image: timveil/dynamic-haproxy:latest
3131
ports:
32-
- "5432:5432"
32+
- "26257:26257"
3333
- "8080:8080"
3434
- "8081:8081"
35+
environment:
36+
- NODES=crdb-0 crdb-1 crdb-2
3537
links:
3638
- crdb-0
3739
- crdb-1

example-haproxy/haproxy/Dockerfile

-9
This file was deleted.

example-haproxy/haproxy/haproxy.cfg

-37
This file was deleted.

example-nginx/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
hostname: lb
3030
build: ./nginx
3131
ports:
32-
- "5432:5432"
32+
- "26257:26257"
3333
- "8080:8080"
3434
links:
3535
- crdb-0

example-nginx/nginx/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="[email protected]"
44

55
COPY nginx.conf /etc/nginx/nginx.conf
66

7-
EXPOSE 5432
7+
EXPOSE 26257
88
EXPOSE 8080
99

1010
CMD ["nginx", "-g", "daemon off;"]

example-nginx/nginx/nginx.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ stream {
99
}
1010

1111
server {
12-
listen 5432;
12+
listen 26257;
1313
proxy_pass crdb-backend;
1414
}
1515

example-oltpbench/docker-compose.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ services:
2727
lb:
2828
container_name: lb
2929
hostname: lb
30-
build: haproxy
30+
image: timveil/dynamic-haproxy:latest
3131
ports:
32-
- "5432:5432"
32+
- "26257:26257"
3333
- "8080:8080"
3434
- "8081:8081"
35+
environment:
36+
- NODES=crdb-0 crdb-1 crdb-2
3537
links:
3638
- crdb-0
3739
- crdb-1
@@ -42,7 +44,7 @@ services:
4244
hostname: crdb-init
4345
image: timveil/cockroachdb-remote-client:latest
4446
environment:
45-
- COCKROACH_HOST=lb:5432
47+
- COCKROACH_HOST=lb:26257
4648
- COCKROACH_INSECURE=true
4749
- DATABASE_NAME=oltpbench
4850
depends_on:

example-oltpbench/haproxy/Dockerfile

-9
This file was deleted.

example-oltpbench/haproxy/haproxy.cfg

-40
This file was deleted.

example-oltpbench/oltp-bench/crdb_tpcc_config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- Connection details -->
55
<type>COCKROACHDB</type>
66
<driver>org.postgresql.Driver</driver>
7-
<url>jdbc:postgresql://lb:5432/oltpbench?sslmode=disable&amp;ApplicationName=tpcc&amp;reWriteBatchedInserts=true</url>
7+
<url>jdbc:postgresql://lb:26257/oltpbench?sslmode=disable&amp;ApplicationName=tpcc&amp;reWriteBatchedInserts=true</url>
88
<username>root</username>
99
<password></password>
1010
<isolation>TRANSACTION_SERIALIZABLE</isolation>

example-oltpbench/oltp-bench/crdb_tpch_config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- Connection details -->
55
<type>COCKROACHDB</type>
66
<driver>org.postgresql.Driver</driver>
7-
<url>jdbc:postgresql://lb:5432/oltpbench?sslmode=disable&amp;ApplicationName=tpch&amp;reWriteBatchedInserts=true</url>
7+
<url>jdbc:postgresql://lb:26257/oltpbench?sslmode=disable&amp;ApplicationName=tpch&amp;reWriteBatchedInserts=true</url>
88
<username>root</username>
99
<password></password>
1010
<isolation>TRANSACTION_SERIALIZABLE</isolation>

example-oltpbench/oltp-bench/crdb_ycsb_config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- Connection details -->
55
<type>COCKROACHDB</type>
66
<driver>org.postgresql.Driver</driver>
7-
<url>jdbc:postgresql://lb:5432/oltpbench?sslmode=disable&amp;ApplicationName=ycsb&amp;reWriteBatchedInserts=true</url>
7+
<url>jdbc:postgresql://lb:26257/oltpbench?sslmode=disable&amp;ApplicationName=ycsb&amp;reWriteBatchedInserts=true</url>
88
<username>root</username>
99
<password></password>
1010
<isolation>TRANSACTION_SERIALIZABLE</isolation>

example-secure-nginx/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ services:
5555
hostname: lb
5656
build: nginx
5757
ports:
58-
- "5432:5432"
58+
- "26257:26257"
5959
- "8080:8080"
6060
depends_on:
6161
- roach-0
@@ -68,7 +68,7 @@ services:
6868
hostname: roach-init
6969
image: timveil/cockroachdb-remote-client:latest
7070
environment:
71-
- COCKROACH_HOST=lb:5432
71+
- COCKROACH_HOST=lb:26257
7272
- COCKROACH_INSECURE=false
7373
- COCKROACH_CERTS_DIR=/certs
7474
- DATABASE_NAME=test

example-secure-nginx/nginx/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="[email protected]"
44

55
COPY nginx.conf /etc/nginx/nginx.conf
66

7-
EXPOSE 5432
7+
EXPOSE 26257
88
EXPOSE 8080
99

1010
CMD ["nginx", "-g", "daemon off;"]

example-secure-nginx/nginx/nginx.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ stream {
99
}
1010

1111
server {
12-
listen 5432;
12+
listen 26257;
1313
proxy_pass crdb-backend;
1414
}
1515

0 commit comments

Comments
 (0)