'CentOS'에 해당되는 글 5건

  1. 2009.07.06 :: CentOS 5 에서 MySQL 5.1 사용하기..
  2. 2008.07.10 :: 10TB 스토리지.. 2
  3. 2007.08.21 :: CentOS 4.5 yum update시 missing error. 2
  4. 2007.03.10 :: 스토리지... 8
  5. 2006.12.06 :: 최근 막아야 되는 봇 리스트 2
리눅스 2009. 7. 6. 09:54
회사에 새로운 솔루션이 도입이 되면서, DBMS의 파티셔닝 테이블을 필요로 했다.
그리고 MySQL은 5.1부터 파티셔닝 테이블을 지원한다.
그러나...
CentOS 5에서는 MySQL 5.0 버전을 지원하고 있는 관계로 그냥 사용할 수가 없다.

물론 간단히 소스컴파일 해서 사용하면 되지 않겠냐고 말하는 분들 있겠지만..
과감히 이런 멘트를 날려준다.
'아직도 컴파일이 멋지다고 생각하는가? 가장 좋을거라 생각하는가? 착각이다'
최적의 환경에서, 최적의 빌드옵션으로 빌드 할 자신 없다면 관둬라
불필요한 컴파일로 성능저하나 안일어나면 다행이다.

서론이 길었다.
그럼 어떻게 해야될까? 나의 repo tree를 뒤적뒤적 찾아보니...
오! thanks for Remi!!
MySQL 5.1을 지원해주고 있는 repository를 찾았다. (덤으로 PHP 5.2까지..)
바로 설치에 들어가보자 고고싱..

1. Remi의 yum repository 세팅
[root@localhost]# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
[root@localhost]# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
[root@localhost]# rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
/etc/yum.repos.d 안에 remi.repo 파일과 epel.repo 파일이 생성이 된다.
이제 사용할 준비가 완료 되었다. (너무 쉬운가?!)

2. MySQL 설치
[root@localhost]# yum --disablerepo \* --enablerepo remi install mysql
[root@localhost]# yum --disablerepo \* --enablerepo remi install mysqlclient15 mysqlclient15-devel
[root@localhost]# yum --disablerepo \* --enablerepo remi install mysql-server mysql-libs mysql-devel
remi의 repo를 enable 시켜줌과 동시에 모든 repo를 disable 시켜주는 이유는
centos base repo의 mysql(5.0)과 remi의 mysql(5.1)이 중복되지 않게 하기 위해서이다.

그리고 두번째 라인의 mysqlclient15 패키지는.. PHP에서 사용하는 라이브러리가 들어있다.
완전히 독립적인 DB 서버의 경우는 설치하지 않아도 되지만,
APM이 하나의 서버에서 운영되는 경우에는 반드시 설치해야 의존성 에러를 피할 수 있다.

자 설치가 다 끝났다. 이제 잘 쓰자.
참 쉽죠잉~?!
posted by 티니
:
리눅스 2008. 7. 10. 11:47

작년초 구입했던 6TB DAS 용량이 거의 풀인 관계로...
이번엔 10TB DAS를 구입했다.

헤더는 147GB SAS 2.5' 10k * 4EA로 구성되어 있고, RAID-10으로 묶어둔 상태이다.
바디는 뭐 말할것두 없이 RAID-5이고...

OS는 CentOS 5.2 x86_64 버전을 설치 했다.

헤더에 OS 설치하고, 바디 파티션 세팅하기에 앞서 이거저거 생각하다보니.. 음...-_-
ext3는 8TB 밖에 지원이 안되네.. 흠흠..
그래서 xfs를 사용하기로 결정했다. (ext4가 어여 stable이 되었으면 좋겠건만...)

자.. 우선 fdisk로 확인을 해보자..
[root@str3 ~]# fdisk -l
Disk /dev/sda: 292.3 GB, 292326211584 bytes
255 heads, 63 sectors/track, 35539 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          33      265041   83  Linux
/dev/sda2              34         425     3148740   83  Linux
/dev/sda3             426         686     2096482+  83  Linux
/dev/sda4             687       35539   279956722+   5  Extended
/dev/sda5             687        1991    10482381   83  Linux
/dev/sda6            1992        2252     2096451   82  Linux swap / Solaris
/dev/sda7            2253        2513     2096451   82  Linux swap / Solaris
/dev/sda8            2514        2774     2096451   83  Linux
/dev/sda9            2775        2839      522081   83  Linux
/dev/sda10           2840       35539   262662718+  83  Linux
 
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
 
 
Disk /dev/sdb: 10494.4 GB, 10494484152320 bytes
255 heads, 63 sectors/track, 1275881 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System

흠흠... fdisk에서 졸라 큰 파티션(10494.4GB/10TB)을 발견했다고 경고를 한다.
걍 쌩까자-_-);; 쟤는 맨날 저런다-_-;;

이제 파티션을 구성해야겠지?
지난번 6TB DAS 세팅할때도 말했지만.. fdisk에선 2TB 이상 지원 못한다.
그러니 parted 유틸리티를 이용하자.
[root@str3 ~]# parted /dev/sdb
GNU Parted 1.8.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
 
Model: DELL PERC 6/E Adapter (scsi)
Disk /dev/sdb: 10.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
 
Number  Start  End  Size  File system  Name  Flags
(parted) mkpart
Partition name?  []?
File system type?  [ext2]? xfs
Start? 0
End? 10.5TB
(parted) p
Model: DELL PERC 6/E Adapter (scsi)
Disk /dev/sdb: 10.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  10.5TB  10.5TB
(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.

자.. 이제 파티션을 생성했으니.. 파일시스템을 생성해서 사용하기만 하면 된다.
그러나 여기서 잠깐!
이 상태에서는 xfs 파일시스템을 생성할 수가 없다.
왜냐하면, redhat 에서는 기본적으로 xfs를 서포트하고 있지 않기 때문이다.
따라서 몇가지 xfs 관련 패키지를 설치해주어야 된다.
[root@str3 ~]# yum -y install xfsprogs xfsdump kmod-xfs
Setting up Install Process
...
...
Complete!

패키지를 모두 설치했으면, 이제 파일시스템을 생성해보자.
[root@str3 ~]# mkfs -t xfs /dev/sdb1
meta-data=/dev/sdb1              isize=256    agcount=32, agsize=80066559 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=2562129888, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096 
log      =internal log           bsize=4096   blocks=32768, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0

정상적으로 파일시스템이 생성되었다.
이제 마운트하고 잘 쓰자 -_-);;
posted by 티니
:
리눅스 2007. 8. 21. 19:24
오늘 CentOS 4.5 plus 미러를 enabled 시켜서 사용하는 시스템을
yum으로 업데이트 시키다 보니 아래와 같은 문제가 발생했다.
[root@localhost]# yum update
Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package perl-libwww-perl.noarch 0:5.805-1.1.1 set to be updated
--> Running transaction check
--> Processing Dependency: perl(Compress::Zlib) for package: perl-libwww-perl
--> Finished Dependency Resolution
Error: Missing Dependency: perl(Compress::Zlib) is needed by package perl-libwww-perl

가끔씩 패키지 버전이 올라가면서 문제가 생기는 일이 발생하기에
아무생각없이 yum list perl* 을 날렸는데....
얼레.. Zlib 패키지가 없다??

한참을 삽질하다가 결국 센트 메인테이너에게 질문을 날렸고.. 급 후회를 했다 ㅜ.ㅜ
A: please read this http://bugs.centos.org/view.php?id=2255
A: you probably have a non-CentOS libwww-perl
A: whoops
A: it is indeed a bug ;)
A: workaround is in that bugreport

왜 질문하기전에 bugs.centos.org를 검색하지 않았을까.....
가장 기초적인 실수를 해서 그런지 얼굴이 다 화끈거렸다.
내가 늘 강조하는게 '질문하기전 검색부터' 인데...

결론적으로는...
http://mirror.centos.org/centos-4/4.5/fasttrack/
위 URL에 있는 CentOS-fasttrack.repo 파일을 /etc/yum.repos.d/ 안에 넣어주면 되는것..
[root@localhost]# cd /etc/yum.repos.d/
[root@localhost]# wget http://mirror.centos.org/centos-4/4.5/fasttrack/CentOS-fasttrack.repo
[root@localhost]# yum update


그리고 저사람이 나에게 마지막으로 날린 결정적인 한마디...
'엔드유저도 아닌 당신이 이런 실수를 할지 몰랐다. 요즘 바쁜가보다.'
.....
부끄러워서 할 말을 잃었다... ㅠ_ㅠ
posted by 티니
:
리눅스 2007. 3. 10. 21:00
이번에 회사에서 6TB DAS 스토리지 2대를 구입했다. (모델명: Dell社의 MD1000)

원래 3월 6일에 입고 예정이었던 스토리지가 3월 7일과 3월 8일에 양일에 걸쳐 도착했다.
그리고 델 엔지니어가 3월 9일에 도착해서 스토리지를 뜯었다.
(도착하는것부터가 아주 짜증나게 만드는 델-_-..)

다 뜯어놓고 하는말이 지들이 해줄 수 있는건 '뜯어주는것과 RAID 세팅까지만' 이란다-_-;;
(어짜피 첨부터 바라지도 않았으니 별로 신경 안쓴다)
그래서 걍 레이드나 잡으라고 하고 커피나 한잔 홀짝홀짝..

헤더에 있는 300G HDD 2개는 RAID-1로 구성해서 미러링을 하도록 하고..
스토리지의 500G HDD 15개는 RAID-5로 구성해서 14개는 돌리고 1개는 Hot Spare로..

RAID 세팅도 끝났으니 이제 OS 인스톨링...

두둥..
헤더가 /dev/sda로 잡혀야 되는데 /dev/sdb로 잡힌다..
기존 스토리지와 반대로 잡혀 있어서 추후 헷갈릴까봐 이래저래 삽질했었으나..
별 소득 없이 그냥 쓰기로 결정..
첫번째 테클은 이렇게 넘어갔다.

꽤나 크리티컬한 테클은 바로 여기서부터...
리눅스 부팅하고 root로 들어가서 fdisk -l 했더니 아래와 같이 잘 잡혀있는것을 확인..
[root@str1 ~]# fdisk -l
Disk /dev/sda: 6494.2 GB, 6494258987008 bytes
255 heads, 63 sectors/track, 789548 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

fdisk에선 2TB 이상의 파티션을 지원못하니까.. parted를 이용해서 생성해야 된다.
[root@str1 ~]# parted /dev/sda
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.
 
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
Using /dev/sda
(parted) mklabel gpt
(parted) p
Disk geometry for /dev/sda: 0.000-6193408.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
(parted) mkpart
Partition type?  [primary]?                                              
File system type?  [ext2]?                                               
Start? 0                                                                 
End? 6193408                                                             
(parted) p                                                               
Disk geometry for /dev/sda: 0.000-6193408.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017 6193407.983  ext2
(parted) quit                                                            
Information: Don't forget to update /etc/fstab, if necessary.

자 여기까지.. 파티션을 만들어 주는 과정에는 전~~~혀 아~~무 문제 없이 잘!! 됐다.
그러나 나의 스트레스 신경을 Power on 해주신 멋진 분!!
[root@str1 ~]# mkfs -t ext3 /dev/sda1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
792756224 inodes, 1585512439 blocks
36325948 blocks (2.29%) reserved for the super user
First data block=0
Maximum filesystem blocks=1589641216
48386 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544
 
Writing inode tables: done                           
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information:
SCSI error : <0 2 0 0> return code = 0x6000000
end_request: I/O error, dev sda, sector 12643992930
SCSI error : <0 2 0 0> return code = 0x6000000
end_request: I/O error, dev sda, sector 12661234252
...
...
done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

아니 왜! 기존에 쓰던 장비도 아닌데 I/O 에러가 뜨냔 말이다 -_-;;
그것두 두대 스토리지 동일하게... -_-;
여하튼 내 경험상 저건 파일시스템이 깨졌을때 나오는 메시지니까..
다시한번 파티션 날리고 동일하게 재생성...
[root@str1 ~]# parted /dev/sda
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.
 
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
Using /dev/sda
(parted) p                                                               
Disk geometry for /dev/sda: 0.000-6193408.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017 6193407.983  ext3                             
(parted) rm 1                                                            
(parted) p                                                               
Disk geometry for /dev/sda: 0.000-6193408.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
(parted) mkpart
Partition type?  [primary]?                                              
File system type?  [ext2]?                                               
Start? 0                                                                 
End? 6193408                                                             
(parted) p                                                               
Disk geometry for /dev/sda: 0.000-6193408.000 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017 6193407.983  ext3
(parted) quit                                                            
Information: Don't forget to update /etc/fstab, if necessary.

[root@str1 ~]# mkfs -t ext3 /dev/sda1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
792756224 inodes, 1585512439 blocks
36325948 blocks (2.29%) reserved for the super user
First data block=0
Maximum filesystem blocks=1589641216
48386 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544
 
Writing inode tables: done                           
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

얼레? 이번엔 또 문제 없이 잘 생성이 되네 그려?-_-;;
(이넘이 대체 나한테 무슨 원한이 있길래 ㅡ.ㅡ;;;)
아무 문제 없이 잘 진행되었지만 찝찝한 기분을 떨쳐버릴 수가 없는 관계로..
디스크에 read/write 테스트를 통해서 괜찮은지 확인하려고 badblocks를 이용..
[root@str1 ~]# badblocks -svw /dev/sda1
badblocks: 파일이 너무 큽니다 while trying to determine device size

헉쓰-_-;;;;;
파티션이 너무 크신감 -_-a..
어쩔 수 없이 e2fsck의 -c 옵션을 이용.. non-destructive read-write 테스트로 시도..
[root@str1 ~]# e2fsck -cvk /dev/sda1
e2fsck 1.35 (28-Feb-2004)
Checking for bad blocks (read-only test):
... [1번부터 15번까지 열심히 진행-.-]
...
...
Pass 1: Checking inodes, blocks, and sizes
 
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
 
/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
 
      11 inodes used (0%)
       1 non-contiguous inode (9.1%)
         # of inodes with ind/dind/tind blocks: 0/0/0
24909500 blocks used (1%)
       0 bad blocks
       1 large file
 
       0 regular files
       2 directories
       0 character device files
       0 block device files
       0 fifos
       0 links
       0 symbolic links (0 fast symbolic links)
       0 sockets
--------
       2 files

뭐.. 테스트상으로는 대략 아무 문제가 없으니 일요일부터 데이터 이전작업을 할 계획..
그러나 여전히 찜찜한 기분은 떨쳐 버릴수가 없단 말이지... 쩝..
posted by 티니
:
리눅스 2006. 12. 6. 22:44
약 2개월간의 데이터 수집끝에 최근 아파치 access 로그에 남는 referer 수집이 대략적으로 끝났다.
이 referer를 참고해서 검색엔진들의 봇을 막을 수 있을 것이다.
(물론 이것은 일시적이고 한정적이기 때문에, 계속해서 추가되어져야 되겠지만 말이다.)

액세스 로그를 분석했을 경우 나오는 리스트
웹로그 분석기로 분석한 이름 = 실제로 액세스 로그에 남는 이름
MS Internet Explorer = MSIE
Firefox = Firefox
Opera = Opera
Netscape = Netscape
Firbird (Old Firefox) = Firbird
K-Meleon = K-Meleon
Nokia Browser (PDA/Phone browser) = Nokia
Konqueror = Konqueror
Safari = Safari
Curl = Curl
Wget = Wget
Unknown robot (identified by 'robot') = NaverBot
Yahoo Slurp = Yahoo! Slurp
ConveraCrawler = ConveraCrawler
EchO! = BonEcho
GigaBot = GigaBot
findlinks = findlinks
MSNBot = MSNBot
Unknown robot (identified by 'bot/' or 'bot-') = msnbot-media
Alexa (IA Archiver) = Alexa Toolbar
Python-urllib = Unknown (딱 한번 긁혔던데 로그가 지워져서 모르겠음-_-;)
SurveyBot = SurveyBot
psbot = psbot
Googlebot = Googlebot
Feedfetcher-Google = Feedfetcher-Google
OufoxBot = OufoxBot
Netcraft = Netcraft

대충 보면 알겠지만 MSIE부터 Wget까지는 정상적인 브라우저들이다.
봇의 시작은 NaverBot 부터..
이게 굉장히 웃긴게 웹로그 분석기(awstats 기준)에서 보여주는 이름과
실제로 액세스 로그에 남는 이름이 서로 다른것들이 가끔씩 있다.
따라서 웹로그 분석기에서 출력해주는 이름을 가지고 막으면 대략 낭패를 볼 수 있으므로
주의를 해야할 것이다.

현재 tini4u.net 서버는 아래와 같이 차단하고 있다.
## No Get.
BrowserMatch "WebZIP" go_out
BrowserMatch "Teleport" go_out
BrowserMatch "NamoWebEditor" go_out
BrowserMatch "WebSymmetrix" go_out
BrowserMatch "GetRight" go_out
BrowserMatch "WebCopier" go_out
BrowserMatch "FlashGet" go_out
BrowserMatch "Nimo" go_out
BrowserMatch "Googlebot" go_out
BrowserMatch "MSNBot" go_out
BrowserMatch "msnbot-media" go_out
BrowserMatch "Yahoo" go_out
BrowserMatch "Feedfetcher-Google" go_out
BrowserMatch "Alexa" go_out
BrowserMatch "OutfoxBot" go_out
BrowserMatch "Netcraft" go_out
BrowserMatch "Gigabot" go_out
BrowserMatch "findlinks" go_out
BrowserMatch "NaverBot" go_out

하나의 사이트에서도 여러개의 봇을 운영하는것을 느꼈는가?
검색엔진 잔인하다-_-;;

추가 -> BonEcho는 현재 Gentoo Linux에서 테스트로 사용중인 FireFox의 Compatible Name 이라고 하는군요.
posted by 티니
: