问题八
启动Apache报错:
[Sun Dec 27 11:28:26 2009] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of “vm85.bc.com″
Configuration Failed
在/etc/hosts中添加:
127.0.0.1 vm85.bc.com
问题九
启动tomcat报错:
[[email protected] conf]# service tomcat stop
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
解决:
声明java路径
[[email protected] bin]# vi setclasspath.sh
export JAVA_HOME=/usr/java/jdk
问题十
mysql删除日志:
清空/data/db/目录下的slave-query.log相关日志文件中的内容
echo "">/data/db/slave-query.log
登陆mysql
mysql -u root -pbcgogo.com
查看从数据库正在访问的日志
SHOW SLAVE STATUS;
打印主数据库的所有正在使用的日志文件
SHOW MASTER LOGS;
删除日志
PURGE MASTER LOGS BEFORE ‘2012-03-10 13:00:00‘;(删除2012.03.10 13点前的数据文件)
问题十一
nagios 监控出现It appears as though you do not have permission
解决:
修改/etc/cgi.cfg
vi /usr/local/nagios/etc/cgi.cfg
use_authentication=1 #把1修改为0,保存
[email protected]#/service nagios restart
问题十二
主从mysql服务器,主服务器意外重启后,从服务器报错:
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘binlog truncated in the middle of event; consider out of disk space on master; the last event was read from ‘./mysql-bin.000644‘ at 227295136, the last byte read was read from ‘./mysql-bin.000644‘ at 227295232.‘
解决:
slave stop;
CHANGE MASTER TO MASTER_LOG_FILE=‘mysql-bin.000667‘, MASTER_LOG_POS=53530321;
slave start;
问题十三
nethogs监控linux主机进程网络流量
安装nethogs
make && make install
报错:
[[email protected] nethogs]# make && make install
g++ -g -Wall -Wextra -c packet.cpp
make: g++: Command not found
make: *** [packet.o] Error 127
安装gcc源:
[[email protected] nethogs]# yum -y install gcc+ gcc-c++
[[email protected] nethogs]# yum -y install libpcap-devel ncurses-devel
即可。
问题十四
linux swap分区被占用,解决:
释放内存即可:
#free -m ---查看内存使用情况;
#sync ---将内存中的数据写入硬盘;
#echo 3 > /proc/sys/vm/drop_caches ---删除内存缓存;
#cat /proc/sys/vm/drop_caches ---查看文件内容;
#free -m
要达到释放缓存的目的,我们首先需要了解下关键的配置文件/proc/sys/vm/drop_caches。
这个文件中记录了缓存释放的参数,默认值为0,也就是不释放缓存。他的值可以为0~3之间的任意数字,代表着不同的含义:
0 – 不释放
1 – 释放页缓存
2 – 释放dentries和inodes
3 – 释放所有缓存
在minaSocket.log.2015-01-19搜索ACCOFF关键字符串,按空格分段,并且截取第十段内容打印到12.txt文件中:
#grep -rn "ACCOFF" minaSocket.log.2015-01-19 |awk -F ‘ ‘ ‘{print $10}‘ >>12.txt