ERROR总结

1.连接问题

Cannot get a connection, pool error Timeout waiting for idle object

解决:

排查思路:
  1.检查是否应用压力过大,无法获取空闲连接
      查看cpu、内存
      查看tomcat的连接数(netstat -natp | grep ESTAB | grep PORT | wc -l)
    
  2.检查应用是否很好的释放了连接(查看数据库的连接数)
      数据库(可通过配置参数完成自动回收)

解决:
  1.应用:
     acceptCount队列长度,默认100
     maxConnections最大连接数;对于Java的阻塞式BIO,默认值是maxthreads的值,在BIO使用定制的Executor执行器:默认值是执行器中的maxthreads值;java新的NIO模式:默认值10000;如果设置为-1,则禁用maxconnections功能,表示不限制tomcat容器的连接数.
     maxThreads最大线程数,默认200;线程数的经验值为:1核2g内存为200,线程数经验值200;4核8g内存,线程数经验值800

     maxConnections和acceptcount的关系为:当连接数达到最大值maxConnections后,系统会继续接收连接,但不会超过acceptCount的值.

   2.数据库(oracle):
     修改sqlnet.ora文件,新增expire_time=x(单位是分钟)
     create profile profileName limit connect_time 60 idle_time 30;创建profile文件,profileName任意起,connect_time设置连接超过多少分钟后强制释放,idle_time设置连续不活动的会话超过多少分钟后强制释放
     参考链接:https://blog.csdn.net/weixin_39517560/article/details/111484161?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_baidulandingword-2&spm=1001.2101.3001.4242



2.磁盘的使用率突然增加到100%

1. df -h查看磁盘占用达到100%

2. 首先对磁盘的所有文件进行统计,查看是否真正满了
>>>结果发现并没有满,由此可见,磁盘占满问题并不是存储数据导致的

3.查看inode,df -i
>>>结果发现,inode使用率也不高,那就奇怪了

4.最后找出原因:是由于正在删除的文件,导致空间不释放的问题
>>>查看一下:lsof -w |grep deleted
   查找出问题,找出它的PID,然后kill -9 PID号    #谨记在kill前,一定要搞清楚是什么问题,切不要随意kill,可能会引发问题!

5. 再查看一下磁盘的情况(df -h),结果发现磁盘正常了!

3.Mysql数据库的导入导出问题

ERROR 2006 (HY000) at line 135463: MySQL server has gone away

经查看,是由于max_allowed_packet参数太小导致,默认为1M

MySQL [(none)]> show global variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+

解决

#临时(更改为16M)
set global max_allowed_packet = 67108864

#永久
在my.cnf配置文件中修改加上参数:  max_allowed_packet = 16M

4.nginx编译安装出错

./configure: error: the invalid value in --with-ld-opt="-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E"

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

除了这些各种报错,记得编译前安装/更新依赖包

解决

yum -y install redhat-rpm-config.noarch  pcre-devel openssl openssl-devel  libxslt-devel   gd-devel   perl-ExtUtils-Embed

5.Openssl编译安装出错

Can't locate Getopt/Long.pm in @INC #提示我需要安装Getopt/Long这个模块

解决

在  https://metacpan.org  下载Getopt::Long模块,解压至/usr/local/src下,执行
perl Makefile.PL  
#报错
Can't locate ExtUtils/MakeMaker.pm in @INC

#解决办法:
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

生成模块:make

测试模块(这步可有可无):
make test

make install

再重新编译Openssl,成功
posted @ 2021-05-11 13:54  Ming·go  阅读(303)  评论(0)    收藏  举报