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: README.adoc
+25-85
Original file line number
Diff line number
Diff line change
@@ -255,6 +255,19 @@ If you want to raise an issue, please follow the recommendations below:
255
255
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using, the JVM version, Stacktrace, etc.
256
256
* If you need to paste code, or include a stack trace use https://guides.github.com/features/mastering-markdown/[Markdown] code fences +++```+++.
257
257
258
+
[[guides]]
259
+
== Guides
260
+
261
+
The https://spring.io/[spring.io] site contains several guides that show how to use Spring Data step-by-step:
262
+
263
+
* https://spring.io/guides/gs/accessing-data-mongodb/[Accessing Data with MongoDB] is a very basic guide that shows you how to create a simple application and how to access data using repositories.
264
+
* https://spring.io/guides/gs/accessing-mongodb-data-rest/[Accessing MongoDB Data with REST] is a guide to creating a REST web service exposing data stored in MongoDB through repositories.
265
+
266
+
[[examples]]
267
+
== Examples
268
+
269
+
* https://github.com/spring-projects/spring-data-examples/[Spring Data Examples] contains example projects that explain specific features in more detail.
270
+
258
271
[[building-from-source]]
259
272
== Building from Source
260
273
@@ -272,109 +285,46 @@ However, if you want to try out the latest and greatest, Spring Data can be easi
272
285
and minimally JDK 8 (https://www.oracle.com/java/technologies/downloads/[JDK downloads]).
273
286
274
287
In order to build Spring Data MongoDB, first you will need to https://www.mongodb.com/try/download/community[download]
275
-
and install a MongoDB distribution. Select "_On-premises (MongoDB locally)_", then "_MongoDB Community Server_"
276
-
and in the page form, select the platform matching your system along with the version of MongoDB on which Spring Data
277
-
MongoDB is based (https://github.com/spring-projects/spring-data-mongodb/blob/3.2.5/pom.xml#L30[for example]).
288
+
and https://docs.mongodb.com/manual/installation/[install a MongoDB distribution].
278
289
279
290
Once you have installed MongoDB, you need to start a MongoDB server. It is convenient to set an environment variable to
280
291
your MongoDB installation (e.g. `MONGODB_HOME`).
281
292
293
+
To run the full test suite a https://docs.mongodb.com/manual/tutorial/deploy-replica-set/[MongoDB Replica Set] is required.
294
+
282
295
To run the MongoDB server enter the following command from a command-line:
"msg":"Successfully connected to host","attr":{"connString":"127.0.0.1:27017","numOpenConns":1,"socketTimeoutSecs":0.0}}
301
+
"msg":"Successfully connected to host"
290
302
----
291
303
292
304
Once the MongoDB server starts up, you should see the message (`msg`), "_Successfully connected to host_".
293
305
294
306
Notice the `--dbpath` option to the `mongod` command. You can set this to anything you like, but in this case, we set
295
307
the absolute path to a sub-directory (`runtime/data/`) under the MongoDB installation directory (in `$MONGODB_HOME`).
296
-
You might have other sub-directories as well, such as `runtime/logs/` for instance, if you wish to write your logs to
297
-
a file rather than standard out, using the `--logpath` option to the `mongod` command. In this way, all your "runtime"
298
-
files for the MongoDB server are conveniently located in one place.
299
308
300
-
Next, you need to initialize the MongoDB replica set the first time the MongoDB server is started. Replicas are used by
301
-
the Spring Data MongoDB transactional tests. This only needs to be done once after the initial start. If you restart
302
-
your MongoDB server, you will need to initialize the replica set again. However, you can continue to use the same
303
-
MongoDB server for multiple builds of Spring Data MongoDB.
304
-
305
-
To initialize the replica set, you must start a mongo client:
309
+
You need to initialize the MongoDB replica set only once on the first time the MongoDB server is started.
310
+
To initialize the replica set, start a mongo client:
306
311
307
312
[source,bash]
308
313
----
309
314
$ $MONGODB_HOME/bin/mongo
310
-
MongoDB server version: 4.4.8
311
-
---
312
-
The server generated these startup warnings when booting:
313
-
2021-09-22T11:26:50.752-07:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
314
-
2021-09-22T11:26:50.752-07:00: This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning
315
-
2021-09-22T11:26:50.752-07:00: Soft rlimits too low
Finally, you may need to adjust the `ulimit` on your UNIX-based system (for example, Linux or Mac OS X). Currently,
356
-
the MongoDB client/server combination uses many Socket connections (which equate to file descriptors on a UNIX-based
357
-
system) throughout the Spring Data MongoDB test suite lifecycle. You can inspect your current `ulimit` with
358
-
the following command:
359
-
360
-
[source,bash]
361
-
----
362
-
$ ulimit -a
363
-
core file size (blocks, -c) 0
364
-
data seg size (kbytes, -d) unlimited
365
-
file size (blocks, -f) unlimited
366
-
max locked memory (kbytes, -l) unlimited
367
-
max memory size (kbytes, -m) unlimited
368
-
open files (-n) 256
369
-
pipe size (512 bytes, -p) 1
370
-
stack size (kbytes, -s) 8192
371
-
cpu time (seconds, -t) unlimited
372
-
max user processes (-u) 5568
373
-
virtual memory (kbytes, -v) unlimited
374
-
----
375
-
376
-
In this case, we are interested in the `ulimit` setting for "_open files_". As you can see above, this is set to 256.
377
-
You will need to adjust this with the following command (we recommend 32768):
326
+
Finally, on UNIX-based system (for example, Linux or Mac OS X) you may need to adjust the `ulimit`.
327
+
In case you need to, you can adjust the `ulimit` with the following command (32768 is just a recommendation):
378
328
379
329
[source,bash]
380
330
----
@@ -406,17 +356,7 @@ Building the documentation builds also the project without running tests.
406
356
407
357
The generated documentation is available from `target/site/reference/html/index.html`.
408
358
409
-
== Guides
410
-
411
-
The https://spring.io/[spring.io] site contains several guides that show how to use Spring Data step-by-step:
412
-
413
-
* https://spring.io/guides/gs/accessing-data-mongodb/[Accessing Data with MongoDB] is a very basic guide that shows you how to create a simple application and how to access data using repositories.
414
-
* https://spring.io/guides/gs/accessing-mongodb-data-rest/[Accessing MongoDB Data with REST] is a guide to creating a REST web service exposing data stored in MongoDB through repositories.
415
-
416
-
== Examples
417
-
418
-
* https://github.com/spring-projects/spring-data-examples/[Spring Data Examples] contains example projects that explain specific features in more detail.
419
-
359
+
[[license]]
420
360
== License
421
361
422
362
Spring Data MongoDB is Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].
0 commit comments