Skip to content

Instantly share code, notes, and snippets.

@anhtranbk
Last active July 27, 2018 02:40
Show Gist options
  • Save anhtranbk/7a1135a335cde1f95f5f4b919054dc2a to your computer and use it in GitHub Desktop.
Save anhtranbk/7a1135a335cde1f95f5f4b919054dc2a to your computer and use it in GitHub Desktop.

Revisions

  1. Anh Tran Nhat revised this gist Jul 27, 2018. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions limit-mongod
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # /usr/lib/systemd/system/mongod.service

    # file size
    LimitFSIZE=infinity
    # cpu time
    LimitCPU=infinity
    # virtual memory size
    LimitAS=infinity
    # open files
    LimitNOFILE=64000
    # processes/threads
    LimitNPROC=64000
    # total threads (user+kernel)
    TasksMax=infinity
    TasksAccounting=false
    # Recommended limits for for mongod as specified in
    # http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
  2. Anh Tran Nhat revised this gist Jul 12, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions mongo-scripts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    use local
    rs.initiate()
  3. Anh Tran Nhat created this gist Jul 10, 2018.
    7 changes: 7 additions & 0 deletions mongod.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    net:
    port: 27017
    bindIp: 0.0.0.0

    replication:
    oplogSizeMB: 36864
    replSetName: rs0
    12 changes: 12 additions & 0 deletions setup_mongodb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    echo '[mongodb-org-4.0]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc' > /etc/yum.repos.d/mongodb-org-4.0.repo

    yum install -y mongodb-org

    systemctl enable mongod

    systemctl start mongod