<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 88, comments - 3, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    ssh-copy-id 避免ssh輸入密碼的用法:

    [root@hengtiandesk118 .ssh]# ssh-copy-id -i id_rsa.pub 10.1.186.51
    10
    Warning: Permanently added '
    10.1.186.51' (RSA) to the list of known hosts.
    root@
    10.1.186.51's password: 
    Now try logging into the machine
    , with "ssh '10.1.186.51'", and check in:

      .ssh/authorized_keys

    to make sure we haven't added extra keys that you weren't expecting.

    [root@hengtiandesk118 .ssh]# ssh 10.1.186.51
    Last login: Thu May 
    10 18:33:55 2012 from 10.5.4.201
    [root@xen186v01 ~]#

    這個腳本只要裝了openssh-clients就可以用了。

    以前都是手動復制粘貼的...

    posted @ 2012-05-11 09:58 Milo的海域 閱讀(332) | 評論 (0)編輯 收藏

    原來ssh可以這樣用

    1. remote file copy
    [root@xen74v01 ~]# cat test.pl
    #!/usr/bin/perl
    print 
    "eth0.74"=~/(\w+)/;
    print "\n";
    [root@xen74v01 ~]# cat test.pl | ssh 10.1.74.76 'cat - > /tmp/test.pl'

    拷貝文件時,如果文件很大,又不想影響網絡IO可以用pv工具進行流量控制
    pv -L10m test.pl | ssh 10.1.74.76 'cat - > /tmp/test.pl'
    這里pv的行為跟cat比較類似,但是支持IO流量控制,這里設置10M/s.

    2. local script remote execute
    [root@xen74v01 ~]# cat test.pl
    #!/usr/bin/perl
    print 
    "eth0.74"=~/(\w+)/;
    print "\n";
    [root@xen74v01 ~]# perl test.pl
    eth0
    [root@xen74v01 ~]# cat test.pl | ssh 10.1.74.76 'perl'
    eth0
    [root@xen74v01 ~]# ssh 10.1.74.76 'perl' < test.pl
    eth0

    這樣就不用把腳本拷貝到遠端去執行了

    參考:
    http://linux.icydog.net/ssh/piping.php
    http://www.ivarch.com/programs/quickref/pv.shtml
    http://www.mysqlperformanceblog.com/2009/05/20/hint-throttling-xtrabackup/

    posted @ 2012-05-09 17:13 Milo的海域 閱讀(3199) | 評論 (0)編輯 收藏

    1. Tutorial
    http://net-snmp.sourceforge.net/wiki/index.php/Tutorials

    2. Config & start agent
     snmpconf

    3. snmpwalk example
     snmpwalk -v2c -c public 10.1.74.51

    4. check MIB modules
     snmptranslate -Dinit_mib .1.3 2>&1 |grep MIBDIR

    5. extending MIB Module
    http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_MIB_Module
        a. download net-snmp src code
        b. MIB definition
        c. mib2c (in net-snmp-perl)
        d. make & make install
        e. edit snmpd conf & restart agent
        f. snmpwalk to verify

    posted @ 2012-05-07 16:57 Milo的海域 閱讀(285) | 評論 (0)編輯 收藏

    Graphviz: a Text to Graph tool

    Download:
     http://www.graphviz.org/Download..php
    Install:
    http://www.graphviz.org/Download_linux_rhel.php

    Document:
    http://www.graphviz.org/Documentation.php

    Example:
    $ cat cluster.dot
    digraph G {

            subgraph cluster_0 {
                    style
    =filled;
                    color
    =lightgrey;
                    node [style
    =filled,color=white];
                    a0 
    -> a1 -> a2 -> a3;
                    label 
    = "process #1";
            }

            subgraph cluster_1 {
                    node [style
    =filled];
                    b0 
    -> b1 -> b2 -> b3;
                    label 
    = "process #2";
                    color
    =blue
            }
            start 
    -> a0;
            start 
    -> b0;
            a1 
    -> b3;
            b2 
    -> a3;
            a3 
    -> a0;
            a3 
    -> end;
            b3 
    -> end;

            start [shape
    =Mdiamond];
            
    end [shape=Msquare];
    }

    $ dot 
    -Tpng cluster.dot -o cluster.png
    $ gnome
    -open cluster.png



    More examples:
    http://www.graphviz.org/Gallery.php

    posted @ 2012-05-07 14:47 Milo的海域 閱讀(549) | 評論 (0)編輯 收藏

    iozone 是一個開源的文件系統benchmark 測試工具。可用來檢測當前或者指定磁盤的讀寫性能。
    http://www.iozone.org/

    安裝
    先確保rpmforge repository源已經安裝。具體參考:
    http://www.tkk7.com/miaoyachun/archive/
    2012/02/03/369319.html

    然后直接yum安裝

     yum install iozone

    測試
    iozone  -i 0 -r 32 -s 2097152
            Iozone: Performance Test of File I/O
                    Version $Revision: 
    3.394 $
                    Compiled for 
    64 bit mode.
                    Build: linux 

            Contributors:William Norcott
    , Don Capps, Isom Crawford, Kirby Collins
                         Al Slater
    , Scott Rhine, Mike Wisner, Ken Goss
                         Steve Landherr
    , Brad Smith, Mark Kelly, Dr. Alain CYR,
                         Randy Dunlap
    , Mark Montague, Dan Million, Gavin Brebner,
                         Jean-Marc Zucconi
    , Jeff Blomberg, Benny Halevy, Dave Boone,
                         Erik Habbinga
    , Kris Strecker, Walter Wong, Joshua Root,
                         Fabrice Bacchella
    , Zhenghua Xue, Qin Li, Darren Sawyer.
                         Ben England.

            Run began: Wed Apr 
    25 19:36:55 2012

            Record Size 
    32 KB
            File size set to 
    2097152 KB
            Command line used: iozone -i 
    0 -r 32 -s 2097152
            Output is in Kbytes/sec
            Time Resolution 
    = 0.000001 seconds.
            Processor cache size set to 
    1024 Kbytes.
            Processor cache line size set to 
    32 bytes.
            File stride size set to 
    17 * record size.
                                                                random  random    bkwd   record   stride                                   
                  KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
             
    2097152      32  844758 2001670                                                                                            

    iozone test complete.

    posted @ 2012-04-26 10:49 Milo的海域 閱讀(493) | 評論 (0)編輯 收藏

    http://www.owengriffin.com/posts/2010/04/22/Writing_PHP_applications_with_Maven_and_Jetty.html
    實驗了下,是可以的。不過用的maven3

    posted @ 2012-04-11 14:32 Milo的海域 閱讀(347) | 評論 (0)編輯 收藏

    當innobackupex 做全備的時候(my version 1.6.5), 當備份到MyISAM數據時, innobackupex 會flush tables with read lock, 來禁止MyISAM的寫操作. (假設沒有--no-lock選項)

    sub backup {

        
    if (!$option_incremental && !$option_no_lock) {
            
    # make a prep copy before locking tables, if using rsync
            backup_files(1);

            
    # flush tables with read lock
            mysql_lockall();
        }

        
    if ($option_slave_info) {
            write_slave_info();
        }

    }

    sub mysql_lockall {

        
    if (compare_versions($mysql_server_version, '4.0.22'== 0
            
    || compare_versions($mysql_server_version, '4.1.7'== 0) {
            
    # MySQL server version is 4.0.22 or 4.1.7
            mysql_send "COMMIT;";
            mysql_send 
    "FLUSH TABLES WITH READ LOCK;";
        } 
    else {
            
    # MySQL server version is other than 4.0.22 or 4.1.7
            mysql_send "FLUSH TABLES WITH READ LOCK;";
            mysql_send 
    "COMMIT;";
        }
        write_binlog_info;


    }

    但是如果備份的時候還有很重的workload, "flush tables with read lock" 可能會比較耗時. 這里參考了:

    http://www.mysqlperformanceblog.com/2010/04/24/how-fast-is-flush-tables-with-read-lock/

    看了下--no-lock的選項說明:

        --no-lock
            Use this option to disable table lock with 
    "FLUSH TABLES WITH READ
            LOCK
    ". Use it only if ALL your tables are InnoDB and you DO NOT CARE
            about the binary log position of the backup.

    如果我們能保證workload僅僅是innodb相關的,我們可以使用這個選項。

    記得在1.5版本的時候,使用--no-lock選項會導致xtrabackup_slave_info沒有保存備份時的logfile & pos. 這個問題在1.6.5被解決了

        if ($option_slave_info) {
            write_slave_info();
        }

    xtrabackup_slave_info & xtrabackup_binlog_info文件在1.5版本是在mysql_lockall函數里更新的。但是新版本已經把write_slave_info提到mysql_lockall外面了。

    posted @ 2012-04-10 17:19 Milo的海域 閱讀(676) | 評論 (0)編輯 收藏

    Some time we may not want export complex hash to console but file, we can do like this to dump to file by var_export
    <?php

    $a = array('abc'=>"123");

    # var dump
    var_dump($a);

    # var_export
    echo var_export($a);

    # export to file
    $b = var_export($a, true);
    error_log($b."\n", 3, "/tmp/ymiao.log");  

    Result:
    cat /tmp/ymiao.log
    array (
      'abc' 
    => '123',
    )

    posted @ 2012-04-10 10:54 Milo的海域 閱讀(385) | 評論 (0)編輯 收藏

    When restore by xtrabackup '--copy-back' with version 1.6.4, you may get error:
    IMPORTANT: Please check that the copy-back run completes successfully.
               At the end of a successful copy-back run innobackupex-
    1.6.4
               prints 
    "completed OK!".

    Original data directory is not empty! at innobackupex-
    1.6.4 line 544.

    when read those lines we found that:
        # check that original data directories exist and they are empty
        if_directory_exists_and_empty($orig_datadir
    , "Original data");
        if_directory_exists_and_empty($orig_ibdata_dir, "Original InnoDB data");
        if_directory_exists_and_empty($orig_iblog_dir, "Original InnoDB log");

    Google for reason for this check and find it mentioned in:
    http://www.mysqlperformanceblog.com/2011/12/19/percona-xtrabackup-1-6-4/

    innobackupex did not check that MySQL datadir was empty before –copy-back was run. With this bug fix,
    innobackupex will now error out of the –copy-back operation if the destination is not empty
    , avoiding
    potential data loss or a strang combination of a restored backup and previous data. Bug Fixed: #
    737569 (Valentine Gostev)

    posted @ 2012-04-03 13:01 Milo的海域 閱讀(699) | 評論 (0)編輯 收藏

    1. install bzr tool, ref http://dev.mysql.com/doc/refman/5.1/en/installing-development-tree.html
    2. download mysql 5.1 code from trunk
    3. autoreconf --force --install
    4. ./configure --with-debug --without-libedit --with-plugins=innobase
    5. make & sudo make install
    6. setup eclipse cdt env
        a. startup eclipse by sudo cmd or root user
        b. build project
        c. set debug diag, ref http://forge.mysql.com/wiki/Eclipse/CDT_on_Linux_and_Mac_OS_X, here is my "program parameters" when startup mysqld instance:
        --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --port=3306 --socket=/tmp/mysql.sock --default-storage-engine=innodb

    posted @ 2012-03-23 17:49 Milo的海域 閱讀(294) | 評論 (0)編輯 收藏

    僅列出標題
    共9頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 
    主站蜘蛛池模板: 亚洲午夜日韩高清一区| 歪歪漫画在线观看官网免费阅读 | 丰满少妇作爱视频免费观看| 啦啦啦中文在线观看电视剧免费版 | 亚洲黄色在线电影| 久久精品免费视频观看| 亚洲精品制服丝袜四区| a级午夜毛片免费一区二区| 亚洲欧洲自拍拍偷午夜色无码| 久青草视频97国内免费影视| 激情97综合亚洲色婷婷五| 久久WWW免费人成—看片| 亚洲老妈激情一区二区三区| 美女在线视频观看影院免费天天看| 国产成人A人亚洲精品无码| 香港a毛片免费观看| 亚洲伊人久久大香线蕉在观 | 91大神免费观看| 亚洲一区二区三区深夜天堂| 成年人性生活免费视频| 久久99精品免费一区二区| 中文字幕专区在线亚洲| 国产午夜精品免费一区二区三区| 亚洲国产精品无码av| 黄在线观看www免费看| 亚洲精品理论电影在线观看| 成人伊人亚洲人综合网站222| 好猛好深好爽好硬免费视频| 亚洲第一精品福利| 在线观看的免费网站| 免费无码午夜福利片| 亚洲AV无码成人精品区在线观看| 国产成人免费午夜在线观看| 国产精品久久久久久亚洲影视| 国产亚洲精品AA片在线观看不加载| 日本在线免费观看| 亚洲乱码一二三四区乱码| 亚洲成AV人在线观看网址| 99久久久国产精品免费牛牛四川 | 午夜免费福利视频| 国产精品亚洲专区在线观看|