Skip to content

Commit 231a8c7

Browse files
authored
Merge pull request #268 from madelson/release-2.8
Release 2.8
2 parents 3a80fd0 + f69f908 commit 231a8c7

File tree

63 files changed

+4381
-442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4381
-442
lines changed

README.md

Lines changed: 85 additions & 82 deletions
Large diffs are not rendered by default.

docs/Developing DistributedLock.md

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,24 @@ performance_schema=ON
2626
After doing this, restart MariaDB (on Windows, do this in the Services app).
2727

2828
Next, create the `distributed_lock` database and a user for the tests to run as:
29+
2930
```sql
3031
CREATE DATABASE distributed_lock;
3132
CREATE USER 'DistributedLock'@'localhost' IDENTIFIED BY '<password>';
3233
GRANT ALL PRIVILEGES ON distributed_lock.* TO 'DistributedLock'@'localhost';
3334
GRANT SELECT ON performance_schema.* TO 'DistributedLock'@'localhost';
3435
```
3536

37+
(Windows) If you don't want MariaDB always running on your machine, set the Startup type to "Manual" for `MariaDB`.
38+
3639
Finally, add your username (DistributedLock) and password to `DistributedLock.Tests/credentials/mariadb.txt`, with the username on line 1 and the password on line 2.
3740

3841
#### MySQL
3942

4043
You can install MySQL from [here](https://dev.mysql.com/downloads/mysql/). Run on port 3307 to avoid conflicting with MariaDB.
4144

45+
(Windows) If you don't want MySQL always running on your machine, set the Startup type to "Manual" for `MySQL{Version}`.
46+
4247
Add your username and password to `DistributedLock.Tests/credentials/mysql.txt`, with the username on line 1 and the password on line 2.
4348

4449
### Oracle
@@ -47,28 +52,117 @@ You can install Oracle from [here](https://www.oracle.com/database/technologies/
4752

4853
Add your username (e.g. SYSTEM) and password to `DistributedLock.Tests/credentials/oracle.txt`, with the username on line 1 and the password on line 2.
4954

50-
If the Oracle tests fail with `ORA-12541: TNS:no listener`, you may have to start the OracleOraDB21Home1TNSListener service in services.svc and/or restart the OracleServiceXE. After starting these it can take a few minutes for the DB to come online.
55+
(Windows) If the Oracle tests fail with `ORA-12541: TNS:no listener`, you may have to start the `OracleOraDB21Home1TNSListener` service in services.svc and/or restart the `OracleServiceXE`. After starting these it can take a few minutes for the DB to come online.
5156

5257
### Postgres
5358

5459
You can install Postgres from [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads).
5560

5661
In `C:\Program Files\PostgreSQL\<version>\data\postgresql.conf`, update `max_connections` to 200.
5762

63+
(Windows) If you don't want Postgres always running on your machine, set the Startup type to "Manual" for `postgresql-x64-{VERSION} - PostgresSQL Server {VERSION}`.
64+
5865
Add your username (e.g. postgres) and password to `DistributedLock.Tests/credentials/postgres.txt`, with the username on line 1 and the password on line 2.
5966

6067
### SQL Server
6168

6269
Download SQL developer edition from [here](https://www.microsoft.com/en-us/sql-server/sql-server-downloads).
6370

64-
The tests connect via integrated security.
71+
(Windows) If you don't want SQLServer always running on your machine, set the Startup type to "Manual" for `SQL Server (MSSQLSERVER)`.
72+
73+
The tests connect via integrated security.
6574

6675
### Redis
6776

6877
Install Redis locally. On Windows, install it via WSL as described [here](https://developer.redis.com/create/windows/).
6978

7079
You do not need it running as a service: the tests will start and stop instances automatically.
7180

81+
82+
### MongoDB
83+
84+
The recommended approach for MongoDB is to use Docker (e.g. Docker desktop on Windows). To spin up an instance without manual initialization. The test suite assumes docker is running and will try to start the container with:
85+
86+
```bat
87+
docker run -d -p 27017:27017 --name distributed-lock-mong mongo:latest
88+
```
89+
90+
<details>
91+
<summary>Advanced setup options</summary>
92+
<p>
93+
You can download the MongoDB Community Server from [here](https://www.mongodb.com/try/download/community).
94+
95+
Or use `docker compose` to start a replica set environment:
96+
97+
```yaml
98+
services:
99+
mongo_primary:
100+
image: bitnami/mongodb:latest
101+
container_name: mongo_primary
102+
environment:
103+
- TZ=UTC
104+
- MONGODB_ADVERTISED_HOSTNAME=host.docker.internal
105+
- MONGODB_REPLICA_SET_MODE=primary
106+
- MONGODB_REPLICA_SET_NAME=rs0
107+
- MONGODB_ROOT_USER=yourUsername
108+
- MONGODB_ROOT_PASSWORD=yourPassword
109+
- MONGODB_REPLICA_SET_KEY=yourKey
110+
ports:
111+
- "27017:27017"
112+
volumes:
113+
- "mongodb_master_data:/bitnami/mongodb"
114+
115+
mongo_secondary:
116+
image: bitnami/mongodb:latest
117+
container_name: mongo_secondary
118+
depends_on:
119+
- mongo_primary
120+
environment:
121+
- TZ=UTC
122+
- MONGODB_ADVERTISED_HOSTNAME=host.docker.internal
123+
- MONGODB_REPLICA_SET_MODE=secondary
124+
- MONGODB_REPLICA_SET_NAME=rs0
125+
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
126+
- MONGODB_INITIAL_PRIMARY_HOST=host.docker.internal
127+
- MONGODB_INITIAL_PRIMARY_ROOT_USER=yourUsername
128+
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=yourPassword
129+
- MONGODB_REPLICA_SET_KEY=yourKey
130+
ports:
131+
- "27018:27017"
132+
133+
mongo_arbiter:
134+
image: bitnami/mongodb:latest
135+
container_name: mongo_arbiter
136+
depends_on:
137+
- mongo_primary
138+
environment:
139+
- TZ=UTC
140+
- MONGODB_ADVERTISED_HOSTNAME=host.docker.internal
141+
- MONGODB_REPLICA_SET_MODE=arbiter
142+
- MONGODB_REPLICA_SET_NAME=rs0
143+
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
144+
- MONGODB_INITIAL_PRIMARY_HOST=host.docker.internal
145+
- MONGODB_INITIAL_PRIMARY_ROOT_USER=yourUsername
146+
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=yourPassword
147+
- MONGODB_REPLICA_SET_KEY=yourKey
148+
ports:
149+
- "27019:27017"
150+
151+
volumes:
152+
mongodb_master_data:
153+
driver: local
154+
```
155+
156+
The tests default to `mongodb://localhost:27017`. To use a custom connection string (e.g. for credentials), place it in `DistributedLock.Tests/credentials/mongodb.txt`.
157+
158+
If you're using a replica set or sharded cluster, your connection string might look like this:
159+
160+
```
161+
mongodb://yourUsername:yourPassword@host.docker.internal:27017,host.docker.internal:27018,host.docker.internal:27019/?replicaSet=rs0&authSource=admin&serverSelectionTimeoutMS=1000
162+
```
163+
</p>
164+
</details>
165+
72166
### ZooKeeper
73167

74168
Download a ZooKeeper installation by going to [https://zookeeper.apache.org/](https://zookeeper.apache.org/)->Documentation->Release ...->Getting Started->Download->stable.

0 commit comments

Comments
 (0)