ERROR 1114: The table ‘big_table_a’ is full

在新闻组上看到的关于mysql cluster的问题:

[@more@]

At us is 1 MGM node and 4 DB nodes! 
Each of 5 computers have 1Gb operative memory! 
We have created 3 SQL a file (everyone on 900Mb) 
each of which has consisted of 10 000 000 lines 

insert into big_table_a set a1='213123', a2='123123', a3='213124', 
a4='234234';
insert into big_table_a set a1='213123', a2='978433', a3='234234', 
a4='2535623';
............................

Through API node we have started this SQL a script with the help of a 
command 

source data1.sql;
source data2.sql;
source data3.sql;

When in a database already has entered the name more than 
14 000 000 lines MySQL Cluster has given out the following mistake: 

ERROR 1114: The table 'big_table_a' is full

回复:

If your big_table has a primary key it will be using up your index_memory in
a short time.
Also, you may want to disconnect/reconnect while inserting all the data.
To understand what your memory is used for you should read:
http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_DB_Definition.html
(datamemory and index memory part). 

Generally 1gig of memory is not a lot. I have the same setup but with 2gigs
of ram in each machine and I have experienced the same problems.

What datatypes are the columns in your table?
You can calculate the amount of memory that your table takes up and find out
if you have enough space.

升级到php5的日记 一

终于要从php4升级到php5了,是的,俺费尽了口舌,说服了boss使用php5和mysqli开发新项目.

首先俺细细的阅读了官方站点上介绍php5的有关章节,以及网络上的一些关于php5的文章.基本开发环境定为linux+apache2+php5+mysql4.1,很经典的搭配.为了提高开发效率,俺决定继续使用pear的类库和prado,因此现状是php4,php5的代码将并存.第一周俺们就遇到了麻烦:

1.mysqli和zend1的兼容性
php.ini里面有一个选项,可以开启对zend1的兼容性,如果你在打开这个开关的同时还想使用mysqli的话,很快就会失望.它会无情的告诉你:
unable clone a uncloneable object…………………

2.使用prado和php5的一些问题
prado程序包prado.php的有段代码如下:
set_error_handler( …….. );
php5的配置默认是不提示E_STRICT级别的错误,要命的是,这行代码对任何错误都会die(………………..),pear的代码完全没办法工作,只好咔嚓之

使用Pear::Pager类的一个问题

今天把公司的服务器从php4升级到php5,问题来了.最严重的是使用Pear::Pager类,报错如下:
Fatal error: Cannot re-assign $this in D:xampphtdocstmptest.php on line 5

看了下Pager类的构造,有如下代码:
$this = ……………..;

看来从php5开始不再支持这种对自身重新实例化的写法了,只好重写了Pager类草草收场

[@more@]

mysql cluster安装笔记

经过两天的配置安装翻阅文档,终于成功的配置了两台装有mysql的机器为cluster,总结要点如下:

1.db节点不需要启动mgm服务
2.db节点的my.cnf需要额外加上ndb-connectstring参数,指向mgm服务器
3.可以用mgm服务器的ndb_mgm程序观察各节点的状态,方法: echo show | /usr/local/mysql/bin/ndb_mgm
4.config.ini的NoOfReplicas参数指明了每个db组的节点数,如果设置为2,则每组的db节点数为2,mgm服务器自动顺序分配组
5.每个db组至少要有一个db节点连通,否则整个cluster会停机
6.db节点启动ndbd时候,要指定connect-string到mgm服务器
7.db节点的启动步骤: a.启动ndbd b.启动mysql服务
8.mgm节点的启动步骤: a.启动ndb_mgmd b:启动ndbd c:启动mysql服务
9.建表时需要指明engine=ndbcluster,才会利用cluster功能储存;普通的建表方式仍然支持.

这里是之前看的安装步骤,但是有些错误的说

[@more@]

使用action script viewer 4反编译swf文件

步骤如下:

1.用asv打开.swf文件

2.选择export rebuild data (jsfl)

3.到导出目录用flash mx 2004新建一个fla文件,将所有的.swf,.mp3…导入到库,完成后另存为rebuild.fla

4.双击rebuild.jsfl进行反编译

5.保存,收工

[@more@]

大文件上传且带进度条的php解决方案

以下是用Pear::HTML_Progress实现大文件上传的例子

  • HTTP 1 – Upload files with your web browser to a web server. Single page (using frames).
  • HTTP 2 – Upload files with your web browser to a web server. Progress meter in a popup.
  • HTTP 3 – Mixed field Upload. Single page (using frames).
  • HTTP 4 – Upload files with your web browser to a web server and logs operations into a file.
  • FTP – Upload file on a remote ftp server that may be different than webserver.

    更多的HTML_Progress教程看这里:
    http://pear.laurent-laville.org/HTML_Progress/examples/

  • [@more@]

    php代码美化程序PHP_Beautifier试用手记

    在pear的rss列表上看到了PHP_Beautifier 0.1.1 beta发布,便下载回来试用:
    >>pear install PHP_Beautifier
    ………………………………………..

    顺利完成,看了下帮助,还带有命令行工具,方便:

    D:xamppphp>php_beautifier –help

    Usage: php_beautifier [options]
    and/or can be ‘-‘, which means stdin/stdout.
    you can use ? and * for batch processing
    can be a dir (ending with ‘/’ or a real dir)
    or a file (without ‘/’)
    multiple ins and one out = merge all files in one output
    Options:
    –input or -f input file – default: stdin
    –output or -o output dir or file – default: stdout
    –indent_tabs or -t indent with tabs
    –indent_spaces or -s indent with spaces – default
    –filters or -l Add filter(s)
    –directory_filters or -d Include dirs for filters
    –compress or -c Compress output
    –recursive or -r Search in subdir recursively
    –help or -? display help/usage (this message)

    Filter definition:
    –filters "Filter1(setting1=value1,setting2=’value2′) Filter2()"

    不过试用下来,处理的不是太完美,比如复杂点php代码美化后不整齐之类的,期待更好的版本出现 [@more@]

    好久没玩flash

    抓紧时间操练了一把,用下面代码作了一个粉简单的坦克控制:)

    [actionscript]
    class Move extends MovieClip {

    private var speed = 3;
    private var xMin = 0;
    private var yMin = 0;
    private var xMax = 400;
    private var yMax = 400;

    public function onLoad(){
    Key.addListener(this);
    this.xMin += this._width/2;
    this.xMax -= this._width/2;
    this.yMin += this._height/2;
    this.yMax -= this._height/2;
    }

    public function onEnterFrame(){
    if( this._x < this.xMin ){ this._x = this.xMin; } if( this._x > this.xMax ){
    this._x = this.xMax;
    }
    if( this._y < this.yMin ){ this._y = this.yMin; } if( this._y > this.yMax ){
    this._y = this.yMax;
    }
    }

    public function setSpeed(speed:Number){
    this.speed = speed;
    }

    public function onKeyDown(){
    switch(Key.getCode()){
    case 83: // s
    this._rotation = 180;
    this._y += this.speed;
    break;

    case 65: // a
    this._rotation = -90;
    this._x -= this.speed;
    break;

    case 68: // d
    this._rotation = 90;
    this._x += this.speed;
    break;

    case 87: // w
    this._rotation = 0;
    this._y -= this.speed;
    }
    }

    private function onRelease(){
    trace(’test’);
    }
    }

    [/actionscript]