[תÔØ]ÔÚMongoDBµÄshellÖÐÏÔʾ·þÎñÆ÷µ±Ç°IP
ÔÎĵØÖ·£ºhttp://zhangshenjia.com/it/mongo-shell-ip/
²»¾ÃÇ°·¢ÉúÒ»ÆðÑÏÖصÄʹʣ¬ÎóɾÁËÉú²úMongoDB·þÎñÆ÷ÉϵÄÒ»¸öcollection£¬ÓÉÓÚûÓж¨Ê±±¸·Ý£¬µ¼Ö¼¸ÌìµÄÊý¾Ý¶ªÊ§¡£ÈÏÕæ·´Ê¡Ö®ºó£¬Ð´ÏÂÕâƪÎÄÕ£¬Ï£ÍûÄܸø´ó¼ÒһЩ¾¯Ê¾¡£
¹ý³Ì
µ±Ê±ÎÒÕýË«¿ªÁ½¸öÖն˴°¿Ú£¬·Ö±ðÓÃmongoÁ¬½Ó¿ª·¢»·¾³ºÍÉú²ú»·¾³µÄMongoDB¡£ÓÉÓÚ±¾µØµÄÊý¾Ý¿âÒòΪ²»¶ÏµÄ¿ª·¢²âÊÔÒѾ±»ÎÛȾÁË£¬ÎÒ´ÓÉú²ú»·¾³dumpÁË×îеÄÊý¾Ý²¢ÏÂÔص½±¾µØ¡£½ÓÏÂÀ´Òª×öµÄÊǰѱ¾µØMongoDBÖеĶÔÓ¦collection¸ødropµô£¬È»ºórestore»ØÈ¥¡£
ÕâʱÎÒ²»ÖªµÀ±»Ê²Ã´ÊÂÇé´ò¶ÏÁË£¬µ±ÎÒ¼ÌÐøÕâ¸ö¹ý³Ìʱ£¬ÓÉÓÚMongo ShellÖÐûÓÐÏñRedisÄÇÑùÏÔʾ·þÎñÆ÷µÄIP£¬ÎÒ²¢Ã»ÓÐ×¢Òâµ½×Ô¼ºµã¿ªµÄÊÇÉú²ú·þÎñÆ÷µÄÖնˣ¬²¢Ö´ÐÐÁËdropÃüÁî¡¡
·´Ê¡
1¡¢ÔÚ¶ÔÉú²úÊý¾Ý¿â×öɾ³ýÖ®ÀàµÄΣÏÕ²Ù×÷ʱ£¬Ò»¶¨ÒªÁ½¸öÈËdouble check£»
2¡¢Ã÷È·Çø·ÖÉú²ú»·¾³ºÍ¿ª·¢»·¾³£¬ÔÚÖ´Ðи÷ÖÖɾ³ý²Ù×÷Ç°¶ÔËùÔڵĻ·¾³½øÐÐÈ·ÈÏ£»
3¡¢ÔÚÖ´ÐÐÖØÒª²Ù×÷ʱ£¬²»½ÓÊÜÆäËûÊÂÎñµÄ´ò¶Ï£»
´ëÊ©
ÔÚÉú²ú»·¾³ºÍ¿ª·¢»·¾³¶¼½¨Á¢Ò»¸ö~/.mongorc.jsÎļþ£¬ÄÚÈÝÈçÏ£º
var prompt = function ( ) { var host = db.getMongo().toString().replace( 'connection to ', '' ); var database = db.getName(); return host + '/' + database + '> '; }
È»ºóÁ¬½Óµ½Mongo Shellʱ¾Í»áÏÔʾ·þÎñÆ÷IPÁË£¬È磺
[zhangshenjia@mac: ~]$mongo MongoDB shell version: 2.4.4 connecting to: test 127.0.0.1/test>
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ