Aug 12

รับสมัคร System Engineer รายละเอียดดังนี้ครับ
สนใจส่ง Resume มาที่ ton [at] packetlove.com
สอบถามเพิ่มเติม +66868885195 (Ton)

Responsibilities
- Participate in the design, implementation and ongoing management of systems architectures that form the foundation for Weloveshopping.com production infrastructure
- Participate in the design of architectures and automation that deliver against strict requirements for functionality, scalability, performance and reliability
- Become proficient in understanding how each software component, system design, and configuration is linked together to form an end-to-end solution
- Serve in a low-volume on-call rotation as an escalation contact during incidents.

Requirements
- BS or MS degree in Computer Science, Engineering, related technical discipline, or equivalent experience
- Minimum of 3 years administering Linux systems in a production environment
- Proven ability to quickly learn and implement unfamiliar technologies
- Extensive expertise with configuration management systems
cfengine experience a plus
- Configuration and maintenance of common applications such as Apache, Nginx, Memcached, noSQL, Squid, MySQL, NFS, DHCP, NTP, SSH, DNS, and SNMP
- Strong knowledge of Linux kernel configuration, performance monitoring, and tuning
- Advanced experience coding in one of the following languages: Shell, Python or Perl
- Prefer experience coding and/or debugging one or more of the following: PHP, C++ or Ruby
- Experience working with load balancing technologies and large-scale web server farms
- A strong background in internet service deployment, provisioning, IP networking, service infrastructure, or software deployments
- Excellent organization skills, project tracking abilities, communications skills
- Detail oriented with excellent written and verbal communication skills.

Tagged with:
Jun 05

สวัสดีครับ วันนี้มีเรื่องเกี่ยวกับ MySQL Replication Error มาเล่าให้ฟังครับ
ผมเองก็เพิ่งเคยเจอเหมือนกัน วิธีแก้ไขทำได้ยากมาก ปัญหาคือเกิดจาก
เครื่อง Master อาจจะมีการ shutdown โดยไม่ได้ stop MySQL ก่อน จึงทำให้
bin-log เกิดความไม่สมบูรณ์ โดยสามารถดูที่ Error Log ของ MySQL จะมี
ข้อความประมาณนี้ ที่เครื่อง Slave

100605 16:51:56 [Note] Slave I/O thread: connected to master ‘slaveuser@192.168.13.10:3306′,  replication started in log ‘mysql-bin.000429′ at position 57053329

100605 16:51:56 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236)

100605 16:51:56 [ERROR] Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log

100605 16:51:56 [Note] Slave I/O thread exiting, read up to log ‘mysql-bin.000429′, position 57053329

ผมพยามจะ STOP/START Slave แล้ว แต่ว่าก็ไม่ช่วยให้อาการดีขึ้น
ทางเดียวที่ควรจะทำคือ ให้เริ่ม Replication ใหม่ โดยใช้ bin-log อันดับถัดไป
ที่ position 0 อย่างในตัวอย่าง ผมก็จะเริ่มที่  mysql-bin.000430 position 0
โดยมีขั้นตอนต่างๆ ดังนี้คือ

mysql> STOP SLAVE;
mysql> change master to MASTER_HOST=’192.168.13.10′, MASTER_USER=’slaveuser’, MASTER_PASSWORD=’xxxxxx’, MASTER_LOG_FILE=’mysql-bin.000430′, MASTER_LOG_POS=0;
mysql> START SLAVE;

จากนั้นทำการสั่ง SHOW SLAVE STATUS\G; ก็จะพบว่าเครื่อง Slave
สามารถกลับมา replication กับเครื่อง Master ได้เหมือนเดิม ..

* คำเตือน ห้ามใช้วิธีการ STOP SLAVE; RESET SLAVE; START SLAVE;
โดยเด็ดขาด เพราะนั่นหมายความว่าจะต้องทำการ sync bin-log ตั้งแต่
bin-log แรกสุดที่เครื่อง Master เก็บไว้ :)

* เพิ่มเติม ควรทำการ purge bin-log บ่อยๆ เพื่อเป็นการลดพื้นที่การใช้ดิส
โดยใช้คำสั่ง ดังต่อไปนี้ หรือจะตั้ง cronjob ไว้ก็ได้คร้บ
mysql> PURGE BINARY LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 7 DAY);

Tagged with:
Apr 17

สวัสดีปีใหม่ไทยครับทุกท่าน ช่วงหยุดสงกรานต์ที่ผ่านมาผมไม่ได้
เข้ามา update blog เลย เพราะว่าเดินทางท่องเที่ยว และทำกิจกรรม
ในช่วงวันหยุดพักผ่อน ส่วนรูปและเรื่องราวต่างๆ ติดตามได้ที่ FB ครับ
URL : http://www.facebook.com/pornpasok

ส่วนเรื่องที่ผมจะมาเขียนวันนี้มีความสำคัญมาก สำหรับท่านที่ใช้
MySQL Replication ซึ่งบางครั้ง เครื่อง Slave บางเครื่องอาจจะ
มีปัญหาเกี่ยวกับ bin-log ซึ่งเราจำเป็นต้องทำให้ไป sync กับ Master
ที่ bin-log และ Position ที่เราต้องการ วิธีการ check มีดังต่อไปนี้ครับ

1.mysql> SHOW SLAVE STATUS\G;
จะได้ค่าต่างๆ ของเครื่อง Slave มา ที่เราสนใจก็คือค่าต่างๆ ของ
Relay_Master_Log_File : และั Exec_Master_Log_Pos :

2.mysql> STOP SLAVE;
เป็นการสั่งเพื่อหยุดการทำงานของ Slave

3.สมมุติว่า เครื่อง Master มี IP เป็น 192.168.1.1  User-Password ใส่แบบตัวอย่าง
Relay_Master_Log_File : mysql-bin.000354 Exec_Master_Log_Pos : 823287655
เราก็ทำการใช้ command ในการเปลี่ยนเครื่อง Slave เราให้ทำงานที่ position ที่เราต้องการดังนี้
mysql> CHANGE master TO  MASTER_HOST=’192.168.1.1′,MASTER_USER=’slaveuser’,MASTER_PASSWORD=’slavepassword’,master_log_file=’mysql-bin.000354′,master_log_pos=823287655,MASTER_CONNECT_RETRY=10;

4.mysql> START SLAVE;

เท่านี้ก็จะแก้ปัญหาต่างๆ เกี่ยวกับการทำ MySQL Replication ได้แล้วครับ :)

เพิ่มเติม URL : http://www.mysqlperformanceblog.com/2008/08/02/troubleshooting-relay-log-corruption-in-mysql/

Tagged with:
Aug 04

อ่านบทความจาก http://highscalability.com/youtube-architecture แล้วชอบ
ระบบของ Youtube.com มาก ๆ เจ๋งดี ..

Recipe for handling rapid growth

while (true)
{
identify_and_fix_bottlenecks();
drink();
sleep();
notice_new_bottleneck();
}

จริง ๆ ระบบจะใหญ่ได้ ก็คือระบบที่คืนสู่สามัญที่สุด คือ simple มากที่สุด
แต่มีการเพิ่มจำนวนในแบบ flat ได้มากที่สุด พวกระบบใหญ่ ๆ ของโลก
ใช้ server ขนาดเล็ก แต่ใช้จำนวนมาก ช่วยกันทำงาน ทำให้เวลาเครื่องใด
เครื่องนึงมีปัญหา ก็ยังสามารถทำงานต่อไปได้ uptime 100% ..

Tagged with:
Sep 05

Sphinx a full-text search engine

ตอนนี้ Server นิ่งแล้ว ก็เลยมีเวลามาทำ R&D เกี่ยวกับระบบ Search
เพื่่อนตั้ม (http://www.thaiajax.com) โปเกม่อนเทพ แนะนำ
ว่าให้เอา Sphinx มาช่วย ก็เลยต้องเป็นหน้าที่ผม ที่ต้องทำ Server
ให้ Support หาข้อมูลได้น้อยมากเกี่ยวกับตัว Sphinx ยิ่งในไทย
เท่าที่เห็น ยังไม่มีเลย เพราะคงไม่ต้องใช้ถึงขนาดนี้ ระบบไม่ใหญ่ ..
นั่งงมอยู่นานเหมือนกัน เพราะไม่เคยใช้ หาอ่าน Doc ของเว็บ Sphinx
ก็มีให้อ่านน้อยมาก ๆ แต่เว็บอื่น ๆ มีอยู่พอสมควร ..

ตอนนี้เรื่องการใช้งานการปรับแต่งอะไร ก็กำลัง test กันอยู่ ผมเอา
วิธีการ config มาให้เพื่อน ๆ ที่สนใจได้อ่านกันละกัน เพราะว่ากว่าที่
ผมจะ config ได้ ก็ใช้เวลาพอสมควรเหมือนกัน เลยเอามาแบ่งปัน ..

Install MySQL SphinxSE CentOS 5.2

yum -y install bison patch automake libtool

wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz/from/http://mysql.thaiweb.net/
tar xfz sphinx*
tar xfz mysql*

cd mysql*
patch -p1 < ../sphinx-0.9.8/mysqlse/sphinx.5.0.37.diff
BUILD/autorun.sh
mkdir sql/sphinx
cp ../sphinx-0.9.8/mysqlse/* sql/sphinx
./configure –prefix=/usr/local/mysql –with-sphinx-storage-engine
make
make install

cp support-files/mysql.server /etc/init.d/
/etc/init.d/mysql.server start

mysql> SHOW ENGINES;
+————+———+—————————————————————-+
| Engine | Support | Comment |
+————+———+—————————————————————-+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | NO | Example storage engine |
| ARCHIVE | NO | Archive storage engine |
| CSV | NO | CSV storage engine |
| SPHINX | YES | Sphinx storage engine 0.9.8 |
| ndbcluster | NO | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | NO | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+————+———+—————————————————————-+
13 rows in set (0.00 sec)

Install Sphinx

cd ../sphinx*
./configure --prefix=/usr/local/sphinx --with-mysql
make
make install

cd api/libsphinxclient
chmod +x buildconf.sh
./buildconf.sh
./configure
make
make install

Install PHP Sphinx extension
http://pecl.php.net/package/sphinx


cd ../../../
wget http://th.php.net/get/php-5.2.6.tar.gz/from/this/mirror
wget http://pecl.php.net/get/sphinx-0.2.0.tgz

tar xfz php-5.2.6.tar.gz
tar xfz sphinx-0.2.0.tgz
mv sphinx-0.2.0 php-5.2.6/ext/sphinx
rm configure
./buildconf –force
./configure –with-apxs2=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql –enable-force-cgi-redirect –with-gettext –with-zlib-dir=/usr/local/zlib –enable-mbstring –with-curl=/usr/local/lib –with-sphinx
make
make install

ทำนี้ก็เป็นอันเรียบร้อยแล้วครับ สำหรับ MySQL+SphinxSE
และ PHP Sphinx Extension

Tagged with:
Aug 22

Agenda

8.30am
Registration
9.00am
Welcome Speech: Synergy with Sun and MySQL by Dr. Thanachart Numnonda, Business Development Director, Software Practice, Sun Microsystems (Thailand) Ltd.
9.20am
Maximizing Scalability for the Web Economy by Daniel Saito, Senior Manager, Database Group, APAC, Sun Microsystems
10.05am
MySQL HA Solution by David Axmark, Co-founder of MySQL
10.50am
Coffee Break
11.05am
The Value of the AMD Opteron™ Processor in Today’s Database Environments by Mr. Kittinut Warithasuwan, Channel Sales Manager, AMD Thailand
11.35am
MySQL Experience Sharing in Thai IT Environment by Dr. Thanachart Numnonda, Business Development Director, Software Practice, Sun Microsystems
12.05pm
Q&A
12.20pm
End

วันนี้มีโอกาสได้ไปงาน MySQL Day ที่จัดขึ้นเป็นครั้งแรกในประเทศไทย
โดย Sun microsystems Thailand งานนี้ ผู้บรรยายแต่ละคน คือ
ผู้ก่อตั้ง MySQL และผู้บริหารระดับสูงของ Sun ทำให้ได้ความรู้มาก ๆ
แล้วก็ได้พบกับ คนของ MySQL ที่ตอบคำถามต่าง ๆ ได้จริง ๆ ซึ่งก็มี
Dr. Thanachart Numnonda, Business Development Director,
Software Practice, Sun Microsystems (Thailand) Ltd.
Daniel Saito, Senior Manager, Database Group, APAC,
Sun Microsystems และ David Axmark, Co-founder of MySQL
แล้วก็อีกท่านหนึ่งคือพี่บิ๊ก ผมกับพี่บิ๊ก เจอกันที่ True มาแล้วหลายครั้ง
เพราะว่าพี่เค้าเข้ามาคุยงานกับทางผมอยู่ เป็นคนนึงที่เก่งมาก ๆ สามารถ
ปรึกษาในเรื่องต่าง ๆ ได้ เพิ่งรู้วันนี้เหมือนกัน ว่าเป็นรุ่นพี่ ที่วิศวะ ลาดกระบัง
น่าภูมิใจ รุ่น 28 ห่างกับผม 11 ปี เอง แต่ดูพี่เค้ายังหน้าเด็ก ๆ อยู่เลย ..

หลังจากเลิกงานได้เป็นแขก VIP ร่วมรับประทานอาหารกับ ทาง Sun
เพราะได้ connection จากพี่อัท ได้คุยกันแบบตัวต่อตัว กับทาง
ผู้พัฒนา MySQL คือ David Axmark อยากรู้อะไร ก็ถามได้เลยตรงนั้น
จากนั้นผม, พี่อัท, พี่วิน, พี่เจน ก็ไปนั่งเล่น TK Park Central World กัน
ผมเพิ่งเคยมานั่งจริง ๆ จัง ๆ ก็วันนี้แหละ หญิงน่ารักเพียบ มานั่งอ่านหนังสือ
จากนั้นเราก็ไปนั่งร้าน Mc กัน หาอะไรกินหน่อย เพราะว่าตอนกลางวัน
ที่ทาง Sun ชวนรับประทานอาหาร มัวแต่คุยกัน ไม่ค่อยได้กินอะไร เท่าไร
จากนั้นก็แยกย้ายกันกลับ เพราะว่าผมงานเข้า ต้องรีบเข้ามาที่ True ..

สรุปงานนี้เป็นงานที่ดีมาก ๆ ต้องขอบคุณทาง Sun ที่จัดอะไรดี ๆ แบบนี้
และเห็นความสำคัญของกลุ่มผู้ใช้ ผมว่าเป็นสิ่งที่ดี ที่ทาง Sun จะเปิดตัว
MySQL Enterprise ในไทย พวกที่เป็น commercial จะได้วางใจ หันมา
ใช้ MySQL ใน product ที่สำคัญกันมากขึ้น เพราะ MySQL ทั้งเร็ว ทั้งดี
ค่าใช้จ่ายก็ต่ำกว่า Database ตัวอื่น ๆ ทำงานได้หลากหลายกว่าด้วย ..
พวก MySQL Community ก็จะได้มีโอกาส ได้รับความรู้ และรับงาน
พวกนี้ได้ด้วย ในอนาคต เพราะเมื่อหันมาใช้งานกันมากขึ้น ก็ต้องการคน
ที่มีความรู้ ความสามารถ เกี่ยวกับ MySQL มา Support มากขึ้น ..

Tagged with:
preload preload preload
eXTReMe Tracker