当前位置:网站首页>Mongodb源码部署以及配置
Mongodb源码部署以及配置
2022-07-25 13:57:00 【人形bug制造机9527】
#!/bin/sh
. /etc/profile
mongod --config /usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/etc/mongodb.conf
关闭
#!/bin/sh
. /etc/profile
mongod --shutdown --dbpath /usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/data/
重启
#!/bin/sh
. /etc/profile
mongod --shutdown --dbpath /usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/data/
sleep 5
mongod --config /usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/etc/mongodb.conf
mongo.service
[Unit]
Description=mongodb
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart=/usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/bin/start.sh
ExecReload=/usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/bin/restart.sh
ExecStop=/usr/local/mongodb/mongodb-linux-x86_64-ubuntu2004-5.0.9/bin/shutdown.sh
PrivateTmp=true
[Install]
WantedBy=multi-user.target
将mongo.service移动到systemclt的目录下
执行systemctl daemon-reload刷新文件systemctl start mongo.service启动mongosystemctl stop mongo.service停止mongosystemctl restart mongo.service重启mongosystemctl enable mongo.service开启开机自启systemctl disable mongo.service关闭开机自启systemctl statusmongo.service查看状态
边栏推荐
- How to refactor embedded code?
- Error of Tencent cloud [100007] this env is not enable anonymous login
- Experiment the Arduino code of NTP network timing alarm clock with esp32+tm1638
- [force buckle] 645. Wrong set
- Advantages of wireless relay acquisition instrument and wireless network for engineering monitoring
- sieve of eratosthenes
- 2022年下半年软考初级程序员备考
- 【力扣】1030.距离顺序排列矩阵单元格
- Gym installation, invocation and registration
- 刷题-洛谷-P1059 明明的随机数
猜你喜欢

【力扣】645.错误的集合

Canal realizes MySQL data synchronization

音视频技术开发周刊 | 255
Congestion control of TCP

Emergency science | put away this summer safety guide and let children spend the summer vacation safely!

飞盘局有多快乐?2022年轻人新潮运动报告

Applet H5 get mobile number scheme

It is predicted that 2021 will accelerate the achievement of super automation beyond RPA

G027-op-ins-rhel-04 RedHat openstack creates a customized qcow2 format image

Dr. Berkeley's "machine learning engineering" big truth; AI vice president '2022 ml job market' analysis; Large list of semiconductor start-ups; Large scale video face attribute data set; Cutting edge
随机推荐
应急科普|收好这份暑期安全指南,让孩子安全过暑假!
NoSQL, relational database, row and column database comparison and analogy
「数字安全」警惕 NFT的七大骗局
Data analysis business core
刷题-洛谷-P1161 开灯
Construction and practice of yolov7 in hands-on teaching
Numpy quick start
MySQL 01: Source command
Applet enterprise red envelope function
Internal error of LabVIEW
[force deduction] 1030. Arrange matrix cells in distance order
【力扣】1030.距离顺序排列矩阵单元格
Talk about your understanding of hashcode and equals methods?
Preparing for the soft test for junior programmers in the second half of 2022
IM系统-消息流化一些常见问题
It is predicted that 2021 will accelerate the achievement of super automation beyond RPA
Write an esp32 Watchdog with Arduino
Audio and video technology development weekly | 255
Three ways of redis cluster
飞沃科技IPO过会:年营收11.3亿 湖南文旅与沅澧投资是股东