0
点赞
收藏
分享

微信扫一扫

ios版本小于13.4.1的手机需要前端对其调整图片方向,上传拍照照片总是方向不对

骑在牛背上看书 03-12 16:30 阅读 3

参考官方手册:
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-community-with-docker/#std-label-docker-mongodb-community-install

使用脚本快速安装docker

curl -fsSL https://get.docker.com -o get-docker.sh | bash get-docker.sh

使用 Docker 安装 MongoDB 社区

mondb官方维护镜像:https://hub.docker.com/r/mongodb/mongodb-community-server

  1. 拉取镜像(可选择拉取指定镜像)

     docker pull mongodb/mongodb-community-server
    
  2. 运行容器

     docker run -d --name mongo -p 27017:27017  --restart=always -v /data/mondb:/data mongodb/mongodb-community-server:latest
    
  • -p 27017:27017 映射端口
  • –restart=always 重启策略
  • -v /data/mondb:/data 映射目录
  1. 检查容器是否正在运行

     docker container  ps
    
  2. 连接到 MongoDB 部署mongosh
    打开 的交互式容器实例mongo并使用 来连接到部署mongosh。

     docker exec -it mongo mongosh
    
    # docker exec -it mongo mongosh
    Current Mongosh Log ID: 65ee9ea0726e1c9459cddb7b
    Connecting to:          mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.1.5
    Using MongoDB:          7.0.6
    Using Mongosh:          2.1.5
    
    For mongosh info see: https://docs.mongodb.com/mongodb-shell/
    
    
    To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).
    You can opt-out by running the disableTelemetry() command.
    
    ------
       The server generated these startup warnings when booting
       2024-03-11T03:30:50.778+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
       2024-03-11T03:30:51.346+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
       2024-03-11T03:30:51.346+00:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
       2024-03-11T03:30:51.346+00:00: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. We suggest setting it to 'never'
       2024-03-11T03:30:51.346+00:00: vm.max_map_count is too low
    ------
    
    test>
    
  3. 验证您的部署
    要确认您的 MongoDB 实例正在运行,请运行以下Hello 命令:
    返回如下结果证明部署成功

    test> db.runCommand(
    ...    {
    ...       hello: 1
    ...    }
    ... )
    {
      isWritablePrimary: true,
      topologyVersion: {
        processId: ObjectId('65ee7aea7c46bbdf74b0b1c5'),
        counter: Long('0')
      },
      maxBsonObjectSize: 16777216,
      maxMessageSizeBytes: 48000000,
      maxWriteBatchSize: 100000,
      localTime: ISODate('2024-03-11T06:04:42.753Z'),
      logicalSessionTimeoutMinutes: 30,
      connectionId: 3,
      minWireVersion: 0,
      maxWireVersion: 21,
      readOnly: false,
      ok: 1
    }
    test> 
    

更多信息请参考官方文档

举报

相关推荐

0 条评论