📜  docker-compose mongodb 副本 - 初始化副本 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:45.702000             🧑  作者: Mango

代码示例1
#!/bin/bash
    
    echo "Starting replica set initialize"
    until mongo --host mongodb1 --eval "print(\"waited for connection\")"
    do
        sleep 2
    done
    echo "Connection finished"
    echo "Creating replica set"
    mongo --host mongodb1 <