You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Developing DistributedLock.md
+96-2Lines changed: 96 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,19 +26,24 @@ performance_schema=ON
26
26
After doing this, restart MariaDB (on Windows, do this in the Services app).
27
27
28
28
Next, create the `distributed_lock` database and a user for the tests to run as:
29
+
29
30
```sql
30
31
CREATEDATABASEdistributed_lock;
31
32
CREATEUSER 'DistributedLock'@'localhost' IDENTIFIED BY '<password>';
32
33
GRANT ALL PRIVILEGES ON distributed_lock.* TO 'DistributedLock'@'localhost';
33
34
GRANTSELECTON performance_schema.* TO 'DistributedLock'@'localhost';
34
35
```
35
36
37
+
(Windows) If you don't want MariaDB always running on your machine, set the Startup type to "Manual" for `MariaDB`.
38
+
36
39
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.
37
40
38
41
#### MySQL
39
42
40
43
You can install MySQL from [here](https://dev.mysql.com/downloads/mysql/). Run on port 3307 to avoid conflicting with MariaDB.
41
44
45
+
(Windows) If you don't want MySQL always running on your machine, set the Startup type to "Manual" for `MySQL{Version}`.
46
+
42
47
Add your username and password to `DistributedLock.Tests/credentials/mysql.txt`, with the username on line 1 and the password on line 2.
43
48
44
49
### Oracle
@@ -47,28 +52,117 @@ You can install Oracle from [here](https://www.oracle.com/database/technologies/
47
52
48
53
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.
49
54
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.
51
56
52
57
### Postgres
53
58
54
59
You can install Postgres from [here](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads).
55
60
56
61
In `C:\Program Files\PostgreSQL\<version>\data\postgresql.conf`, update `max_connections` to 200.
57
62
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
+
58
65
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.
59
66
60
67
### SQL Server
61
68
62
69
Download SQL developer edition from [here](https://www.microsoft.com/en-us/sql-server/sql-server-downloads).
63
70
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.
65
74
66
75
### Redis
67
76
68
77
Install Redis locally. On Windows, install it via WSL as described [here](https://developer.redis.com/create/windows/).
69
78
70
79
You do not need it running as a service: the tests will start and stop instances automatically.
71
80
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:
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:
Download a ZooKeeper installation by going to [https://zookeeper.apache.org/](https://zookeeper.apache.org/)->Documentation->Release ...->Getting Started->Download->stable.
0 commit comments