第一部分 应用篇 -- 利用Tokyo Tyrant构建兼容Memcached协议、支持故障转移、高并发的分布式key-value持久存储系统
Tokyo Cabinet 是日本人 平林幹雄 开发的一款 DBM 数据库,该数据库读写非常快,哈希模式写入100万条数据只需0.643秒,读取100万条数据只需0.773秒,是 Berkeley DB 等 DBM 的几倍。
Tokyo Tyrant 是由同一作者开发的 Tokyo Cabinet 数据库网络接口。它拥有Memcached兼容协议,也可以通过HTTP协议进行数据交换。
Tokyo Tyrant 加上 Tokyo Cabinet,构成了一款支持高并发的分布式持久存储系统,对任何原有Memcached客户端来讲,可以将Tokyo Tyrant看成是一个Memcached,但是,它的数据是可以持久存储的。这一点,跟新浪的Memcachedb性质一样。
本日志由 flyinweb 于 2012-05-18 14:36:12 发表到 数据库技术 中,目前已经被浏览 32 次,评论 0 次;
作者添加了以下标签: TTserver,Tokyo Cabinet,Tokyo Tyrant;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
- create table test_table(c1 integer);
- insert into test_table(c1) values(12);
- update test_table set c1=0;
- delete test_table where 1=1;
- drop table test_table;
- create table test_table(c1 integer);
- insert into test_table(c2) values(12);
- insert into test_table(c1) values(12);
- update test_table set c1=0;
- delete test_table where 1=1;
- drop table test_table;
本日志由 flyinweb 于 2012-04-13 14:37:25 发表到 数据库技术 中,目前已经被浏览 202 次,评论 0 次;
作者添加了以下标签: informix dbaccess;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
症状:
环境:Informix Dynamic Server 2000 Version 9.21.UC2
原来操作正常,进行查询时,出现如下错误:
243: Could not position within a table (informix.tablename)
111: ISAM error: no record found.
Error in line 6
Near character position 1
本日志由 flyinweb 于 2012-04-10 18:23:59 发表到 数据库技术 中,目前已经被浏览 278 次,评论 0 次;
作者添加了以下标签: err 243,Could not position within a table;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
Windows MySQL Backup Script
@ECHO OFF SET BACKUPS_DIR=Z:/mysqlbackup/ ECHO map network drive REM ============================ SET OLDDIR=%CD% REM The date in ISO format, to be appended to backup filenames. REM get a list of all databases hosted on the server FOR /F %%D IN (mysqldblist.tmp) DO ( DEL mysqldblist.tmp CD %OLDDIR% ECHO Disconnect the mapped drive :: AutoMySQLBackupForWindows Servers By Matt Moeller v.1.2 :: Follow us on twitter for updates to this script twitter.com/redolivedesign :: UPDATE 12.29.2011 Thanks to Kamil Tomas for catching and resolving the time bug ::If the time is less than two digits insert a zero so there is no space to break the filename set year=%DATE:~10,4% IF %day% LSS 10 SET day=0%day:~1,1% set backupdate=%year%-%day%-%mnt%-%hr%-%min% :: MySQl DB user :: MySQl DB users password :: Switch to the MySQL data directory and collect the folder names :: Loop through the folders and use the fnames for the sql filenames, collects all databases automatically this way echo "hello" echo "Pass each name to mysqldump.exe and output an individual .sql file for each" FOR /D %%F IN (*) DO ( echo "Zipping all files ending in .sql in the folder" "c:\MySQLBackups\zip\7za.exe" a -tzip "c:\MySQLBackups\backupfiles\FullBackup.%backupdate%.zip" "c:\MySQLBackups\backupfiles\*.sql" echo "Deleting all the files ending in .sql only" del "c:\MySQLBackups\backupfiles\*.sql" echo "Deleting zip files older than 30 days now" ::FOR THOSE WHO WISH TO FTP YOUR FILE UNCOMMENT THESE LINES AND UPDATE - Thanks Kamil for this addition! ::cd\[path to directory where your file is saved]
REM ============================
REM == SETTINGS ================
SET MYSQL_DIR=%PROGRAMFILES%\MySQL\MySQL Server 5.1\bin
SET USER="backup_user"
SET PASSWORD="backup_password"
SET SHAREPATH="\\192.168.148.9\14875"
SET NETUSER="netuser"
SET NETPWD="netpwd"
NET USE Z: %SHAREPATH% %NETPWD% /USER:%NETUSER%
CD %TEMP%
REM (Working from a UK formatted date)
REM SET TODAY=%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2%
SET TODAY=%date:~0,10%
"%MYSQL_DIR%\mysql" -u %USER% -p%PASSWORD% -B -s -e"show databases" > mysqldblist.tmp
ECHO Creating backup for database ''%%D''
"%MYSQL_DIR%\mysqldump" -u %USER% -p%PASSWORD% --default-character-set=utf8 --result-file="%BACKUPS_DIR%\%%D_%TODAY%.sql" "%%D"
)
NET USE Z: /DELETE
:: RED OLIVE DESIGN INC.
:: coming soon: email admin a synopsis of the backup with total file size(s) and time it took to execute
set day=%DATE:~7,2%
set mnt=%DATE:~4,2%
set hr=%TIME:~0,2%
set min=%TIME:~3,2%
IF %mnt% LSS 10 SET mnt=0%mnt:~1,1%
IF %hr% LSS 10 SET hr=0%hr:~1,1%
IF %min% LSS 10 SET min=0%min:~1,1%
set dbuser=root
set dbpass=123xyz
pushd "c:\MySQL\data"
"c:\MySQL\bin\mysqldump.exe" --user=%dbuser% --password=%dbpass% --databases %%F > "c:\MySQLBackups\backupfiles\%%F.%backupdate%.sql"
)
Forfiles -p c:\MySQLBackups\backupfiles\ -s -m *.* -d -30 -c "cmd /c del /q @path"
echo "All done, pretty slick eh"
::@echo off
::echo user [here comes your ftp username]>ftpup.dat
::echo [here comes ftp password]>>ftpup.dat
::echo [optional line; you can put "cd" command to navigate through the folders on the ftp server; eg. cd\folder1\folder2]>>ftpup.dat
::echo binary>>ftpup.dat
::echo put [file name comes here; eg. FullBackup.%backupdate%.zip]>>ftpup.dat
::echo quit>>ftpup.dat
::ftp -n -s:ftpup.dat [insert ftp server here; eg. myserver.com]
::del ftpup.dat
本日志由 flyinweb 于 2012-03-30 11:27:46 发表到 数据库技术 中,目前已经被浏览 203 次,评论 0 次;
作者添加了以下标签: MySQL Backup;
A basic installation contains at least 2 database servers and 1 monitoring server. In this guide, I used 5 servers with Debian Lenny (5.0)
| function | ip | hostname | server id |
|---|---|---|---|
| monitoring host | 192.168.0.10 | mon | - |
| master 1 | 192.168.0.11 | db1 | 1 |
| master 2 | 192.168.0.12 | db2 | 2 |
| slave 1 | 192.168.0.13 | db3 | 3 |
| slave 2 | 192.168.0.14 | db4 | 4 |
I used the following virtual IPs. They will be distributed across the hosts by MMM.
| ip | role | description |
|---|---|---|
| 192.168.0.100 | writer | Your application should connect to this IP for write queries. |
| 192.168.0.101 | reader | Your application should connect to one of these four IPs for read queries |
| 192.168.0.102 | reader | |
| 192.168.0.103 | reader | |
| 192.168.0.104 | reader |
本日志由 flyinweb 于 2012-01-31 16:19:48 发表到 数据库技术 中,目前已经被浏览 310 次,评论 0 次;
作者添加了以下标签: Multi-Master Replication Manager for MySQL,mysql-mmm;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
一、MMM简介:
MMM即Master-Master Replication Manager for MySQL(mysql主主复制管理器)关于mysql主主复制配置的监控、故障转移和管理的一套可伸缩的脚本套件(在任何时候只有一个节点可以被写入),这个套件也能对居于标准的主从配置的任意数量的从服务器进行读负载均衡,所以你可以用它来在一组居于复制的服务器启动虚拟ip,除此之外,它还有实现数据备份、节点之间重新同步功能的脚本。
MySQL本身没有提供replication failover的解决方案,通过MMM方案能实现服务器的故障转移,从而实现mysql的高可用。
MMM项目来自 Google:http://code.google.com/p/mysql-master-master
官方网站为:http://mysql-mmm.org
Mmm主要功能由下面三个脚本提供
lmmm_mond负责所有的监控工作的监控守护进程,决定节点的移除等等
lmmm_agentd运行在mysql服务器上的代理守护进程,通过简单远程服务集提供给监控节点
lmmm_control通过命令行管理mmm_mond进程
本日志由 flyinweb 于 2012-01-31 16:04:20 发表到 数据库技术 中,目前已经被浏览 412 次,评论 0 次;
作者添加了以下标签: mysql-mmm,Multi-Master Replication Manager for MySQL;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
Last month we released the Beta of VS 2010 Service Pack 1 (SP1). You can learn more about the VS 2010 SP1 Beta from Jason Zander’s twoblog posts about it, and from Scott Hanselman’s blog post that covers some of the new capabilities enabled with it. You can download and install the VS 2010 SP1 Beta here.
Last week I blogged about the new Visual Studio support for IIS Express that we are adding with VS 2010 SP1. In today’s post I’m going to talk about the new VS 2010 SP1 tooling support for SQL CE, and walkthrough some of the cool scenarios it enables.
本日志由 flyinweb 于 2012-01-04 11:24:14 发表到 数据库技术 中,目前已经被浏览 501 次,评论 0 次;
作者添加了以下标签: VS 2010 SP1,SQL CE,SQL Server Compact Edition;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
Often times the .SDF database is not running in the current directory so it becomes necessary to programatically set the path to the SDF file. This is an example (.net C#) on how to do this when the SDF file is located in the same directory as the executing application.
本日志由 flyinweb 于 2012-01-04 10:55:51 发表到 数据库技术 中,目前已经被浏览 366 次,评论 0 次;
作者添加了以下标签: SQL Server Compact Edition,Connection strings;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
而且直接配置文件是效率最高的,通过其它驱动效率都相对较低,BDB
这个测试不太准确,看官方的测试结果:http://bind-dlz.sourceforg
为什么使用BDB时QPS这么低? 我在bind版本基本相似的环境中测试的
It is quite useful and interesting too.
VIRT 的上限是64G,也就是36位, cat /proc/cpuinfo的结果是:addre
昨天要准备用线程重写webbench,试验了下Fedora Linux 2.6.35.14
不明白您的具体的意思是什么?
已经发送到你QQ邮箱