8e92a1f537545e0c7e040b941cd6d5abc16b9685
wiki/info/landscape/amazon-ec2.md
| ... | ... | @@ -29,7 +29,7 @@ INSTALL_FROM_RELEASE=(name-of-release) |
| 29 | 29 | USE_ENVIRONMENT=live-master-server |
| 30 | 30 | SERVER_NAME=myspecificevent |
| 31 | 31 | REPLICATION_CHANNEL=myspecificevent |
| 32 | -MONGODB_URI="mongodb://mongo0.internal.sapsailing.com,mongo1.internal.sapsailing.com/myspecificevent?replicaSet=live&retryWrites=true" |
|
| 32 | +MONGODB_URI="mongodb://mongo0.internal.sapsailing.com,mongo1.internal.sapsailing.com/myspecificevent?replicaSet=live&retryWrites=true&readPreference=nearest" |
|
| 33 | 33 | # Provide authentication credentials for a user on security-service.sapsailing.com permitted to replicate, either by username/password... |
| 34 | 34 | #REPLICATE_MASTER_USERNAME=(user for replicator login on security-service.sapsailing.com server having SERVER:REPLICATE:<server-name> permission) |
| 35 | 35 | #REPLICATE_MASTER_PASSWORD=(password of the user for replication login on security-service.sapsailing.com) |
| ... | ... | @@ -65,7 +65,7 @@ REPLICATE_MASTER_EXCHANGE_NAME=myspecificevent |
| 65 | 65 | # https://master-server.sapsailing.com/security/api/restsecurity/access_token |
| 66 | 66 | REPLICATE_MASTER_BEARER_TOKEN=(a bearer token allowing this master to replicate from your master) |
| 67 | 67 | SERVER_NAME=MYSPECIFICEVENT |
| 68 | -MONGODB_URI="mongodb://mongo0.internal.sapsailing.com,mongo1.internal.sapsailing.com/myspecificevent-replica?replicaSet=live&retryWrites=true" |
|
| 68 | +MONGODB_URI="mongodb://mongo0.internal.sapsailing.com,mongo1.internal.sapsailing.com/myspecificevent-replica?replicaSet=live&retryWrites=true&readPreference=nearest" |
|
| 69 | 69 | EVENT_ID={some-uuid-of-an-event-you-want-to-feature} |
| 70 | 70 | SERVER_STARTUP_NOTIFY=you@email.com |
| 71 | 71 | ``` |
| ... | ... | @@ -641,4 +641,4 @@ Should you want to compare servers of which you know they have different sets of |
| 641 | 641 | <tr><td>Network Interfaces</td><td>Virtual network interfaces that are mapped to physical network interfaces on instances. </td></tr> |
| 642 | 642 | |
| 643 | 643 | <tr><td>Multi instance</td><td>App instance that runs along with other app instances on the same EC2 instance</td></tr><tr><td>Placement Groups</td><td>Enables applications to get the full-bisection bandwidth and low-latency network performance required for tightly coupled, node-to-node communication. Placement Groups can only contain HVM instance and have other limitations described here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html</td></tr> |
| 644 | -</table> |
|
| ... | ... | \ No newline at end of file |
| 0 | +</table> |
wiki/info/landscape/creating-ec2-mongodb-image-from-scratch.md
| ... | ... | @@ -99,7 +99,7 @@ Then execute ``systemctl enable mongod.service`` and ``systemctl enable mongo-re |
| 99 | 99 | |
| 100 | 100 | ## Manual MongoDB Replica Set Configuration |
| 101 | 101 | |
| 102 | -In case you decide to skip the benefits of ``mongo-replica-set.service``, you can also establish the connection with the replica set as follows. Connect to the MongoDB on the instance. If it is the first instance of a replica set, issue the command ``rs.initiate()`` in order to turn the instance into the "seed" of a replica set. You can then, for the time being, ``quit()`` the mongo shell. Re-connecting, e.g., with ``mongo "mongodb://localhost:27017/?replicaSet=live"``, will show the ``PRIMARY`` of the new replica set. Don't issue these commands if you only want to add another replica to an existing replica set. |
|
| 102 | +In case you decide to skip the benefits of ``mongo-replica-set.service``, you can also establish the connection with the replica set as follows. Connect to the MongoDB on the instance. If it is the first instance of a replica set, issue the command ``rs.initiate()`` in order to turn the instance into the "seed" of a replica set. You can then, for the time being, ``quit()`` the mongo shell. Re-connecting, e.g., with ``mongo "mongodb://localhost:27017/?replicaSet=live&readPreference=nearest"``, will show the ``PRIMARY`` of the new replica set. Don't issue these commands if you only want to add another replica to an existing replica set. |
|
| 103 | 103 | |
| 104 | 104 | Connected to the PRIMARY using the ``mongo`` shell, a replica can be added using ``rs.add({host: "hostname:port"})``. For additional options see [here](https://docs.mongodb.com/manual/reference/method/rs.add/). To add a hidden replica on ``dbserver.internal.sapsailing.com:10203``, use ``rs.add({host: "dbserver.internal.sapsailing.com:10203", buildIndexes: false, hidden: true, priority: 0})``. |
| 105 | 105 | |
| ... | ... | @@ -113,4 +113,4 @@ Instead, the ``launch-mongodb-replica.sh`` script can be used to fire up a repli |
| 113 | 113 | |
| 114 | 114 | ``configuration/aws-automation/launch-mongodb-replica.sh -r archive -p dbserver.internal.sapsailing.com:10201 -P 0 -t i2.xlarge -k <your-aws-key-pair-name>`` |
| 115 | 115 | |
| 116 | -You can then check the replication status by connecting your ``mongo`` client to ``dbserver.internal.sapsailing.com:10201`` and check the output of ``rs.status()``. As long as the new instance is listed in status ``STARTUP2`` it is still synchronizing from the primary. Eventually (took 55min during the last test) it transitions to status ``SECONDARY``. You can then use a connection string such as ``mongodb://dbserver.internal.sapsailing.com:10201/winddb?replicaSet=archive&retryWrites=true&readPreference=secondary`` for the ``MONGODB_URI`` in your archive server Java instance which will then preferably connect to your new fast secondary replica. Consider that the new secondary replica will have to build indices when first queried. This can take another 20 minutes. When done loading the archive server, terminate the instance which will properly remove the replica from the replica set. |
|
| ... | ... | \ No newline at end of file |
| 0 | +You can then check the replication status by connecting your ``mongo`` client to ``dbserver.internal.sapsailing.com:10201`` and check the output of ``rs.status()``. As long as the new instance is listed in status ``STARTUP2`` it is still synchronizing from the primary. Eventually (took 55min during the last test) it transitions to status ``SECONDARY``. You can then use a connection string such as ``mongodb://dbserver.internal.sapsailing.com:10201/winddb?replicaSet=archive&retryWrites=true&readPreference=secondary`` for the ``MONGODB_URI`` in your archive server Java instance which will then preferably connect to your new fast secondary replica. Consider that the new secondary replica will have to build indices when first queried. This can take another 20 minutes. When done loading the archive server, terminate the instance which will properly remove the replica from the replica set. |