码迷,mamicode.com
首页 > 其他好文 > 详细

自己玩虚拟机上mongo备份

时间:2018-01-31 14:46:10      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:min   use   rap   director   web   pre   host   tty   nec   

 

rs.initiate({_id:"shard1RS",members:[{_id:1,host:"127.0.0.1:27018",priority:2},{_id:2,host:"127.0.0.1:37018"},{_id:3,host:"127.0.0.1:47018"}]})
rs.initiate({_id:"shard2RS",members:[{_id:1,host:"127.0.0.1:37019",priority:2},{_id:2,host:"127.0.0.1:27019"},{_id:3,host:"127.0.0.1:47019"}]})
rs.initiate({_id:"shard3RS",members:[{_id:1,host:"127.0.0.1:47010",priority:2},{_id:2,host:"127.0.0.1:27010"},{_id:3,host:"127.0.0.1:37010"}]})

rs.initiate({_id:"configRS",configsvr:true,members:[{_id:1,host:"127.0.0.1:27017",priority:2},{_id:2,host:"127.0.0.1:37017"},{_id:3,host:"127.0.0.1:47017"}]})

 

rs.status();

./mongod -f /home/jason/liuguanghui/mongo/shard/shard1.config

use admin
db.runCommand({"addShard":"shard1RS/127.0.0.1:27018" ,"maxsize":1024})
db.runCommand({"addShard":"shard2RS/127.0.0.1:37019" ,"maxsize":1024})
db.runCommand({"addShard":"shard3RS/127.0.0.1:47010" ,"maxsize":1024})


./mongos -configdb configRS/127.0.0.1:27017,127.0.0.1:37017,127.0.0.1:47017 -port 17018 -fork -logpath=/home/jason/liuguanghui/mongo2/router/logs/mongos.log
./mongos -configdb configRS/127.0.0.1:27017,127.0.0.1:37017,127.0.0.1:47017 -port 17018 -fork -logpath=/home/jason/liuguanghui/mongo2/router/logs/mongos.log

ps -ef|grep "./mongod -f /home/jason/liuguanghui/mongo"|grep -v grep|cut -c 9-15|xargs kill -9
ps -ef|grep "mongo"|grep -v grep|cut -c 9-15|xargs kill -9

sudo vi /opt/mongodb/mms/conf/conf-mms.properties
sudo service mongodb-mms start

 

ps -ef |grep mongo
jason 3153 1645 0 1月24 ? 00:05:29 ./mongod --config /home/jason/liuguanghui/mongo/config/mongo.config
jason 3381 1645 0 1月24 ? 00:05:31 ./mongod --config /home/jason/liuguanghui/mongo2/config/mongo.config
jason 3503 1645 0 1月24 ? 00:05:07 ./mongod --config /home/jason/liuguanghui/mongo3/config/mongo.config
root 9219 1645 0 13:48 ? 00:00:04 ./mongos -configdb configRS/127.0.0.1:27017,127.0.0.1:37017,127.0.0.1:47017 -port 17017 -fork -logpath=/home/jason/liuguanghui/mongo/router/logs/mongos.log
root 9262 1645 0 13:50 ? 00:00:04 ./mongos -configdb configRS/127.0.0.1:37017,127.0.0.1:27017,127.0.0.1:47017 -port 17018 -fork -logpath=/home/jason/liuguanghui/mongo2/router/logs/mongos.log
jason 9341 1645 0 13:53 ? 00:00:16 ./mongod -f /home/jason/liuguanghui/mongo/shard/shard1.config
jason 9433 1645 0 13:53 ? 00:00:17 ./mongod -f /home/jason/liuguanghui/mongo2/shard/shard1.config
jason 9525 1645 0 13:54 ? 00:00:20 ./mongod -f /home/jason/liuguanghui/mongo3/shard/shard1.config
jason 9619 1645 0 13:54 ? 00:00:15 ./mongod -f /home/jason/liuguanghui/mongo/shard/shard2.config
jason 9729 1645 0 13:54 ? 00:00:16 ./mongod -f /home/jason/liuguanghui/mongo/shard/shard3.config
jason 9826 1645 0 13:54 ? 00:00:16 ./mongod -f /home/jason/liuguanghui/mongo2/shard/shard2.config
jason 9939 1645 0 13:54 ? 00:00:16 ./mongod -f /home/jason/liuguanghui/mongo2/shard/shard3.config
jason 10071 1645 0 13:54 ? 00:00:14 ./mongod -f /home/jason/liuguanghui/mongo3/shard/shard2.config
jason 10191 1645 0 13:54 ? 00:00:15 ./mongod -f /home/jason/liuguanghui/mongo3/shard/shard3.config
mongodb+ 10939 1645 4 14:05 ? 00:01:35 /opt/mongodb/mms/jdk/bin/mms-app -d64 -Xss228k -Xmx4352m -Xms4352m -XX:NewSize=600m -Xmn1500m -XX:ReservedCodeCacheSize=128m -XX:-OmitStackTraceInFastThrow -Dxgen.webServerGzipEnabled=true -Duser.timezone=GMT -Dfile.encoding=UTF-8 -Dsun.net.client.defaultReadTimeout=20000 -Dsun.net.client.defaultConnectTimeout=10000 -Dorg.eclipse.jetty.util.UrlEncoding.charset=UTF-8 -Dorg.eclipse.jetty.server.Request.maxFormContentSize=4194304 -Dserver-env=hosted -Dapp-id=mms -Dbase-port=8080 -Dbase-ssl-port=8443 -Dapp-dir=/opt/mongodb/mms -Dxgen.webServerReuseAddress=true -Dmms.keyfile=/etc/mongodb-mms/gen.key -XX:SurvivorRatio=12 -XX:MaxTenuringThreshold=15 -XX:CMSInitiatingOccupancyFraction=62 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseBiasedLocking -XX:+CMSParallelRemarkEnabled -XX:-OmitStackTraceInFastThrow -classpath /opt/mongodb/mms/classes/mms.jar:/opt/mongodb/mms/agent:/opt/mongodb/mms/agent/backup:/opt/mongodb/mms/agent/monitoring:/opt/mongodb/mms/agent/automation:/opt/mongodb/mms/agent/biconnector:/opt/mongodb/mms/data/unit:/opt/mongodb/mms/conf/:/opt/mongodb/mms/lib/* -Dlog_path=/opt/mongodb/mms/logs/mms0 -Dinstance-id=0 -Dpid-filename=/opt/mongodb/mms/tmp/mms-0.pid com.xgen.svc.core.ServerMain
mongodb+ 13967 1645 2 14:21 ? 00:00:30 /opt/mongodb/mms/jdk/bin/mms-app -DMONGO.BIN.PREFIX= -Dserver-env=hosted -Dapp-id=bgrid -Dapp-dir=/opt/mongodb/mms -Dlog_path=/opt/mongodb/mms/logs/daemon -Dmms.extraPropFile=conf-mms.properties -DDAEMON.ROOT.DIRECTORY= -Dnum.workers= -DDAEMON.BASE.PORT=27500 -DDAEMON.QUERYABLE.FS.PORT=8087 -DDAEMON.QUERYABLE.BASE_PORT=27700 -DDAEMON.QUERYABLE.MAX_MOUNTS=20 -DDAEMON.MONGODB.RELEASE.DIR= -Dmms.keyfile=/etc/mongodb-mms/gen.key -Dpid-filename=/opt/mongodb/mms/tmp/bgrid-0.pid -classpath /opt/mongodb/mms/classes/mms.jar:/opt/mongodb/mms/conf/:/opt/mongodb/mms/lib/* com.xgen.svc.brs.grid.Daemon
jason 14266 2626 0 14:40 pts/4 00:00:00 grep --color=auto mongo

自己玩虚拟机上mongo备份

标签:min   use   rap   director   web   pre   host   tty   nec   

原文地址:https://www.cnblogs.com/liugh-wait/p/8391394.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!