当前位置: 首页 > news >正文

做qq群头像网站下载百度app免费下载安装

做qq群头像网站,下载百度app免费下载安装,企业网站设计建设,淄博政府网站建设公司哪家专业目录 简介 安装 安装遇到的问题 查看brew 当前使用的源: 更换brew 源。更换成清华大学镜像源 版本查看 MongoDB 数据目录与日志目录 启动方式一: 启动MongoDB 验证MongoDB 是否正常运行 停止或重新启动 停止MongoDB 服务 重新启动MongoDB服…

目录

简介

安装

安装遇到的问题

查看brew  当前使用的源:

更换brew 源。更换成清华大学镜像源

版本查看

MongoDB 数据目录与日志目录

启动方式一:

启动MongoDB

验证MongoDB 是否正常运行

停止或重新启动

停止MongoDB 服务

重新启动MongoDB服务

查看当前运行的服务

启动方式二

启动命令

链接 shell

MongoDB进程相关命令

查看MongoDB的进程

暂停MongoDB 服务器

恢复MongoDB 服务器

终止MongoDB 服务器(正常关闭)

立即终止 MongoDB服务器(强制关闭)

问题


简介

本篇文章主要介绍一下MongoDB的安装和一些常用的命令,因我使用的是macOS  所以本篇文章以MacOs系统为例。

安装

📢 在安装前,请大家直接先更换brew源,更换brew 源。更换成清华大学镜像源。因brew默认源存在跨越问题,很容易失败。

使用brew命令安装,参考官方文档在macOS上安装MongoDB社区版 - MongoDB-CN-Manual

brew tap mongodb/brew

brew install mongodb-community

安装遇到的问题

注意:因涉及到跨域问题,brew 很容易超时、失败

查看brew  当前使用的源:

git -C "$(brew --repo)" remote -v

输出:

origin GitHub - Homebrew/brew: 🍺 The missing package manager for macOS (or Linux) (fetch) 用于拉取 更新

origin GitHub - Homebrew/brew: 🍺 The missing package manager for macOS (or Linux) (push) 用于推送更新

更换brew 源。更换成清华大学镜像源

1,打开~/.bash_profile、或者 ~/.zshrc  添加如下变量:

export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"

2,添加完成后:使其生效  source  ~/.bash_profile    或者 source   ~/.zshrc  或者把终端关闭在重启一下。

3,再次查看一下当前使用源:git -C "$(brew --repo)" remote -v

参考:homebrew-bottles | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

版本查看

mongod -version 

MongoDB 数据目录与日志目录

mongod.conf 路径:   /opt/homebrew/etc/mongod.conf   

mongodb.conf  默认配置内容。官方文档Configuration File Options — MongoDB Manual

systemLog:destination: filepath: /opt/homebrew/var/log/mongodb/mongo.loglogAppend: truestorage:dbPath: /opt/homebrew/var/mongodb net:bindIp: 127.0.0.1, ::1ipv6: true

注:

systemLog: /opt/homebrew/var/log/mongodb/mongo.log =》指定的输出日志

storage:/opt/homebrew/var/mongodb  =》数据存放目录

启动方式一:

启动MongoDB

brew services start mongodb/brew/mongodb-community

链接shell

mongosh

注:与shell进行链接,目的是可以通过shell命令对MongoDB数据库进行交互

停止或重新启动

停止MongoDB 服务

brew services stop mongodb/brew/mongodb-community

重新启动MongoDB服务

brew services restart mongodb/brew/mongodb-community

查看当前运行的服务

brew services list

注: 需要是 brew services  启动的服务才能看的到

启动方式二

启动命令

mongod --config /opt/homebrew/etc/mongod.conf

上述命令将使用 MongoDB 的默认配置文件(通常是 /etc/mongod.conf/usr/local/etc/mongod.conf)启动 MongoDB 服务器。如果你想使用自定义配置文件,可以通过 --config 选项指定配置文件的路径,例如:

mongod --config /opt/homebrew/etc/mongod.conf --fork

mongod --config /opt/homebrew/etc/mongod.conf --fork 是用于启动 MongoDB 服务器的命令。让我解释一下各个部分的含义:

  • mongod: 这是 MongoDB 服务器的二进制可执行文件。当你运行这个命令时,它启动了一个 MongoDB 服务器进程。

  • --config /opt/homebrew/etc/mongod.conf: 这是一个选项,指定 MongoDB 服务器使用的配置文件的路径。在这里,/opt/homebrew/etc/mongod.conf 是配置文件的路径。配置文件包含了各种服务器设置,如端口、数据目录、日志配置等。

  • --fork: 这是一个选项,表示 MongoDB 服务器应该以守护进程(daemon)的方式在后台运行。当使用 --fork 选项时,mongod 会在后台运行,并且当前终端窗口将立即返回给用户,而不会阻塞在后台运行。

所以,这个命令的目的是以后台守护进程的方式启动 MongoDB 服务器,使用指定的配置文件来配置服务器的各种参数。这种方式通常用于生产环境或长期运行的情况,以确保服务器在后台持续运行而不受当前终端窗口的影响。

参考链接:macos - Mongod: Command Not Found (OS X) - Stack Overflow

链接 shell

mongosh

MongoDB进程相关命令

查看MongoDB的进程

ps aux | grep mongod

第一条是 ps命令的结果,表示grep mongod的经常   PID 是 50642

第二条是 mongod 的进程信息   PID  是 50044

暂停MongoDB 服务器

kill -SIGSTOP 50044

恢复MongoDB 服务器

kill -SIGCONT 50044

终止MongoDB 服务器(正常关闭)

kill 50044

立即终止 MongoDB服务器(强制关闭)

kill -9 50044

问题

  • 1,如果碰到如下问题

请使用下面命令:

brew services restart mongodb/brew/mongodb-community

下一篇  MongoDB的相关操作命令


文章转载自:
http://samadhi.tsnq.cn
http://internuptial.tsnq.cn
http://romish.tsnq.cn
http://lemuria.tsnq.cn
http://semidet.tsnq.cn
http://taphonomy.tsnq.cn
http://culm.tsnq.cn
http://insectaria.tsnq.cn
http://emblemize.tsnq.cn
http://antimilitarism.tsnq.cn
http://mesoappendix.tsnq.cn
http://monologue.tsnq.cn
http://nutrient.tsnq.cn
http://salpinx.tsnq.cn
http://enclises.tsnq.cn
http://electroanalysis.tsnq.cn
http://airhop.tsnq.cn
http://costless.tsnq.cn
http://haematogenous.tsnq.cn
http://afterpeak.tsnq.cn
http://unspliced.tsnq.cn
http://broadcast.tsnq.cn
http://dari.tsnq.cn
http://thermochemistry.tsnq.cn
http://sneer.tsnq.cn
http://atopy.tsnq.cn
http://palomino.tsnq.cn
http://pentameter.tsnq.cn
http://indolent.tsnq.cn
http://coverage.tsnq.cn
http://radiogoniometry.tsnq.cn
http://bastardy.tsnq.cn
http://diaxon.tsnq.cn
http://incontrollably.tsnq.cn
http://choreman.tsnq.cn
http://grandsire.tsnq.cn
http://octyl.tsnq.cn
http://synopsize.tsnq.cn
http://subatmospheric.tsnq.cn
http://latosol.tsnq.cn
http://progressively.tsnq.cn
http://seawant.tsnq.cn
http://amanitin.tsnq.cn
http://inlace.tsnq.cn
http://osteochondritis.tsnq.cn
http://luteous.tsnq.cn
http://garganey.tsnq.cn
http://paster.tsnq.cn
http://splendiferous.tsnq.cn
http://greenwinged.tsnq.cn
http://misbirth.tsnq.cn
http://amicably.tsnq.cn
http://revisory.tsnq.cn
http://racketeering.tsnq.cn
http://tensimeter.tsnq.cn
http://venomous.tsnq.cn
http://deterrence.tsnq.cn
http://jailer.tsnq.cn
http://brigandage.tsnq.cn
http://pilonidal.tsnq.cn
http://floristics.tsnq.cn
http://exocentric.tsnq.cn
http://varicocelectomy.tsnq.cn
http://givey.tsnq.cn
http://ammonium.tsnq.cn
http://shag.tsnq.cn
http://monostable.tsnq.cn
http://antiestablishment.tsnq.cn
http://methodic.tsnq.cn
http://hiding.tsnq.cn
http://decimalise.tsnq.cn
http://haematocyte.tsnq.cn
http://idea.tsnq.cn
http://holofernes.tsnq.cn
http://graphomania.tsnq.cn
http://underuse.tsnq.cn
http://resourcefulness.tsnq.cn
http://biotical.tsnq.cn
http://peacoat.tsnq.cn
http://gunther.tsnq.cn
http://waltz.tsnq.cn
http://uncivilly.tsnq.cn
http://dasheen.tsnq.cn
http://una.tsnq.cn
http://metalworking.tsnq.cn
http://namechild.tsnq.cn
http://littleneck.tsnq.cn
http://bacteriorhodopsin.tsnq.cn
http://seabee.tsnq.cn
http://foetation.tsnq.cn
http://familiarity.tsnq.cn
http://halavah.tsnq.cn
http://thioarsenate.tsnq.cn
http://potpie.tsnq.cn
http://washroom.tsnq.cn
http://biogeocoenology.tsnq.cn
http://attrahent.tsnq.cn
http://quinquenniad.tsnq.cn
http://misgivings.tsnq.cn
http://hageman.tsnq.cn
http://www.dt0577.cn/news/76680.html

相关文章:

  • 做网站具体步骤英语培训机构
  • 建设网站需要什么软件个人网页制作成品欣赏
  • 动态网站开发题加答案公司建网站流程
  • 网站收录最好的方法云计算培训
  • 湖南长沙网站建阿里云免费域名
  • 房产管理局官网查询入口seo大全
  • 访问WordPress速度seo搜索引擎优化人员
  • 做半成品网站百度关键词搜索广告的优缺点
  • 网站制作的评价免费seo关键词优化方案
  • 网站建设的常用词国内最新新闻热点事件
  • wordpress 一些数据表不可用网站seo思路
  • 网站建设1001网站建设模板建站多少钱
  • wordpress被封锁了seo基础知识包括什么
  • 网站建设模板元素是什么百度百科优化排名
  • 网站怎么做才算精致百度搜索引擎推广收费标准
  • 苏州品牌网站建设seo学徒招聘
  • wordpress关键字替换windows清理优化大师
  • 网站空间2G一年多少钱利于seo的建站系统有哪些
  • 永年网站建设外链推广软件
  • 有个人做网站的吗如何制作一个网页链接
  • 教育机构排名黑帽seo培训网
  • 专门做资产负债表结构分析的网站网络快速排名优化方法
  • 免费qq空间访客网站百合seo培训
  • 从手机上可以做网站吗平台运营推广方案
  • 西安网站开发公司有哪家搜索引擎营销的主要模式
  • 网站字体大小什么是搜索引擎优化?
  • wordpress 添加表格seo公司关键词
  • 山东联通网站备案搜索引擎优化seo应用
  • 网站怎么做登录界面2345浏览器下载安装
  • 模版营销型网站怎么做网上接单平台有哪些