轻量级持久存储系统 MemcacheDB 详细介绍(2)
Java代码
memcachedb 1.2 . 0
-p <num> TCP监听端口,默认是 21201
-U <num> UDP监听端口,默认是 0 ,也就是关闭。
-s <file> 使用socket通讯,参数是设置unix socket的路径,此通讯方式只能本地使用
-a <mask> unix socket文件的权限,默认是 0700
-l <ip_addr> 监听地址,默认是 INDRR_ANY
-d 以守护进程方式运行
-r maximize core file limit
-u <username> 以<username>启动,只有root才能使用,因为memcachedb不允许以root启动
-c <num> max simultaneous connections, default is 1024
-b <num> item size smaller than <num> will use fast memory alloc, default is 512B
-v 打印错误和警告信息
-vv 打印整个交互过程
-h print this help and exit
-i print license info
-P <file> 进程PID保存路径,只能在守护进程方式下使用
-t <num> 线程数,默认是4
--------------------BerkeleyDB Options-------------------------------
-m <num> in-memmory cache size of BerkeleyDB in megabytes, default is 64MB
-A <num> underlying page size in bytes, default is 4096 , (512B ~ 64KB, power-of-two)
-f <file> 数据文件名, 默认是 'data.db'
-H <dir> 数据保存目录,默认是 '/data1/memcachedb'
-B <db_type> 数据结构类型,有 'btree' 和 'hash' 两种. 默认是 'btree'
-L <num> log buffer size in kbytes, default is 32KB
-C <num> 每隔多少秒checkpoint, 设置为0 将实时写入硬盘, 默认是 5 分钟
-T <num> do memp_trickle every <num> seconds, 0 for disable, default is 30 seconds
-e <num> percent of the pages in the cache that should be clean, default is 60 %
-D <num> do deadlock detecting every <num> millisecond, 0 for disable, default is 100ms
-N 设置 DB_TXN_NOSYNC 标志来改善性能,但是牺牲事务的持久性。默认为 关闭
--------------------Replication Options-------------------------------
-R 主服务器提供同步数据的地址和端口,主从模式必须设置
-O 从服务器同步源地址和端口
-M/-S 以主或从服务器启动
-n 允许从服务器数量, 默认是2 台
-----------------------------------------------------------------------
memcachedb 1.2.0
-p <num> TCP监听端口,默认是 21201
-U <num> UDP监听端口,默认是 0,也就是关闭。
-s <file> 使用socket通讯,参数是设置unix socket的路径,此通讯方式只能本地使用
-a <mask> unix socket文件的权限,默认是 0700
-l <ip_addr> 监听地址,默认是 INDRR_ANY
-d 以守护进程方式运行
-r maximize core file limit
-u <username> 以<username>启动,只有root才能使用,因为memcachedb不允许以root启动
-c <num> max simultaneous connections, default is 1024
-b <num> item size smaller than <num> will use fast memory alloc, default is 512B
-v 打印错误和警告信息
-vv 打印整个交互过程
-h print this help and exit
-i print license info
-P <file> 进程PID保存路径,只能在守护进程方式下使用
-t <num> 线程数,默认是4
--------------------BerkeleyDB Options-------------------------------
-m <num> in-memmory cache size of BerkeleyDB in megabytes, default is 64MB
-A <num> underlying page size in bytes, default is 4096, (512B ~ 64KB, power-of-two)
-f <file> 数据文件名, 默认是 'data.db'
-H <dir> 数据保存目录,默认是 '/data1/memcachedb'
-B <db_type> 数据结构类型,有 'btree' 和 'hash'两种. 默认是 'btree'
-L <num> log buffer size in kbytes, default is 32KB
-C <num> 每隔多少秒checkpoint, 设置为0将实时写入硬盘, 默认是5分钟
-T <num> do memp_trickle every <num> seconds, 0 for disable, default is 30 seconds
-e <num> percent of the pages in the cache that should be clean, default is 60%
-D <num> do deadlock detecting every <num> millisecond, 0 for disable, default is 100ms
-N 设置 DB_TXN_NOSYNC 标志来改善性能,但是牺牲事务的持久性。默认为 关闭
--------------------Replication Options-------------------------------
-R 主服务器提供同步数据的地址和端口,主从模式必须设置
-O 从服务器同步源地址和端口
-M/-S 以主或从服务器启动
-n 允许从服务器数量, 默认是2台
-----------------------------------------------------------------------
关于-C和-N选项涉及到数据完整性,会在下面会说明一下
五、备份和恢复
1.热备份
因为memcachedb是基于bdb的,所以可以用bdb自带的热备份工具备份