|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +# |
| 19 | + |
| 20 | + |
| 21 | +#### Instructions |
| 22 | +# |
| 23 | +# docker compose up |
| 24 | +# |
| 25 | +# ./gradlew :polaris-persistence-nosql-benchmark:jmhJar && \ |
| 26 | +# java \ |
| 27 | +# -Dpolaris.persistence.backend.type=MongoDb \ |
| 28 | +# -Dpolaris.persistence.backend.mongodb.connection-string=mongodb://127.0.0.1:27017,127.0.0.1:27018,127.0.0.1:27019/?replicaSet=rs0 \ |
| 29 | +# -Dpolaris.persistence.backend.mongodb.database-name=test \ |
| 30 | +# -jar persistence/benchmark/build/libs/polaris-persistence-nosql-benchmark-1.0.0-incubating-SNAPSHOT-jmh.jar |
| 31 | +# |
| 32 | +# MAKE SURE TO ADD |
| 33 | +# 127.0.0.1 host.docker.internal |
| 34 | +# TO THE HOST'S /etc/hosts FILE |
| 35 | +# |
| 36 | +# Once done (after `docker compose down`): |
| 37 | +# docker volume rm mongodb-3-nodes_mongo1_config mongodb-3-nodes_mongo1_data mongodb-3-nodes_mongo2_config mongodb-3-nodes_mongo2_data mongodb-3-nodes_mongo3_config mongodb-3-nodes_mongo3_data |
| 38 | + |
| 39 | +version: '3' |
| 40 | + |
| 41 | +services: |
| 42 | + mongo1: |
| 43 | + image: mongo:8.2.1 |
| 44 | + command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] |
| 45 | + ports: |
| 46 | + - "27017:27017" |
| 47 | + extra_hosts: |
| 48 | + - "host.docker.internal:host-gateway" |
| 49 | + healthcheck: |
| 50 | + test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:27017',priority:1},{_id:1,host:'host.docker.internal:27018',priority:0.5},{_id:2,host:'host.docker.internal:27019',priority:0.5}]}) }" | mongosh --port 27017 --quiet |
| 51 | + interval: 5s |
| 52 | + timeout: 30s |
| 53 | + retries: 30 |
| 54 | + volumes: |
| 55 | + - "mongo1_data:/data/db" |
| 56 | + - "mongo1_config:/data/configdb" |
| 57 | + |
| 58 | + mongo2: |
| 59 | + image: mongo:8.2.1 |
| 60 | + command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27018"] |
| 61 | + ports: |
| 62 | + - "27018:27018" |
| 63 | + extra_hosts: |
| 64 | + - "host.docker.internal:host-gateway" |
| 65 | + volumes: |
| 66 | + - "mongo2_data:/data/db" |
| 67 | + - "mongo2_config:/data/configdb" |
| 68 | + |
| 69 | + mongo3: |
| 70 | + image: mongo:8.2.1 |
| 71 | + command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27019"] |
| 72 | + ports: |
| 73 | + - "27019:27019" |
| 74 | + extra_hosts: |
| 75 | + - "host.docker.internal:host-gateway" |
| 76 | + volumes: |
| 77 | + - "mongo3_data:/data/db" |
| 78 | + - "mongo3_config:/data/configdb" |
| 79 | + |
| 80 | +volumes: |
| 81 | + mongo1_data: |
| 82 | + mongo2_data: |
| 83 | + mongo3_data: |
| 84 | + mongo1_config: |
| 85 | + mongo2_config: |
| 86 | + mongo3_config: |
0 commit comments