Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

Netkiller NoSQL 手札

MongoDB, Redis, CouchBase, Cassandra, Hypertable...

Mr. Neo Chan, 陈景峯(BG7NYT)



中国广东省深圳市望海路半岛城邦三期
518067
+86 13113668890


文档始创于2012-11-16
, $Date: 2013-04-25 16:24:49 +0800 (Thu, 25 Apr 2013) $

电子书最近一次更新于 2026-02-06 08:09:52

版权声明

转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

http://www.netkiller.cn
http://netkiller.github.io
http://netkiller.sourceforge.net
微信公众号: netkiller
微信:13113668890 请注明“读者”
QQ:13721218 请注明“读者”
QQ群:128659835 请注明“读者”
知乎专栏

2017-02-13


致读者

Netkiller 系列手札 已经被 Github 收录,并备份保存在北极地下250米深的代码库中,备份会保留1000年。

Preserving open source software for future generations

The world is powered by open source software. It is a hidden cornerstone of modern civilization, and the shared heritage of all humanity.

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain.

We are collaborating with the Bodleian Library in Oxford, the Bibliotheca Alexandrina in Egypt, and Stanford Libraries in California to store copies of 17,000 of GitHub’s most popular and most-depended-upon projects—open source’s “greatest hits”—in their archives, in museum-quality cases, to preserve them for future generations.

https://archiveprogram.github.com/arctic-vault/

目录

1. 自述
1.1. 写给读者
1.2. 作者简介
1.3. 如何获得文档
1.4. 打赏(Donations)
1.5. 联系方式
I. Redis
1. Redis 安装
1.1. Rocky Linux
1.2. CentOS 8 Stream
1.3. CentOS 7
1.4. CentOS 6
1.4.1. 主从同步
1.4.2. Sentinel
1.5. Ubuntu
1.6. Mac 安装 Redis
1.7. 源码编译安装
1.8. Test Redis
2. /etc/redis.conf
2.1. 备份配置文件
2.2. 绑定配置
2.3. 密码认证
2.4. maxmemory-policy TTL 过期策略配置
2.5. aclfile
3. redis-cli - Command-line client to redis-server
3.1. 命令参数
3.1.1. password
3.1.2. raw
3.2. --latency Enter a special mode continuously sampling latency.
3.3. 清空指定数据库
3.4. 用户认证
3.4.1. 传统 requirepass 认证
3.5. ACL 用户/密码认证
3.5.1. 查看用户列表
3.5.2. 用户删除
3.5.3. 设置默认密码
3.5.4. 创建用户
3.5.5. 查看 ACL 列表
3.5.6. 检验用户名和密码
3.6. MONITOR
3.7. info
3.8. save/bgsave/lastsave
3.9. config
3.10. keys
3.11. 字符串操作
3.11.1. set/get/del
3.11.2. setnx
3.12. expire/ttl
3.13. 获取 key 类型
3.14. LIST 数据类型
3.15. set 无序字符集合
3.15.1. 查看元素是否存在
3.16. zset (有序集合)
3.17. HASH
3.18. Pub/Sub 订阅与发布
3.19. flushdb 清空 Redis 数据
4. redis-benchmark 测试工具
5. Redis Cluster
6. Redis 通信协议
6.1. 切换DB
6.2. 监控
7. Redis 开发
7.1. 消息订阅与发布
7.2. 选择数据库
8. 工具
8.1. 导出 / 导入
8.2. phpRedisAdmin
8.3. A fast, light-weight proxy for memcached and redis
9. FAQ
9.1. 清空数据库
9.2. (error) MISCONF Redis is configured to save RDB snapshots
9.3. You can't write against a read only replica.
9.4. MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
9.5.
10. Valkey
II. MongoDB
11. Install 安装MongoDB
11.1. CentOS 8 Stream
11.2. MacOS 安装 MongoDB
11.3. 二进制tar包安装
11.4. Ubuntu MongoDB
11.5. CentOS 7 MongoDB
11.6. 从官网安装最新版本的 MongoDB 3.4
11.6.1. Server
11.6.2. Client
11.6.3. 工具
11.7. MongoDB + Hadoop
11.8. OSCM 一键安装 MongoDB 4.0.2
11.9. Replication
11.9.1. Master
11.9.2. Slave
11.9.3. 测试
11.10. Drivers
11.10.1. Using MongoDB in PHP
12. MongoDB 管理
12.1. Security and Authentication
12.1.1. 超级管理员
12.1.2. 数据库访问用户
12.1.3. 数据库监控用户
12.1.4. 删除用户
12.1.5. 更新角色
12.2. 4.0早期旧版本
13. 命令工具
13.1. mongo - MongoDB Shell
13.1.1. eval
13.1.2. help
13.1.3. 登陆认证
13.1.4. 管道操作
13.2. mongodump - Backup
13.2.1. 本地备份
13.2.2. 远程备份
13.3. mongorestore
13.3.1. 本地恢复
13.3.2. 远程恢复
13.3.3. filter
13.4. mongostat
13.5. mongotop
13.6. mongofiles - Browse and modify a GridFS filesystem.
13.6.1. list 浏览文件
13.6.2. put 上传文件
13.6.3. get 下载
13.6.4. delete 删除
14. MongoDB Shell
14.1. shutdownServer
14.2. show 查看命令
14.2.1. show dbs
14.2.2. show collections
14.2.3. show users
14.2.4. show profile
14.3. 切换数据库
14.4. Collection 管理
14.4.1. 创建 Collection
14.4.2. 删除 collection
14.4.3. 删除字段
14.5. save
14.6. insert
14.7. update
14.7.1. multi 更新所有数据
14.7.2. upsert 更新,如果不存在则插入数据
14.7.3. updateMany 更新集合中的所有数据
14.8. remove
14.8.1. 删除条件使用 _id
14.9. count()
14.10. 查询
14.10.1. find() MongoDB 2.x
14.10.2. find() MongoDB 3.x
14.10.3. group()
14.11. aggregate
14.11.1. project
14.11.2. groupby + sum
14.12. Indexes 索引
14.12.1. 查看索引
14.12.2. 创建索引
14.12.3. 删除索引
14.12.4. 唯一索引
14.12.5. 复合索引
14.12.6. 稀疏索引
14.13. Map-Reduce
14.13.1. 使用 Map-Reduce 统计Web 服务器 access.log 日志文件
14.14. 内嵌对象
14.14.1. Array / List 列表类型
14.15. Javascript 脚本
15. Mongo Admin UI
15.1. RockMongo
15.2. MongoVUE
16. Cassandra
16.1. Getting Started
16.1.1. Downloading and Installation
16.1.2. Running Cassandra
16.1.3. cli tool
16.1.4. Testing Cassandra
16.2. Configure Cassandra
16.2.1. Envionment variables
16.2.2. log4j.properties
16.2.3. storage-conf.xml
16.3. Keyspace
16.3.1. Schema
16.3.2. Keyspace example
16.4. Cluster
16.4.1. Running a cluster
16.4.2. Running a single node
16.4.3. nodetool
17. Hypertable
17.1. Hypertable 安装
17.1.1. Hypertable standalone 单机安装
17.1.2. Hypertable on HDFS(hadoop) 安装
17.1.3. MapR
17.1.4. Ceph
17.1.5. 检验安装
17.2. Code examples
17.2.1. PHP
17.3. HQL
17.3.1. namespace 命名空间管理
17.3.2. Table 表
17.4. FAQ
17.4.1. 切换 DFS Broker
18. CouchBase
18.1. 安装 CouchBase
18.1.1. Getting Started with Couchbase on PHP
18.2. couchbase 命令
18.2.1. couchbase-cli
19. Memcached
19.1. 安装 Memcached
19.1.1. CentOS 下编译
19.1.2. Ubuntu 下编译安装
19.1.3. debian/ubuntu
19.1.4. yum install
19.2. Memcached 代理
19.2.1. moxi
19.2.2. memagent
20. RethinkDB
21. TokyoCabinet/Tyrant
22. Flare
23. Voldemort
24. LevelDB
25. HyperDex
26. LeoFS

范例清单

11.1. MongoDB Test
11.2. Using MongoDB in PHP
16.1. Twitter
16.2. Twissandra
19.1. /etc/init.d/memcached