Home Database Mysql Tutorial 安全专家讲解 Mysql数据库故障诊断过程_MySQL

安全专家讲解 Mysql数据库故障诊断过程_MySQL

Jun 01, 2016 pm 02:02 PM
mysql expert Safety Fault database explain diagnosis process this

那天因参加MS的新品发布大会,中午就离开办公室,当我正在出租车上前往会场的途中,同事打电话来说主数据库出现写保护错误。这可不得了,所有的应用都靠这个数据库呀,我心里默念:千万不要出漏子,否则就不能参会了!于是我在电话里交代同事重启mysql数据库试试,还好,重启后问题解决。

一散会,就赶紧上去找故障原因。这里先描述一下平台环境,把逻辑关系弄清楚。在这个应用中,由一个web前段服务器,一个tomcat应用服务器及一个mysql服务器构成,所有的系统都是linux。用户的请求先到前端的apache服务器,如果请求页面是.jsp,apache就把请求转交给tomcat服务器,tomcat再从数据库获取数据或向数据库插入记录。这是典型的3层应用逻辑。

登录到数据库mysql服务器,用mysql客户端连接mysql数据库,执行命令 mysql > show processlist; 没发现什么异常,负载也很低。看来从这里看不出什么名堂。接下来当然该看mysql错误日志,发现如下异常:


安全专家讲解 Mysql 故障诊断过程

这个报错的大意是:内存基本耗尽,没有再可以分配的空间。由此判断是什么东西产生巨大的负荷导致系统内存被榨干了。不过现在数据库服务器已经趋于平稳,暂时查不到什么原因引起这个故障。

基本情况掌握了,停下来休息片刻,于是顺手收一下邮件,乖乖,来了一封报警邮件,赶紧打开,其内容如下:

安全专家讲解 Mysql 故障诊断过程

报警消息表明主机61.154.105.100在10:59的这个时间负载过大。而这个主机正好是tomcat服务器,看来问题就在这个上面.为了近一步确认自己的想法,我来查看一下网络流量:

安全专家讲解 Mysql 故障诊断过程

从流量图可以看出,产生异常流量的时间正好与报警信息的时间一致,再给同事打电话,问:“你们都在61.154.105.100 这个机器上干了啥?”,答:“执行了一条不正确的sql语句,发现问题后取消这个sql语句”。至此,原因查明!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1246
24
MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

How often should you regenerate session IDs? How often should you regenerate session IDs? Apr 23, 2025 am 12:03 AM

The session ID should be regenerated regularly at login, before sensitive operations, and every 30 minutes. 1. Regenerate the session ID when logging in to prevent session fixed attacks. 2. Regenerate before sensitive operations to improve safety. 3. Regular regeneration reduces long-term utilization risks, but the user experience needs to be weighed.

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

Compare and contrast MySQL and MariaDB. Compare and contrast MySQL and MariaDB. Apr 26, 2025 am 12:08 AM

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

SQL vs. MySQL: Clarifying the Relationship Between the Two SQL vs. MySQL: Clarifying the Relationship Between the Two Apr 24, 2025 am 12:02 AM

SQL is a standard language for managing relational databases, while MySQL is a database management system that uses SQL. SQL defines ways to interact with a database, including CRUD operations, while MySQL implements the SQL standard and provides additional features such as stored procedures and triggers.

Redis: Understanding Its Architecture and Purpose Redis: Understanding Its Architecture and Purpose Apr 26, 2025 am 12:11 AM

Redis is a memory data structure storage system, mainly used as a database, cache and message broker. Its core features include single-threaded model, I/O multiplexing, persistence mechanism, replication and clustering functions. Redis is commonly used in practical applications for caching, session storage, and message queues. It can significantly improve its performance by selecting the right data structure, using pipelines and transactions, and monitoring and tuning.

See all articles