add healthcheck to mongodb to init replicaset if not already init
This commit is contained in:
1 parent
db20b4c1ff
commit
36f528fbf9
3 files changed
+17
-4
No files matched your search
@@ -2,7 +2,7 @@ function initiateReplicaSet() {
|
||||
try {
|
||||
rs.initiate({
|
||||
_id: "rs0",
|
||||
members: [{ _id: 0, host: "mongodb:27017" }],
|
||||
members: [{ _id: 0, host: "localhost:27017" }],
|
||||
});
|
||||
} catch (e) {
|
||||
print("Replica set already initiated or error occurred: " + e);
|
||||
|
||||
Reference in new issue
Block a user