วันเสาร์ที่ 7 พฤศจิกายน พ.ศ. 2552

Implement Cloud on Ubuntu Eucalyptus

รายงาน


เรื่อง Eucalyptus Installation



จัดทำโดย
1. นาย จตุพล บุณยสนธิกุล รหัส 5109035385
2. นาง รุจรดา เย็นเยือก รหัส 5109035427
3. นาย ตรีภพ สรรเพชร์นิยม รหัส 5109035278
4. นาย วสันต์ กุลดิลก รหัส 5209035053

เสนอ
ดร.กษิดิศ ชาญเชี่ยว



รายงานนี้เป็นส่วนหนึ่งของวิชา
CS641 ADVANCED OPERATING SYSTEMS เทอม 1/2552
ภาควิชาวิทยาการคอมพิวเตอร์
คณะวิทยาศาสตร์ มหาวิทยาลัยธรรมศาสตร์



¢ Cloud Computing
คือการให้บริการระบบสารสนเทศผ่านเครือข่าย internet(web 2.0) ที่มีการประมวลข้อมูลที่รวดเร็ว โดยที่ผู้ใช้หรือองค์กรเพียงแต่เช่าใช้บริการ Infrastructure (provision over internet, external controlled and stored) , Software or Application(with feature : easy implement , with minimal IT Knowledge), Brandwidths ภายใต้เงื่อนไขของการบริการ โดยที่ลูกค้าจะเสียค่าใช้จ่ายเท่ากับปริมาณการใช้จริง ซึ่งก็มีความยึดหยุ่น มีความสะดวก และมีระบบรักษาความปลอดภัยที่ดี

การให้บริการของ Cloud Provider เสนอการให้บริการไว้หลัก ๆ คือ 3 กลุ่มได้แก่
Software as a Service(SaaS)
Application จะrun อยู่บน cloud บน server ที่ผ่านทาง Internet-accessible service provider เช่นSalesforce.com และอื่นๆอีกมาก

Attached Service (IaaS)
สำหรับ on-premises application ,end-user สามารถใช้บริการเรื่องของ audio , video content,cloud-base spam filtering, archiving

Cloud Platforms (PaaS)
กำหนดบน cloud-based service สำหรับ developers เพื่อ creating application และสามารถ building and deployment ได้


¢ Architectural layer of cloud computing


Software as a service (SaaS)
Platform as a service (PaaS)
Infrastructure as a service (IaaS)


¢ Benefit & Disadvantage of Cloud
Benefits of Cloud Computing

· Reduce run time and response time : การทำงานของ Program ทำได้อย่างรวดเร็ว
· Reduction in costs: ลดต้นทุนด้านการจัดเก็บข้อมูล , ต้นทุนของ Software Updates ,ต้นทุนการบำรุงรักษา ,ต้นทุนในเรื่องการควบคุมคุณภาพ , ต้นทุนด้าน Hardware
· Scalability and speed: รองรับการขยายตัว และความรวดเร็วในการประมวลผล เช่นในช่วงเวลาการแข่งขัน หรือช่วงเวลาที่มีคนเข้าถึงข้อมูลพร้อมกัน จำนวนมาก
· Enabling Innovation: ได้รับบริการที่เป็นนวัตกรรมใหม่เสมอ
· Ease of Use: ใช้งานได้ง่ายเสมือนเป็นสิ่งอำนวยความสะดวกพื้นฐานทั่วไป
· Freedom of location: อิสระ ไม่ว่าจะส่วนที่ไหนก็สามารถใช้งานได้ปกติ
· Better utilization of limited resources: ใช้สิ่งอำนวยความสะดวกที่ดีขึ้น แม้ว่าจะมีความจำกัดในเรื่องทรัพยากร เพราะว่ามีการทำการ sharing all server , storage and network resources
· Flexibility: User สามารถติดต่อขอความช่วยเหลือ หรือคำแนะนำได้ตลอดเวลา

Minimizing the risks of using a cloud
· User access จะกำหนดให้ใครเป็น Administrator เพื่อทำหน้าที่ กำหนดสิทธิในการเข้าถึงข้อมูล ที่มีขนาดใหญ่
· Regulatory compliance ต้องทำการตรวจสอบภายนอกในเรื่องของ external audits หรือ กำหนดมาตราฐาน Certificate atr available for verification
· Data location ถ้าทำการให้สิทธิให้ end-user control แหล่งที่อยู่ของข้อมูลผ่าน geographical ได้
· Data security ต้องสามารถมั่นใจได้ว่าตลอดเส้นทางของข้อมูล ใช้วิธีการเข้ารหัสข้อมูลอย่างมีประสิทธิภาพ
· Recovery มีวิธีการจัดการความเสียหายของข้อมูล หรือ การกู้ข้อมูล และใช้ระยะสั้นที่สุด
· Investigative Support ต้องมีคนคอย support ให้คำแนะนำตลอดเวลา
· Long-term viability ในกรณีที่บางบริษัทเลิกกิจการไปแล้ว แล้วจะเกิดอะไรขึ้นกับข้อมูลเหล่านั้น

¢ การนำไปใช้งาน Cloud Computing ทำอย่างไร
— ทำการสร้าง Amazon Machine Image (AMI) ซึ่งจะประกอบไปด้วย applications, libraries, data and associated settings
— ทำการ Upload Amazon Machine Image (AMI) to Amazon S3 (simple storage service)
— ใช้ Amazon EC2 web service เพื่อทำการ configure security and network access
— เลือกใช้ OS, เพื่อทำการ start AMI instances
— ทำการควบคุม Monitor & control ผ่านทาง web interface or APIs

¢ Eucalyptus Installation
กลุ่มเราทำการ Implement Ubuntu Enterprise Cloud by Eucalyptus ด้วย Ubuntu 9.04 ซึ่งถือว่าเป็นชนิดของ Private Cloud คือ การบริการที่มีเจ้าของเป็นผู้ให้บริการและsupport ลูกค้าของตนผ่านทาง Cloud Provider เป็นการ Implement base ในเรื่องของการควบข้อมูล , ระบบรักษาความปลอดภัย ,และคุณภาพของการบริการ
ก่อนอื่นควรทำความเข้าโครงสร้างของ Eucalyptus ประกอบด้วย 3 ส่วนได้แก่
1. Eucalyptus-cloud คือ การทำงานในส่วน Front-End (Cloud Controller) มีพื้นที่การจัดเก็บข้อมูล
2. Eucalyptus-cc คือ การทำงานในส่วน Front-End (Cluster Controller) เพื่อให้บริการในส่วนของ virtual network overlay
3. Eucalyptus-nc คือ การทำงานในส่วน Node (Node Controller) โดยทำการติดต่อสื่อสารกับ KVM เพื่อจัดการการทำงานกับ VMs

ในขั้นตอนการติดตั้ง ระบบ Eucalyptus จะประกอบด้วย 2 Machines คือ Front-End กับ Node
โดยที่ Front-End มีทำการทำงาน 2 ส่วนคือ eucalyptus-cloud และ eucalyptus-cc ซึ่งเป็นการเซตค่า configuration และกำหนดการติดต่อสื่อสารผ่าน netwotk messages
ส่วนที่ Node ของ eucalyptus ทำงานในส่วนของ User โดยการสร้าง VMs เป็นการเซตค่า configuration ethernet

Minimal hardware requirements

ดังนั้นทางกลุ่มทำการ Set Cloud Cluster 1 เครื่อง ( 1 Netbook) และ Set Node อีก 3 เครื่อง (3 Laptop)

คราวนี้เป็นขั้นตอนการติดตั้งซึ่งประกอบด้วย 6 ขั้นตอน
1. Prerequisites
2. Installation and Configuration
3. Registering Eucalyptus components
4. Initial Login and optional Cloud Registration
5. Creating a Virtual machine (VM) image
6. Running your image

หมายเหตุ ต้องทำทุก step อย่างต่อเนื่อง และระบบจะสามารถต่อ internet ได้ด้วย

Step 1 : Prerequisites
1.1 Install postfix (mail server)



1.2 Edit file /etc/host ด้วยการ พิมพ์เพิ่ม mailhost ข้างๆ คำว่า localhost


1.3 Open port 8773 , 8443
Sudo iptable –L (policy การใช้ chain)




Step 2 : System Installation and Configuration





ทำการแก้ไข file /etc/eucalyptus/eucalyptus.conf โดยการ set ให้ #VNET_BRIDGE=”br0”
แล้วทำการ Stop eucalyptus-nc จากนั้นทำการ Start eucalyptus-nc



ทำการแก้ไข file /etc/sysctl.conf โดยการ เอา comment หน้า net.ipv4.ip_forward=1 ออก

ทำการ verify


Step 3 : Registering Eucalyptus Components

Step 4 : Initial Login
















Step 5 : Creating a Virtual Machine (VM) Image

ทำ step copy text ไปใส่ที่ file ชื่อว่า first bootโดยใส่ Script ด้านล่างนี้




Step 6 : Running an Image


เมื่อเครื่อง node ส่งคำสั่งไป run แล้วพิมพ์
$ euca-describe-instances

ข้อมูลยังไม่มีอะไรเปลี่ยนแปลง ทำการเช็ค log file เพื่อหาสาเหตุ
ในที่นี้ เปิด axis2c.log , httpd-nc_error.log , euca_test_nc.log

ผลลัพธ์หลังจากเรียก VM จาก Cloud มาเพื่อใช้งาน


ประสบการณ์ที่ได้รับจาก Project นี้ ได้แก่
1. ความรู้ที่หลากหลาย ได้แก่ Linux OS, VI – editor, gedit - editor , KVM , Cloud Computing , Blog
2. ความร่วมมือในการทำงาน
3. การความสามารถในการวิเคราะห์และแก้ไขสถานการณ์
4. การใช้งาน Opensource

ปัญหา
1. ไม่สามารถ Run คำสั่งสุดท้ายในการเข้าใช้ Cloud
2. DHCP ไม่ทำงาน
3. เวลาย้าย Network IP จะเปลี่ยนทำให้ไม่สามารถ Runได้
4. เครื่องไม่ Support เนื่องจากเครื่อง Node จำเป็นต้องการ CPU ทีรองรับ Virtualization เช่น Intel-VT หรือ AMD-v


การแก้ไข
1. ทำการเป็น Ubuntu Servers ทั้งหมด
2. Confige ให้ทั้ง Front-end และ Nc อยู่บนเครื่องเดียวกัน


Special Thanks, More Information, and Help!

อาจารย์

- ดร.กษิดิศ ชาญเชี่ยว kasiditchanchio@gmail.com

สมาชิกกลุ่มทุกคน
- จตุพล บุณยสนธิกุล jaman.p2000@gmail.com
- รุจรดา เย็นเยือก n.rutrada@hotmail.com
- ตรีภพ สรรเพชร์นิยม treepop.sunpetchniyom@nectec.or.th
- วสันต์ กุลดิลก wasan.kul@gmail.com


Reference
1. https://help.ubuntu.com/community/Eucalyptus
2. http://open.eucalyptus.com/wiki/Euca2oolsGuide
3. http://rutrada.blogspot.com/