有了一些进展,下面来记一些流水帐
新订购了一台机器作为主库使用,双xeon,quad core,1.6G,8G内存
300G的SAS硬盘
机器配置不错吧,呵呵,这也是我们公司所购买的最牛逼的一台机器了
os采用centos5 x86_64,
安装后分区时注意留出空间供建立快照使用,目的是用来作mysql的备份
安装后的优化:
1,关闭不用的服务,只留必要的四个daemon
2,mingetty只留下两个就行了
3,分区设置为不记录访问时间
4,关闭ipv6
5,优化sshd
X11Forwarding no
UseDNS no
6,优化shell
修改命令history记录
# vi /etc/profile
找到 HISTSIZE=1000 改为 HISTSIZE=50
然后 source /etc/profile
7. 对TCP/IP网络参数进行调整,加强抗SYN Flood能力
# echo ‘net.ipv4.tcp_syncookies = 1′ >> /etc/sysctl.conf
# sysctl -p
mysqld已安装上了,
选择的是社区版,mysql-5.0.45-linux-x86_64-glibc23
服务器已托管到机房
配置并启动了防火墙
mysql的优化:
1,复制相应的my.cnf文件,
cp my-innodb-heavy-4G.cnf /etc/my.cnf
2,# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size = 4G
这个最高可以设置为系统物理内存的80%,
我们保守一点,设置为4G,默认4G内存时它也是设置为2G
3,# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
#innodb_flush_log_at_trx_commit = 1
innodb_flush_log_at_trx_commit = 0
如等于1,则每次提交的更新事务(或者每个事务之外的语句)都会刷新到磁盘中
我们设置其为0以提高速度
4,vi /etc/rc.d/init.d/mysqld
添加: --skip-name-resolve --skip-external-locking 到启动参数
其他工作:设置mysqld为自启动
[root@datam rc3.d]# ln -s ../init.d/mysqld S57mysqld
安装gcc
安装apache
安装php
安装zend optimizer
安装cronolog
安装phpmyadmin
其他设置
1,设置skip-bdb,
因为默认已存在此项,所以不必另外设置
2,
先写到这儿吧