umount: device is busy

TA/Common 2013. 2. 4. 14:36

umount: device is busy

 

$> umount /mnt/imsi

umount: /mnt/imsi: device is busy

 

==>

 

$> fuser -cu /mnt/imsi/     #check users holding this directory

$> fuser -ck /mnt/imsi      #remove users holding this directory forcely

 

* (주의) fuser -cu 시 확인되는 /mnt/imsi/를 holding 하고 있는 계정들이 logout 된다.

 

'TA > Common' 카테고리의 다른 글

R설치 in Rocks Clusters 6 (CentOS 6) & 5  (0) 2013.02.04
grep 사용시 or 사용 방법  (0) 2013.02.04
glusterfs 3.3 설치 및 구성  (0) 2013.02.04
ssh 접속시 환영메시지 생성하는 방법  (0) 2013.02.04
설치된 OS 버전 확인  (0) 2013.02.04
Posted by 옥탑방람보
,

glusterfs 3.3 설치 및 구성

 

1. 다운로드

2. 설치

    $> ./configure

     

    <모듈이 사전 설치 되지 않아 에러발생시>

    $> yum install python-cytpes.x86_64      #configure: error: python does not have ctypes support

    $> yum install flex.x86_64                     #configure: error: Flex or lex required to build glusterfs.

    $> yum install bison                            #configure: error: GNU Bison required to build glusterfs.

    $> yum install openssl                        #configure: error: OpenSSL crypto library is required to build glusterfs

     

    $> make

    $> make install

    $> glusterfs --version

    $> chkconfig glusterd on

     

    <cluster>

    * cluster에서 ./configure, make, make install 과정을 각 노드에 로그인해서 수행해야함.

 

3. Storage pool 구성

    $> gluster peer probe slave-0-0    # 노드 하나씩 추가

    $> gluster peer status  # 구가된 peer 상태 확인

     

    * peer 삭제

    $> gluster peer detach slave-0-0

     

    <cluster>

    * peer 모두 등록 후 rocks run host "hostname; ls -al /var/lib/glusterd/peers/ | wc -l" 를 통해 모든 노드에 peer가 잘 등록되었는지 확인

    * 만약 일부 노드에서 peer가 다 등록되어 있지 않다면, /etc/hosts 파일에 각 노드들 도메인이름, IP 넣어 주면 자동 등록됨

4. 볼륨 생성

    $> gluster volume create <volume_name> server1:/dir server2:/dir ...

    예 $> gluster volume create gv10 slave-0-0:/disk1 slave-0-0:/disk2 slave-0-1:/disk1 slave-0-1:/disk1

    $> gluster volume start <volume_name>

     

    * 볼륨 삭제

    $> gluster volume stop <volume_name>

    $> gluster volume delete <volume_name>

    * "operation failed 에러 발생시" /etc/init.d/glusterd restart

    * delete 후에도 info 에서 리스트 나타날 경우" 다시 해당 gluster volume start 한 후 stop, delete 한다.

    * delete 가 안될 경우 모든 서버에서 정보가 삭제되었는지 확인한다. 한군데라도 정보가 있으면, 볼륨 정보가 다시 생성된다. (gfs는 따로 마스터가 없는 특징)

    * 특정 다른 서버에 접속하여 볼륨을 삭제 하는 방법도 있다.

    * 참고: volume 정보 저장 디렉토리 /var/lib/glusterd/vols/

     

    * 볼륨상태 확인

    $> gluster volume info <volume_name>

    $> gluster volume status

    $> gluster volume list

     

    * 볼륨생성시 아래와 같은 에러 발생시

    GlusterFS: {path} or a prefix of it is already part of a volume

      setfattr -x trusted.glusterfs.volume-id /disk1

      setfattr -x trusted.gfid /disk1

      rm -rf /disk1/.glusterfs

      <cluster>

      rocks run host "setfattr -x trusted.glusterfs.volume-id /disk1"

      rocks run host "setfattr -x trusted.gfid /disk1"

      rocks run host "rm -rf /disk1/.glusterfs"

     

    * gluster volume create gv10 replica 3 과 같이 replica 설정시에는 brick의 수가 replica 수의 배수만큼 있어야 한다.

    * 볼륨 생성후 조금 시간 후 (약 10초?) 다른 명령어 주길 권함

    * 볼륨 구성은 되나, 마운트가 되지 않을 때

      --> network 상에서 latency time이 길어지게 되면, / 밑에 core 파일을 생성하고 에러가 발생한다.

      --> gfs로 구성시에는 network interface에 대한 고민을 해야한다. rdma

      --> 특히 볼륨구성후 nfs를 사용할때에는 대표되는 서버를 설정하게 되는데, 이 때에 특히 대표되는 서버로부터의 network load balancing을 생각하여 network 구성이 되어 있어야 performance가 나올 수 있다.

    * 경험상 모두 1G로 구성된 상황에서 40개 서버, 240개 brick 으로 replica 3 을 주어 115T 까지 구성되었음 (performance는 안나옴)

    * 마운트 가 되지 않을 때에는 / 밑에 core 파일이 생성되었는지 확인 (많은 브릭수)

    * 마운트 되는 서버의 디렉토리가 brick 에 포함되어 있어야 함. 이렇게 해야 비교적 많은 brick 가지고 glusterfs 구성해서 마운트 할때 에러나지 않음.

     

    <cluster>

    * 모든 노드에서 볼륨 정보가 잘 공유되었는지 확인하려면 rocks run host "hostname; ls -la /var/lib/glusterd/vols/gv | wc -l" 로 확인

5. 마운트

    $> mount -t glusterfs <ip_address>:/<volume_name> /gfsshare/

glusterfs 를 구성하기 위해서는 인프라 설계부터 glusterfs 를 위한 방식으로 구성되어야 performance가 날 수 있다. 즉, 하나의 서버의 로칼 디스크는 raid5 등으로 묶어 서버를 하나의 brick 으로 사용할 수 있게 한다. 그리고 구성해야하는 사이즈가 100T 이상일 경우에는 bonding 방법이나 10G 등과 같이 network bandwidth를 충분히 잡아 줘야 구성도 되고 속도도 나온다. glusterfs에서는 10G 구성이 가능하게 모듈을 지원한다. 결국 이 방법도 사이즈를 크게 하려면 돈이 많이 든다는 이야기이다. 결국 hadoop을 다시 써야 한다는 말인가..ㅋ

'TA > Common' 카테고리의 다른 글

grep 사용시 or 사용 방법  (0) 2013.02.04
umount: device is busy  (0) 2013.02.04
ssh 접속시 환영메시지 생성하는 방법  (0) 2013.02.04
설치된 OS 버전 확인  (0) 2013.02.04
disk 추가 후, partition, format  (0) 2013.02.04
Posted by 옥탑방람보
,

<단순한 텍스트로 구성할 경우>

$> vi /etc/motd

 

<색상을 넣고 싶은 경우>

$> vi create_motd.sh

    #!/bin/bash

    #define the filename to use as output

    motd="./motd"

    # Collect useful information about your system

    # $USER is automatically defined

    HOSTNAME=`uname -n`

    KERNEL=`uname -r`

    CPU=`uname -p`

    ARCH=`uname -m`

     

    # The different colours as variables

    Black="\033[0;30m"

    Red="\033[0;31m"

    Green="\033[0;32m"

    Blue="\033[0;33m"

    Purple="\033[0;34m"

    Cyan="\033[0;35m"

    Silver="\033[0;36m"

    DarkGray="\033[1;30m"

    LightBlue="\033[1;34m"

    LightGreen="\033[1;32m"

    LightCyan="\033[1;36m"

    LightRed="\033[1;31m"

    Yellow="\033[1;33m"

    White="\033[1;37m"

    X="\033[0;0m"

     

    clear > $motd # to clear the screen when showing up

    echo -e "$Red#=============================================================================#" >> $motd

    echo -e "   $White Welcome $Blue $USER $White to $Blue $HOSTNAME                " >> $motd

    echo -e "   $Red ARCH   $White= $ARCH                                   " >> $motd

    echo -e "   $Red KERNEL $White= $KERNEL                                 " >> $motd

    echo -e "   $Red CPU    $White= $CPU                                    " >> $motd

    echo -e "$Red#=============================================================================#" >> $motd

    echo -e "$Yellow

    This is a server to treat the personal information.

    If you have access to this server with unjustified way, you can receive legal penalty.

    Only your activities are allowed within the authority granted to you, and you can receive legal penalty for breaching it.

    You here all the activities are being recorded.

    In case of any problems, please feel free to contact abc@abc.com.

    (Tel. 010-0000-0000)" >> $motd

    echo -e "$X" >> $motd

$> chmod +x ./create_motd.sh

$> ./create_motd.sh

$> cp ./motd /etc/motd

 

'TA > Common' 카테고리의 다른 글

umount: device is busy  (0) 2013.02.04
glusterfs 3.3 설치 및 구성  (0) 2013.02.04
설치된 OS 버전 확인  (0) 2013.02.04
disk 추가 후, partition, format  (0) 2013.02.04
yum  (0) 2013.02.04
Posted by 옥탑방람보
,

$> cat /etc/redhat-release

Posted by 옥탑방람보
,

파티셔닝

$> fdisk -l 로 장치 확인

(여기에서는 /dev/vdb1 으로)

$> fdisk /dev/vdb1

n (add a new partition), p (primary partition), 1 (partition number), 1 (First cylinder), 2080506 (Last cylinder), w (write table to disk and exit)

 

포맷

$> mkfs.ext4 /dev/vdb1  # 포맷

$> parted -l  # 확인

$> mount -t ext4 /dev/vdb1 /data/

 

라벨, fstab

$> e2label /dev/vdb1 /disk1

$> vi /etc/fstab

  LABEL=/disk1   /data   ext4  defaults 1 2

 

Posted by 옥탑방람보
,

yum

TA/Common 2013. 2. 4. 14:31

$> yum update QUERY

$> yum search QUERY

$> yum install QUERY

$> yum list *QUERY*

$> yum provides */xclock

 

Posted by 옥탑방람보
,

WARNING! The remote SSH server rejected X11 forwarding request.

 

SSH 접속시 위와 같은 경고 메시지가 발생되고 x11 이 실행되지 않을 때,

 

$> yum install xauth

'TA > Common' 카테고리의 다른 글

disk 추가 후, partition, format  (0) 2013.02.04
yum  (0) 2013.02.04
VirtualBox 4.2.6 on Fedora 18/17, CentOS/Red Hat (RHEL) 6.3/5.8  (0) 2013.01.14
서브넷마스크 (subnet mask)  (0) 2012.12.28
IP 주소  (0) 2012.12.28
Posted by 옥탑방람보
,

1. Change to root User
   su -
   ## OR ##
   sudo -i

2. Install Fedora or RHEL Repo Files
   cd /etc/yum.repos.d/
 
   ## Fedora 18/17/16/15/14/13/12 users
   wget
http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
 
   ## CentOS 6.3/6.2/6.1/6/5.8 and Red Hat (RHEL) 6.3/6.2/6.1/6/5.8 users
   wget
http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

3. Update latest packages and check your kernel version
   Update packages

   yum update

   Check that that you are running latest installed kernel version
   Output of following commands version numbers should match:

   rpm -qa kernel |sort |tail -n 1
 
   uname -r

   Note: If you got kernel update or run older kernel than newest installed then reboot:

   reboot

4. Install following dependency packages
   CentOS 6/5 and Red Hat (RHEL) 6/5 needs EPEL repository, install it with following command:

   ## CentOS 6 and RHEL 6 ##
   rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 
   ## CentOS 5 and RHEL 5 ##
   rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
   yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
 
   ## PAE kernel users install ##
   yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-PAE-devel dkms

5. Install VirtualBox Latest Version 4.2 (currently 4.2.6)
   yum install VirtualBox-4.2

   Note:
   This command create automatically vboxusers group and VirtualBox user must be member of that group.
   This command also build needed kernel modules.

   Rebuild kernel modules with following command:

   /etc/init.d/vboxdrv setup
   ## OR ##
   service vboxdrv setup

6. Add VirtualBox User(s) to vboxusers Group
   Replace user_name with your own user name or some another real user name.

   usermod -a -G vboxusers user_name

7. Start VirtualBox
   Use launcher from menu or simply run:

   VirtualBox

Troubleshooting
   If you have problems with KERN_DIR parameter or your kernel directory is not automatically detected then set KERN_DIR environment variable manually, using following method:

   ## Current running kernel on Fedora ##
   KERN_DIR=/usr/src/kernels/`uname -r`
 
   ## Current running kernel on CentOS and Red Hat (RHEL) ##
   KERN_DIR=/usr/src/kernels/`uname -r`-`uname -m`
 
   ## Fedora example ##
   KERN_DIR=/usr/src/kernels/2.6.33.5-124.fc13.i686
 
   ## CentOS and Red Hat (RHEL) example ##
   KERN_DIR=/usr/src/kernels/2.6.18-194.11.1.el5-x86_64
 
   ## Export KERN_DIR ##
   export KERN_DIR

 

'TA > Common' 카테고리의 다른 글

yum  (0) 2013.02.04
[SSH] WARNING! The remote SSH server rejected X11 forwarding request.  (0) 2013.02.04
서브넷마스크 (subnet mask)  (0) 2012.12.28
IP 주소  (0) 2012.12.28
ip주소 표시할때 뒤에 쓰는 /24 /25 /26  (0) 2012.12.28
Posted by 옥탑방람보
,

C class에 아이피를 모두 사용할때에는

서브넷마스크는 255.255.255.0 가 된다.

즉 11111111.11111111.11111111.00000000 이 되어 마지막 자리에 올 수 있는 254(256-2)개 만큼 모두 사용할 수 있다.

만약 두개로 나누어 사용하고자 한다면

서브넷마스크는 255.255.255.128 가 된다.

즉 1111111.11111111.11111111.1000000 이 되어 마지막 자리수의 첫번째 비트가 0인 경우와 1인 경우로 나뉘게 되어 네트워크당 124(126-2)개를 사용할 수 있게 된다.

만약 네개로 나누어 사용하고자 한다면

서브넷마스크는 255.255.255.192 가 된다.

192.168.1.0000 0000 -> 192.168.1.0 ~ 192.168.1.63

              01           -> 192.168.1.64 ~ 192.168.1.127

              10           -> 192.168.1.128 ~ 192.168.1.191

              11           -> 192.168.1.192 ~ 192.168.1.255

이렇게 되면 각 네트워크당 64개가 되고, 각 네트워크 IP의 제일 처음과 끝 값은 각각 넷ID, 브로드캐스트로 할당되므로 결과 네트워크당 62개의 IP 사용이 가능해진다.

 

* 한 네트워크당 가장 앞자리는 넷ID값이 되고 뒤에 오는 수는 브로드캐스트 값이 되므로 이 두개의 IP는 사용할 수 없다.

 

Posted by 옥탑방람보
,

IP 주소

TA/Common 2012. 12. 28. 16:26

IP주소가 192.168.98.28 이라면 이것은 실제 2진수로 되어 있다.

즉 1100 0000.1010 1000.0110 0010.0001 1100 이렇게 된다.

 

IP주소는 class로 구분된다.

A class는 첫번째 자리가 1~126 사이값으로 한 네트워크 안에 최대 호스트수 16,777,214 개가 된다.

(첫번째 자리가 1일 경우 나머지 세자리에 올수 있는 경우 256*256*256-2)

B class는 첫번째 자리가 127~191 사이값이 되고 두번째 자리까지 정해져 할당되어 한 네트워크 안에 최대 호스트수 65534

(256*256-2)

C class는 192~223 으로 세번째 자리까지 정해져 할당되어 254개

(256-2)

D class는 224~239

E class는 240~255

 

C class가 가지고 있는 254개 호스트에 ip주소를 모두 부여했다고 했을 ‹š는

서브넷마스크는 255.255.255.0

B class 는 255.255.0.0

A class 는 255.0.0.0

이 된다.

Posted by 옥탑방람보
,