linux常见问题


Xend 无法启动
一、Xend无法启动,日志如下:
[2012-11-07 17:14:09 5036] INFO (SrvDaemon:339) Xend Daemon started
[2012-11-07 17:14:09 5036] INFO (SrvDaemon:343) Xend changeset: unavailable.
[2012-11-07 17:14:09 5036] ERROR (SrvDaemon:356) Exception starting xend (bogus escape (end of line))
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", line 346, in run
   relocate.listenRelocation()
File "/usr/lib64/python2.6/site-packages/xen/xend/server/relocate.py", line 154, in listenRelocation
   hosts_allow = map(re.compile, hosts_allow.split(" "))
File "/usr/lib64/python2.6/re.py", line 190, in compile
   return _compile(pattern, flags)
File "/usr/lib64/python2.6/re.py", line 245, in _compile
raise error, v # invalid expression
原因:因为/etc/xen/xend-config.sxp有过改动
解决方法:拷贝没有改动过的相同文件到问题目录下
#scp /etc/xen/xend-config.sxp [email protected]:/etc/xen/xend-config.sxp
二、Xend无法启动,日志如下:
xend服务无法重新启动,/var/lod/xen/xend.log日志如下
原因:数据库遭破坏,重命名数据目录名
#mv /var/lib/xend /var/lib/xend.bak
#/etc/init.d/xend restart
数据库编译安装
一、编译错误:
-- MySQL 5.5.21
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses library not found. Please install appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
解决方法:
[root@localhost mysql]# yum install ncurses
二、编译错误:
CMake Error at cmake/bison.cmake:78 (MESSAGE):
Bison (GNU parser generator) is required to build MySQL.Please install
bison.
Call Stack (most recent call first):
sql/CMakeLists.txt:189 (RUN_BISON)
解决方式
[root@oracle141 Percona-Server-5.5.18-rel23.0]# yum install bison
编译安装成功后Mysql无法启动
MYSQL无法启动报下面错误:
ERROR! MySQL (Percona Server) PID file could not be found!
Starting MySQL (Percona Server). ERROR! The server quit without updating PID file (/var/lib/mysql/xenserver5.pid).
解决方法:
到安装目录下拷贝mysql.server文件到/etc/init.d/,  拷贝my-large.cnf文件到/etc/my.cnf
如:cp /usr/local/mysql_percona5.5.25/support-files/mysql.server /etc/init.d/
Cp /usr/local/mysql/ support-files/ my-large.cnf /etc/my.cnf
然后给用户执行安装目录权限如给root用户设置权限
cd /usr/local/mysql
chown -R root .
sudo bin/mysqld_safe �Cuser=root &
设置后执行、/etc/init.d/mysql.server restart 成功启动
Mysql 数据库源代码编译安装
版本选择
使用分支:Percona
官网: http://www.percona.com/
版本:5.5.18(主要原因是taobao目前基于这个版本)
下载:
公司 ftp:/Software_dev/database server/mysql/src/Percona-Server-5.5.18-rel23.0.tar.gz
http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.18-23.0/source/
安装方式:从源代码编译
操作步骤:
可以参考MySQL官方文档: https://dev.mysql.com/doc/refman/5.5/en/installing-source-distribution.html
具体步骤
添加数据库使用的用户
?


shell> groupadd mysql
shell> useradd -r -g mysql mysql


执行编译安装
下载安装包并解压
?


shell>tar zxvf Percona-Server-5.5.25a-rel27.1.tar.gz
shell> cd Percona-Server-5.5.25a-rel27.1
shell> cmake . -DCMAKE_INSTALL_PREFIX={安装目录,建议这样定义/usr/local/mysql} -DSYSCONFDIR={配置文件目录,建议为安装目录/conf --DMYSQL_DATADIR={数据文件目录,/data/mysql/data}
shell> yum -y install ncurses-devel
shell> rm -rf Percona-Server-5.5.18-rel23.0
shell>tar zxvf Percona-Server-5.5.25a-rel27.1.tar.gz
shell> cd Percona-Server-5.5.25a-rel27.1
shell> cmake . -DCMAKE_INSTALL_PREFIX={安装目录,建议这样定义/usr/local/mysql} -DSYSCONFDIR={配置文件目录,建议为安装目录/conf --DMYSQL_DATADIR={数据文件目录,/data/mysql/data}
shell> yum -y install bison
shell> cmake . -DCMAKE_INSTALL_PREFIX={安装目录,建议这样定义/usr/local/mysql} -DSYSCONFDIR={配置文件目录,建议为安装目录/conf --DMYSQL_DATADIR={数据文件目录,/data/mysql/data}
shell> make
shell> make install


注意,MySQL 5.5开始使用cmake替代configure来进行编译配置。在编译时,指定-DCMAKE_INSTALL_PREFIX参数即可。
如果对编译参数有特别的需要,可以参考 http://forge.mysql.com/wiki/Autotools_to_CMake_Transition_Guide,里面有cmake和configure的参数对照关系以及参数的解释。
安装完成后,进行数据库配置
?


shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql --basedir={安装目录/usr/local/mysql } --ldata={数据文件目录,如果不指定,会使用默认的数据目录/data/mysql/data }
shell> chown -R root .
shell> chown -R mysql data
shell>cp /usr/local/mysql/ support-files/mysql.server /etc/init.d
shell>Cp /usr/local/mysql/ support-files/ my-large.cnf /etc/my.cnf
shell> chown -R root .给安装目录设置权限
shell>/etc/init.d/mysql.server restart
shell>vi /etc/profile
在最后面添加export PATH=$PATH:/usr/local/mysql/bin/
shell>source /etc/profile
shell>mysql
mysql>quit


创建数据库时,数据目录�Cldata可以根据需要进行调整。
存储引擎选择
公司应用统一使用innodb作为存储引擎。percona默认使用该存储引擎,所以不需要特别设置。
网卡程序无法更新
一、网卡程序无法更新,运行./autorun.sh出现如下提示:
Check old driver and unload it. Build the module and install
make: * /lib/modules/3.1.0-7.fc16.x86_64/build: No such file or directory. Stop.
make[1]: [clean] Error 2
make: ** [clean] Error 2
原因:没有安装内核更新包
#yum update kernel
#yum -y install kernel-headers
#yum -y install kernel-devel
yum -y groupinstall "Development Tools" "Legacy Software Development" "Development Libraries"
#./运行最新
1 Mysql 数据库主机名称改变后无法启动数据库服务 , 日志报错如下:
Starting MySQL (Percona Server).... ERROR! The server quit without updating PID file (/data/mysql/data/bigdata6.pid).
#Vi /data/mysql/data/bigdata2.err
121120 17:42:55 mysqld_safe Starting mysqld daemon with databases from /data/mysql/data
121120 17:42:55 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
121120 17:42:55 [Note] Flashcache bypass: disabled
121120 17:42:55 [Note] Flashcache setup error is : ioctl failed
121120 17:42:55 InnoDB: The InnoDB memory heap is disabled
121120 17:42:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121120 17:42:55 InnoDB: Compressed tables use zlib 1.2.3
121120 17:42:55 InnoDB: Initializing buffer pool, size = 1.0G
121120 17:42:56 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 2147483648 bytes!
121120 17:42:57 [ERROR] Plugin 'InnoDB' init function returned error.
121120 17:42:57 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
^G/usr/local/mysql_percona5.5.25/bin/mysqld: File '/data/mysql/logs/slow-queries.log' not found (Errcode: 13)
121120 17:42:57 [ERROR] Could not use /data/mysql/logs/slow-queries.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
121120 17:42:57 [ERROR] Unknown/unsupported storage engine: InnoDB
121120 17:42:57 [ERROR] Aborting
解决方法:
1. 当前日志文件过大,超出了my.cnf中定义的大小(默认为64M),删除日志文件再重启;(建议)
2. my.cnf文件配置过高,重新定义其中的参数(根据服务器情况定义);
3. 杀掉mysql_safe和mysqld进程,然后再重启;
4. 注释/etc/my.cnf里的skip-federated注释掉即#skip-federated;

二、 问题:启动mysql 服务时报如下错误Starting MySQL (Percona Server).The server quit without upd[FAILED]D file (/data/mysql/data/bigdata4.pid).
090119 03:18:12 mysqld_safe Starting mysqld daemon with databases from /data/mysql/data
090119 3:18:12 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
090119 3:18:12 [Note] Flashcache bypass: disabled
090119 3:18:12 [Note] Flashcache setup error is : ioctl failed
090119 3:18:12 InnoDB: The InnoDB memory heap is disabled
090119 3:18:12 InnoDB: Mutexes and rw_locks use GCC atomic builtins
090119 3:18:12 InnoDB: Compressed tables use zlib 1.2.3
090119 3:18:13 InnoDB: Initializing buffer pool, size = 1.0G
InnoDB: mmap(1103101952 bytes) failed; errno 12
090119 3:18:13 InnoDB: Completed initialization of buffer pool
090119 3:18:13 InnoDB: Fatal error: cannot allocate memory for the buffer pool
090119 3:18:13 [ERROR] Plugin 'InnoDB' init function returned error.
090119 3:18:13 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
^G/usr/local/mysql_percona5.5.25/bin/mysqld: File '/data/mysql/logs/slow-queries.log' not found (Errcode: 13)
090119 3:18:13 [ERROR] Could not use /data/mysql/logs/slow-queries.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
090119 3:18:13 [ERROR] Unknown/unsupported storage engine: InnoDB
090119 3:18:13 [ERROR] Aborting
090119 3:18:13 [Note] /usr/local/mysql_percona5.5.25/bin/mysqld: Shutdown complete
090119 03:18:13 mysqld_safe mysqld from pid file /data/mysql/data/bigdata7.pid ended
解决方法:
1、 修改配置文件参数vi /etc/my.cnf
2、拷贝my.cnf文件覆盖etc目录下的文件
3、重新初始化数据库
scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql_percona5.5.25/ --ldata=/data/mysql/data/

本文出自 “系统运维” 博客,谢绝转载!

你可能感兴趣的:(linux,技术)