Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sunday, July 20, 2014

How to install GlusterFS on Debian 7 wheezy

This tutorial I will explain GlusterFS configuration in Debian 7.6.0 and You can use this tutorial for ubuntu. GlusterFS is an open source distributed file system which provides easy replication over multiple storage nodes. Gluster File System is a distributed filesystem allowing you to create a single volume of storage which spans multiple disks, multiple machines and even multiple data centres.

How to use it? It simply.Please follow this step below.

Prerequisites
  • 2 x Debian 7 Server
  • IPaddr and hostname for all server
    I use :
  • Server 1 ipaddr : 192.168.207.129
    Server 1 hostname : debian7n1
  • Server 2 ipaddr : 192.168.207.130
    Server 2 hostname : debian7n2
     Install GlusterFS
The next step is to make the all machines server.
     


$ su -
# wget -O - http://download.gluster.org/pub/gluster/glusterfs/3.5/3.5.1/Debian/pubkey.gpg | apt-key add -
# echo deb http://download.gluster.org/pub/gluster/glusterfs/3.5/3.5.1/Debian/apt wheezy main > /etc/apt/sources.list.d/gluster.list
# apt-get install glusterfs-server glusterfs-client -y
# update-rc.d glusterd defaults
# gluster --version

glusterfs 3.5.1 built on Jun 28 2014 04:14:49

Repository revision: git://git.gluster.com/glusterfs.git

Copyright (c) 2006-2011 Gluster Inc. <http://www.gluster.com>

GlusterFS comes with ABSOLUTELY NO WARRANTY.

You may redistribute copies of GlusterFS under the terms of the GNU General Public License.


Now it is mandatory that both machines must listen to each other with their hostname
   
# vi /etc/hossts

192.168.207.129         debian7n1
192.168.207.130         debian7n2

Now step : run this command gluster peer probe [hostname] in debian7n1 for connect both machine

# gluster peer probe devian7n2
peer probe: success

# gluster peer status

Number of Peers: 1

Hostname: debian7n2
Uuid: 58e8bbb2-6067-47b3-b1c7-1f2316d55013
State: Peer in Cluster (Connected)

Now I will create a common folder on both debian virtual machine at /data

# fdisk -l /dev/sd*
Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders, total 10485760 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb doesn't contain a valid partition table 
# mkfs.ext3 /dev/sdb
mke2fs 1.42.5 (29-Jul-2012)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n)  y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 
# mkdir /data
#mount /dev/sdb /data

If you wish you can use any other mount points on both machines.
Now we need to create the volume where the data will reside. The volume will be called GlusterVol. Now run on any machine.
please follow this step on one machine:
# gluster volume create GlusterVol replica 2 transport tcp debian7n1:/data debian7n2:/data force
volume create: GlusterVol: success: please start the volume to access data

run this command to start volume

# gluster volume start GlusterVol volume start: GlusterVol: success # gluster volume info 
Volume Name: GlusterVol
Type: Replicate
Volume ID: 63bc4f7e-beb1-47b5-9cb9-9f111cb6b510
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: debian7n1:/data
Brick2: debian7n2:/data

Sunday, July 6, 2014

How to install Ubuntu 14.04 LTS on VMware workstation 10

สวัสดีครับ วันนี้เรามาลองติดตั้ง Ubuntu ซึ่งเป็นระบบปฏิบัติการ Linux กันนะครับ
ก่อนอื่นเราต้องไปโหลดตัว ISO installer กันก่อนเลยนะครับ โดยไปที่ลิงค์
   http://www.ubuntu.com/download/desktop/contribute/?version=14.04&architecture=amd64

พอโหลดเสร็จแล้วก็ทำตามขั้นตอนได้เลยครับ



  • เปิด VMware workstation ขึ้นมาครับ

  • คลิกที่ New Virtual Machine หรือ กดปุ่ม Ctrl+N ที่คีย์บอร์ดครับ

  • เลือก Typical และคลิด Next

  • เลือก iso installer และคลิก browe จากนั้นเลือกที่ไฟล์ที่เราทำหารโหลดไว้กด open และ คลิก Next



  • ใส่ชื่อ และ รหัสตามที่ต้องการครับ

  • คลิก Next ผ่านไปเลยหรือถ้าท่านใดต้องการเปลี่ยนชื่อเครื่องก็เปลี่ยนได้ครับ

  • กำหนดขนาดของดิสก์ครับแล้วเลือกว่าจะใช้แบบไหน
    อันบนจะเป็นแบบเก็บไว้เป็นไฟล์เดียว ส่วนอันล่างจะแบ่งเป็นหลายๆไฟล์ ในที่นี้แนะนำแบบล่างครับ

  • ตรวจสอบฮาร์ดแวร์ว่าตรงตามต้องการหรือไม่ ถ้าอยากแก้ไขเพิ่มเติมก็กดที่ Customize Hardware ถ้าเรียบร้อยแล้วคลิก Next เลยครับ

  • ทีนี้เครื่องจะเปิดขึ้นมา แล้วในเวอร์ชันใหม่ๆ จะมีฟังก์ชัน easy install ให้เราก็ไม่ต้องทำอะไรเลยครับแค่รอเฉยๆ หาอะไรทำไปพลางๆก่อนครับ



  • พอเสร็จแล้วก็จะได้หน้าแบบนี้ครับ ใส่รหัสที่ตั้งไว้แล้ว Enter เลยครับ

  • จะได้หน้าตาแบบนี้



    ติดตั้งเรียบร้อยแล้วเดี๋ยวครั้งหน้ามาเริ่มต้นใช้งานกันนะครับ สำหรับวันนี้ขอลาไปก่อนครับ