Mongos Install/Setup in Elastic Beanstalk

前端 未结 2 1373
不知归路
不知归路 2020-12-07 16:13

Looking down the road at sharding, we would like to be able to have multiple mongos instances. The recommendation seems to be to put mongos on each application server. I was

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 16:40

    I couldn't get @bobmarksie's solution to work, but thanks to anowak and avinci here for this .ebextensions/aws.config file:

    files:
      "/home/ec2-user/install_mongo.sh" :
        mode: "0007555"
        owner: root
        group: root
        content: |
          #!/bin/bash
          echo "[MongoDB]
          name=MongoDB Repository
          baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
          gpgcheck=0
          enabled=1" | tee -a /etc/yum.repos.d/mongodb.repo
          yum -y update
          yum -y install mongodb-org-server mongodb-org-shell mongodb-org-tools
    
    commands:
      01install_mongo:
        command: ./install_mongo.sh
        cwd: /home/ec2-user
        test: '[ ! -f /usr/bin/mongo ] && echo "MongoDB not installed"'
    
    services:
      sysvinit:
        mongod:
          enabled: true
          ensureRunning: true
          commands: ['01install_mongo']
    

提交回复
热议问题