Monthly Archives: June 2009

《沙巴行》Day 1

这是我第二次到访沙巴。主要目的是前往 西巴丹岛(Sipadan)浮潜。由于是从亚庇(Kota Kinabalu)开车前往仙本那(Semporna),一路上吃吃喝喝、走走看看,多认识沙巴,也是此行的目的之一。

六月二十四日(星期三)早上九点多,我到达了亚庇机场。和其他团友会合后,我们就坐上海月(Simon)舅母的车。在海月的舅母家呆了一会儿,我们就出发了。海月的舅舅把他的 Isuzu D-Max 借给我们,让我们省了千多令吉的租车费,真的非常谢谢他。

从亚庇到仙本那,全程超过五百公里,大概是从新山到怡宝的距离。由于一路上几乎都是弯曲、起伏、不平的山路,我们共花了近十小时才到达仙本那!大约十二点出发,晚上十点抵达。由于没有真正的吃个午餐,到达仙本那时,大伙儿都饿极了。开着车在镇上走着,小食店都已打烊、嘛嘛档又一个不见。这时候看见了KFC三个大字:(以为)得救了!一问之下,多数的食物都卖光了!没办法,我们就把剩下的几块炸鸡、汉堡…… 统统买下打包。在 backpacker inn 住下,吃 KFC 夜霄、冲凉梳洗后,大家就倒下睡觉。赶了一天的路,大家都很累了。

途经 Kundasang 时在路旁买些水果和土产。

Advertisements

MySQL Database Replication

There are 2 database servers.  One master and one client.  The client is to be sync with the master.  Official documentation: http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html

  1. Master: Shutdown the MySQL server.
    # /etc/init.d/mysql stop
  2. Master: Add in the following options into /etc/mysq./my.cnf configuration file.
    • server-id=1
    • log_bin=/var/log/mysql/mysql-bin.log
    • binlog_do_db=TEST_DB
    • innodb_flush_log_at_trx_commit=1
    • sync_binlog=1
  3. Master: Startup MySQL server.
    # /etc/init.d/mysql start
  4. Master: Login as the root MySQL login to the database to be replicate.
    $ mysql -u root -p TEST_DB
  5. Master: Create a mysql login purely for replication exercise.
     mysql> grant replication slave on *.* to 'repl'@'%' identified by 'Repl';
  6. Master: Lock the master database.  Do not logout from the mysql program or else the lock will be released.
    mysql

    > flush tables with read lock;
  7. Master: Get the master database status.  Copy down the value of File and Position.  You’ll need them later.
    mysql

    > show master status;
    +------------------+----------+--------------+------------------+
    | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
    +------------------+----------+--------------+------------------+
    | mysql-bin.000003 |      178 | TEST_DB      |                  |
    +------------------+----------+--------------+------------------+
  8. Master: Export the master database.
    $ mysqldump -u root -p TEST_DB > TEST_DB.dmp
  9. Master: Release the lock or simply exit the mysql program.
    mysql> unlock tables;
    mysql> quit;
  10. Client: Shutdown MySQL server.
    # /etc/init.d/mysql stop
  11. Client: Add in the following options into /etc/mysq./my.cnf configuration file.
    • server-id=2
  12. Client: Startup MySQL server.
    # /etc/init.d/mysql start
  13. Client: Create the client database by importing the master database.  You’ll need to transfer the dump file from master machine to client machine first.
    $ mysql -u root -p TEST_DB < TEST_DB.dmp
  14. Client: Log into MySQL.
    $ mysql -u root -p TEST_DB
  15. Client: Provide master database settings.
    mysql> change master to
    ->  master_host='master_machine_ip',
    ->  master_user='repl',
    ->  master_password='Repl',
    ->  master_log_file='mysql-bin.000003',  -- from step 7.
    ->  master_log_pos=178;                  -- from step 7.
  16. Client: Start replication.
    mysql> slave start;
  17. Done.
    mysql> quit;

《渺渺》

渺渺

好久没看中文影片。刚看了《渺渺》,感觉很好、很喜欢。前几天也看了《海角七号》,也还不错,但还是比较喜欢《渺渺》。

总是对校园影片情有独钟,可能是因为自己错过了那一段应该是人生最多姿多彩的时期吧 ……  每次想到这里,就只能无奈的牵一牵嘴角,然后轻轻的吁口气,继续着没有目标的人生。

又听到了《旅行的意义》,就快把人给溶化了  🙂