트위에서 공개한 MySQL 을 설치해 봅시다!!


Twitter open sources its MySQL work



# Project Home


https://github.com/twitter/mysql




# twitter-mysql 이야기


http://www.zdnet.co.kr/news/news_view.asp?artice_id=20120411173415


http://www.bloter.net/archives/104962


http://ds5apn.wordpress.com/2011/12/21/twitter-%EB%8A%94-%EC%96%B4%EB%96%BB%EA%B2%8C-mysql-%EC%9D%84-%EC%9D%B4%EC%9A%A9%ED%95%B4-%ED%95%98%EB%A3%A8-2%EC%96%B55%EC%B2%9C%EB%A7%8C-tweets-%EC%9D%84-%EC%A0%80%EC%9E%A5%ED%95%98%EB%8A%94/


http://venturebeat.com/2012/04/09/twitter-open-sources-its-mysql-work/




# 설정, 설치관련


http://gywn.net/2011/12/mysql-installation-on-linux/



설치(테스트)환경

CentOS 6.2 minimal on Hyper-V

i7-2600K 3.40GHz 2개 할당

1GB 메모리




#참고자료 


http://dev.mysql.com/doc/refman/5.5/en/source-installation.html

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

컴파일 하려면 받을것이 많이 있습니다.

yum -y update; yum groupinstall -y "Development Tools" "Development Libraries"; yum install -y cmake bzip2-devel SDL-devel esound-devel wxGTK-devel wget libc-client-devel openssl-devel ncurses-devel

저는  부분에서 커널도 설치되어 리부팅 하였습니다.

twitter-mysql 최신판 받기

wget http://github.com/twitter/mysql/tarball/master

 

tar zxvf master

cd twitter-mysql-8d9e45d

몇가지 옵션을 주었습니다. (사용안하는 엔진 제거문자셋 설정)

cmake -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all .

아래부분은 http://dev.mysql.com/doc/refman/5.5/en/installing-source-distribution.html 참고(조금 수정)

#Preconfiguration setup

groupadd mysql

useradd -r -g mysql mysql

#Beginning of source-build specific instructions
#tar zxvf mysql-VERSION.tar.gz
#cd mysql-VERSION
#cmake .

make

#여기서 주의!!! (line 47? : README파일 빼버리고)

vi cmake_install.cmake

make install

#End of source-build specific instructions
#Postinstallation setup

cd /usr/local/mysql

chown -R mysql .

chgrp -R mysql .

scripts/mysql_install_db --user=mysql

chown -R root .

chown -R mysql data

mkdir /var/run/mysqld

chown mysql.mysql -R /var/run/mysqld

 

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

#Next command is optional (환경 설정 필요합니다.)
#cp support-files/my-medium.cnf /etc/my.cnf

/usr/local/mysql/bin/mysqld_safe --user=mysql &

/usr/local/mysql/bin/mysqladmin -u root password

시작해보기

/usr/local/mysql/bin/mysql -r mysql -p

#Next command is optional

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

서비스 등록

cd /etc/rc.d/init.d

/sbin/chkconfig --add mysqld

/sbin/chkconfig --level 345 mysqld on

서비스 시작

./mysqld start

 

 

환경설정은 상황에 맞게 부탁드립니다~