包含标签 mongodb articles

Crawl a website with scrapy

Introduction In this article, we are going to see how to scrape information from a website, in particular, from all pages with a common URL pattern. We will see how to do that with Scrapy, a very powerful, and yet simple, scraping and web-crawling framework. For example, you might be interested in scraping information about each article of a blog, and store it information in a database. To achieve such a thing, we will see how to implement a simple spider using Scrapy, which will crawl the blog and store the extracted data into a MongoDB database. We will consider that you have a working MongoDB server, and that you have installed thepymongoandscrapypython packages, both installable with pip. If you have never toyed around with Scrapy, you should first read this short tutorial. First step, identify the URL pattern(s) In……

Continue reading

PHP添加MongoDB扩展

由于要使用mikoomi mongodb plugin插件,所以需要php对mongodb的扩展支持,默认通过源安装的php并没有mongodb的扩展支持,具体可以通过php -m|grep mongo 验证 。这里就结合phpize提供的动态扩展功能进行mongodb的扩展。 一、php mongo模块的编译 先从 http://pecl.php.net/package/mongo 下载目前的……

Continue reading

mongodb备份与恢复

mongodb是目前最流行的nosql数据库,其自身也提供了备份与恢复命令 。具体程序为mongodump和mongorestore 。 一、mongodump备份 mongodump的具体用法可以查看帮助: 1[root@web20 ~]# /App/mongodb/bin/mongodump -h 2ERROR: required parameter is missing in 'host' 3Export MongoDB data to BSON files. 4options: 5 --help produce help message 6 -v [ --verbose ] be more verbose (include multiple times for more 7 verbosity e.g. -vvvvv)……

Continue reading

mongodb的慢查询

在MySQL中,慢查询日志是经常作为我们优化数据库的依据,那在MongoDB中是否有类似的功能呢?答案是肯定的,那就是Mongo Database Profiler.不仅有,而且还有一些比MySQL的Slow Query Log更详细的信息。它就是我们这篇文章的主题。 开启 Profiling 功能 有两种方式可以控制 Profiling 的开关和级别……

Continue reading

mongodb强制一个成员为主

公司有一部分安全性要求不是十分高的数据使用的mongodb,其查询和插入性能确实较ACID理论的数据库来说要好的多。不过数据安全性上确实不如ACID型。为了补冲这点不足,做了replica sets(复制)。但由于操作时,没有进行优先级设置。所以想将某台性能略好的机器设置为主。 最早……

Continue reading

mongo内存管理

但凡初次接触MongoDB的人,无不惊讶于它对内存的贪得无厌,至于个中缘由,我先讲讲Linux是如何管理内存的,再说说MongoDB是如何使用内存的,答案自然就清楚了。 据说带着问题学习更有效,那就先看一个MongoDB服务器的top命令结果: 1shell> top -p $(pidof mongod) 2Mem: 32872124k total, 30065320k used, 2806804k free, 245020k buffers 3Swap: 2097144k total, 100k used,……

Continue reading

mongodb与mysql命令对比

传统的关系数据库一般由数据库(database)、表(table)、记录(record)三个层次概念组成,MongoDB是由数据库(database)、集合(collection)、文档对象(document) 三个层次组成。MongoDB对于关系型数据库里的表,但是集合中没有列、……

Continue reading

mongo与关系型数据库的使用对比

一、执行程序的区别 MySQL executable Oracle executable Mongo executable mysqld oracle mongod mysql sqlplus mongo 二、库、表、行、列等概念的区别 MySQL term Mongo term/concept database database table collection index index row BSON document column BSON field join embedding and linking primary key _id field group by aggregation 三、语句用法上的区别 SQL Statement Mongo Statement CREATE TABLE USERS (a Number, b Number) db.createCollection(“mycoll”) ALTER TABLE users ADD … implicit INSERT INTO USERS VALUES(3,5) db.users.insert({a:3,b:5}) SELECT a,b FROM users db.users.find({}, {a:1,b:1}) SELECT * FROM users db.users.find() SELECT * FROM users WHERE……

Continue reading

mongodb常用命令

一、用户操作命令: 1#增加或修改用户密码 2db.addUser('admin','pwd') 3#查看用户列表 4db.system.users.find() 5#用户认证 6db.auth('admin','pwd') 7#删除用户 8db.removeUser('mongodb') 9#查看所有用户 10show users 11#查看所有数据库 12show dbs 13#查看所有的collection 14show collections 15#查看各collection的状态 16db.printCollectionStats() 17#查看主从复制状态 18db.printReplicationInfo() 19#修复数据库 20db.repairDatabase() 21#设置记录profil……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI Alpine Android Anpic Ansible Apache Apm Apparmor Appfog Apr Apt-Get Aria2 Array Atlassian Atop Audit Awk AWS Awstats Axel Azure Backdoor Backup Bamboo Bash Bat Benchmark Bigdata Bin Bind Bitwise Blockchain BMC Book Bootstrap Brocade Bsd C1000 Cache Capistrano Catlog CDH5 Centos Centos7 Chatops Chattr Check_mk Checkinstall Cisco CL210 Clickhouse Cloud Cloud-Desktop Cmdb Cms Cobbler Collectd Comm Compress Confd Conver Corosync Cpu Crontab Crunchbang Css Curl C语言 Date DDOS Decode Dell Desktop Devops Df Dhcp Diff Diskpart DISTINCT Django DNS Docker Dos2unix Dpkg Drupal Duckdb EKS ELK Etcd Excel Fail2ban Fastcgi Fdisk Fiddler Find Firewalld Flask Flvtool Ftp Function Fuser GCP Geek Ghost Gin Git Github Gitlab Glances Glusterfs Go Godaddy Golang Google Gooupadd Grafana Graphviz Gravatra Grep Grub2 Hadoop Haproxy Hardware HBA HCIE Heartbeat Helm Hexdump Hhvm History Hotspot Html Http/Html/Web Http/Html/Web Httplogs Https HttpWatch Huawei Huaweicloud Hugo IBM Icmp Iconv Ifconfig IIS InfluxDB Ingress InnoDB Inotify Iopp IOS Ipmitool Iptables Iredmail Iscsi Isito It-News Java JavaScript Jdk Jenkins Jinja2 Jira Join Joomla K3s K8s Kdump Keepalived Kernel Kingate KVM Lamp Last Leetcode Lib Linux Linux高级篇 Ln Ls Lsi Lsof Lvm Lvs Mac Mail Man Mark Markdown Matplotlib Maven Memcached Microservice Mimikatz Mkdocs Mkpasswd Mmonit Mod_jk Mongodb Monit Monitor Mono Moodle Mosh Mount Mplayer Mpm Mrtg Mtr My.cnf Mysql Mysqlbinlog Mysqld_multi MySQLdb Mysqldump Mysqlhotcopy Nagios Nc Nethogs Netlify Nexus Nfs Nginx Nmon Nocatlog Node.js Nrpe Ntfs Ntop Ntp Obs Ocr Open-Falcon Openbox Opencv Openldap OpenResty Openssl Openstack Oracle Oswatch Paas Pacemaker Pam Pandas Parted Pcp Pcre Pdf Percona Perl Pexpect Pgrep Php Php-Fpm Ping Plsql Develope PM Postfix PostgreSQL Powershell Prettify Proc Prometheus Puppeteer Pushd Pwgen Pxe Pyecharts Python Python模块 QoS Radmin Raid Rdesktop Read Redhat Redis Redmine Regex Rh134 RH318 RH442 RHCA RHCE Rhel7 Rhel8 RHEV Rm Rman Rootkit Route Rpm Rpmforge Rrdtool RSA Rsync Rsyslog Safe Saltstack Samba Scapy Screen SecureCRT Sed Selenium Selinux Seo Seq Session Set Shc Sheepdog Shell Shopt Sitemap Skydns Smokeping Snffier Snmp Socket Soft Sort Spider Sql Sqlserver Squid SRE Ss Ssh Sshpass Statuscode Strace Strings Su SublimeText2 Sudo Suse Svn Sysbench Syslog-Ng Sysstat Systemd T Tar TC Tcpcopy Tcpdump Tech Telecom Telnet Tencentcloud Tengine Test Testlink Threads Time Tmux Tomcat Touch Tr Tsar Twisted Ubuntu Udev Ulimit Unix Unixbench User-Agent Useradd Varnish VBA Vbs Vercel Vi Vim Visudo Vmstat Vmware Vnc Voice Vpn Vscode Vsftp Vsftpd Vue Watchdog Web Webcam Webistrano Wget Wiki Windows Wol Wordpress Workshop Wsl X-Windows Xampp Xcache Xmllint Xtrabackup Yule Yum Zabbix Zeromq Zip Zonetime Zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta