32位系统静态编译TCMalloc到Mysql5.1.51(Linux CentOS 5.5)
2010-10-29 11:24
615 查看
下载google-perftools-1.6.tar.gz
wget http://google-perftools.googlecode.com/files/google-perftools-1.6.tar.gz
tar zxvf google-perftools-1.6.tar.gz
执行./configure
make && make install
ldconfig
可以看到/usr/local/lib下出现了以libtcmalloc开头的so文件
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig
安装mysql5.1.51
要执行的预编译指令
CFLAGS="-O3"
CXX=g++
CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
修改MySQL启动脚本(根据你的MySQL安装位置而定):
vi /usr/local/mysql/bin/mysqld_safe
在# executing mysqld_safe的下一行,加上:
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so
保存后退出,然后重启MySQL服务器。
4、使用lsof命令查看tcmalloc是否起效:
/usr/sbin/lsof -n | grep tcmalloc
如果发现以下信息,说明tcmalloc已经起效:
mysqld 10847 mysql mem REG 8,5 1203756 20484960 /usr/local/lib/libtcmalloc.so.0.0.0
在 CentOS 5.5 下编译安装MySQL时出错:
/bin/rm: cannot remove `libtoolT': No such file or directory
解决方法是:
在执行./configure 之前,先执行:
# yum install automake autoconf libtool
# autoreconf --force --install
# libtoolize --automake --force
# automake --force --add-missing
正确运行以上命令后在执行./configure进行编译即可
wget http://google-perftools.googlecode.com/files/google-perftools-1.6.tar.gz
tar zxvf google-perftools-1.6.tar.gz
执行./configure
make && make install
ldconfig
可以看到/usr/local/lib下出现了以libtcmalloc开头的so文件
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig
安装mysql5.1.51
要执行的预编译指令
CFLAGS="-O3"
CXX=g++
CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
yum install gcc yum install gcc-c++ groupadd mysql useradd --shell /sbin/nologin -g mysql mysql tar zxvf mysql-5.1.51.tar.gz cd mysql-5.1.51 mkdir -p /usr/local/mysql/data ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=gbk,gb2312,latin1,binary --without-docs --with-mysqld-user=mysql --localstatedir=/usr/local/mysql/data --with-big-tables --without-ndb-debug --with-pthread --enable-assembler --with-mysqld-ldflags=-all-static --with-mysqld-ldflags=-ltcmalloc --with-client-ldflags=-all-static --enable-thread-safe-client make make install cp support-files/my-medium.cnf /etc/my.cnf cp support-files/mysql.server /etc/init.d/mysql chmod u+x /etc/init.d/mysql cd /usr/local/mysql bin/mysql_install_db --user=mysql chown -R root . chown -R mysql data chgrp -R mysql . chkconfig --add mysql chkconfig --level 345 mysql on bin/mysqld_safe --user=mysql & service mysql restart ln -s /usr/local/mysql/bin/mysql /sbin/mysql ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin mysqladmin -uroot password "yourpassword"
修改MySQL启动脚本(根据你的MySQL安装位置而定):
vi /usr/local/mysql/bin/mysqld_safe
在# executing mysqld_safe的下一行,加上:
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so
保存后退出,然后重启MySQL服务器。
4、使用lsof命令查看tcmalloc是否起效:
/usr/sbin/lsof -n | grep tcmalloc
如果发现以下信息,说明tcmalloc已经起效:
mysqld 10847 mysql mem REG 8,5 1203756 20484960 /usr/local/lib/libtcmalloc.so.0.0.0
在 CentOS 5.5 下编译安装MySQL时出错:
/bin/rm: cannot remove `libtoolT': No such file or directory
解决方法是:
在执行./configure 之前,先执行:
# yum install automake autoconf libtool
# autoreconf --force --install
# libtoolize --automake --force
# automake --force --add-missing
正确运行以上命令后在执行./configure进行编译即可
相关文章推荐
- linux(ubuntu 10.10) 64位系统 gcc编译(c)成32位(静态)可执行应用程序的方法
- linux系统下配置网桥(CentOS 5.5)
- centos 64位linux系统下安装appt(只有32位)命令的apktool工具包的笔记
- centos7.3.1611 虚拟机Linux系统下编译mysql到一半(我的是47%)卡死解决办法
- linux系统Qt调用opencv的编译过程(ubuntu14.04 kylin+qt5.5+opencv2.4.10)
- PHP5.3.3源代码编译安装(Linux CentOS 5.5)
- Linux系统32位--Centos5.6 与 Ubuntu11.04 的稳定比较(两个月内)
- CentOS 5.5 Linux:挂载Windows NTFS 文件系统
- 在64位Linux系统交叉编译32位软件:ffmpeg
- linux(centos5.5)下编译php时的一些典型错误及解决办法。
- RedHat Enterprise Linux 5.5 系统下使用rpm安装gcc(32位)
- 【Linux】CentOS5.5系统定制
- VMvare12中安装开源linux系统CentOS6.3_32位+处理器不支持虚拟化(此主机不支持Intel VT-x)+两个IOS组成一个完整系统镜像
- 搭建Linux(centos5.5)+Apache2+Mysql5+Php5+zabbix1.8.5系统环境实现网络状况监控
- linux x86(64位/32位)系统 libevent 编译安装说明
- 配置xmanager5连接虚拟机中的linux(基于centos5.5 32位)
- linux系统下配置网桥(CentOS 5.5)
- linux(centos5.5)下编译php时的一些典型错误及解决办法。
- 最新Linux(CentOS5.5)搭建GFS系统--iSCSI+GFS实现网络存储