Top Linux Ops Interview Q&A: RAID, Load Balancing, MySQL, and More
This article compiles essential Linux operations interview questions covering server management for hundreds of machines, RAID 0/1/5 principles, differences among LVS, Nginx and HAProxy, proxy servers, middleware, Tomcat ports, CDN, gray releases, DNS resolution, RabbitMQ, LVS modes, MySQL lock diagnostics, replication delay mitigation, root password reset, backup tools, keepalived health checks, common command‑line utilities, TCP/IP model, Nginx modules, web load‑balancing architectures, and practical shell scripts for monitoring and maintenance.
Server Management
When managing 300 servers, use a jump host with unified accounts, employ configuration management tools such as Salt, Ansible, or Puppet, and maintain a simple CMDB for system, configuration, and application information.
RAID Modes
RAID combines disks into a single logical volume and can provide redundancy.
RAID 0 – Fast read/write, no redundancy; a single disk failure loses all data.
RAID 1 – Mirrors two disks, 100% redundancy, but higher cost.
RAID 5 – Requires at least three disks, offers moderate redundancy and performance; capacity = N‑1 disks.
Typical choices: single servers use RAID 1 for system disks; database servers use RAID 10 (primary) and RAID 5/0 (secondary); web servers may use RAID 5 or RAID 0 when data volume is low.
Load Balancing: LVS, Nginx, HAProxy
LVS – Layer‑4 forwarding, suitable for very high concurrency.
HAProxy – Layer‑4/7 forwarding, professional proxy with session support.
Nginx – Web server, cache, reverse proxy, supports layer‑7 forwarding.
Choose HAProxy or Nginx for URL‑based routing; use LVS for massive traffic; HAProxy is recommended for small‑to‑medium enterprises due to its simplicity.
Proxy Servers: Squid, Varnish, Nginx
All act as proxies that cache content to serve repeated requests locally.
Varnish – High‑performance memory cache, superior in‑memory utilization.
Squid – Mature cache with extensive documentation.
Nginx – Primarily a reverse proxy/web server; caching requires third‑party modules.
For dedicated caching services, prefer Squid or Varnish.
Middleware & JDK
Middleware is independent software that enables distributed applications to share resources and communicate across different systems. JDK (Java Development Kit) provides the tools to develop, compile, and run Java applications.
Tomcat Ports
8005 – Shutdown port; 8009 – AJP port for Apache integration; 8080 – Standard HTTP port for applications.
CDN
Content Delivery Network distributes website content to edge locations nearest to users, reducing latency and improving access speed.
Gray Release (Canary Deployment)
Gradually shifts traffic from version A to version B, allowing monitoring and adjustment before full rollout.
DNS Resolution Process
Client queries local hosts file, then the configured DNS server, followed by root servers, TLD servers, and finally authoritative name servers to obtain the IP address.
RabbitMQ
A message‑queue middleware that stores messages until consumers can process them, ensuring reliable delivery.
LVS Modes
VS/NAT – Destination IP is rewritten to a real server; all traffic passes through the load balancer.
VS/TUN – Uses IP tunneling; the real server replies directly to the client.
VS/DR – Direct routing; both load balancer and real server share the virtual IP, requiring them to be on the same broadcast domain.
MySQL InnoDB Lock Diagnosis & Replication Delay
Use
SHOW ENGINE INNODB STATUSto view lock information. MySQL 5.5 adds tables
innodb_trx,
innodb_locks, and
innodb_lock_waitsfor detailed lock analysis.
To reduce replication lag, check hardware differences, single‑threaded replication, slow queries, network latency, and master/slave load. Options include upgrading MySQL for multi‑threaded replication, adjusting
slave‑net‑timeout,
master‑connect‑retry, and tuning InnoDB settings.
Resetting MySQL Root Password
If the current password is known:
mysqladmin -u root -p password "new_password"Or execute SQL statements:
UPDATE mysql.user SET password=PASSWORD('new_password') WHERE user='root';
FLUSH PRIVILEGES;If the password is forgotten, stop MySQL, start with
--skip-grant-table, then update the password as above.
MySQL Backup Tools
mysqldump – Logical backup, suitable for small datasets.
LVM snapshots – Physical backup via filesystem snapshots.
tar – Archive whole data directory.
Percona XtraBackup – Fast physical hot backup for InnoDB, supports incremental backups.
Keepalived
Implements VRRP for high‑availability routing. Consists of core, check, and vrrp modules. Health checks can be HTTP/SSL with configurable URLs, ports, timeouts, and retry policies.
HTTP_GET {
url { path / }
status_code 200
connect_port 80
connect_timeout 3
}Common Command‑Line Tasks
List top IPs in Nginx access log:
cat access.log | awk '{print $1}' | uniq -c | sort -rn | head -10Capture traffic to 192.168.1.1 port 80:
tcpdump 'host 192.168.1.1 and port 80' > tcpdump.logRedirect local port 80 to 8080 on 192.168.2.1:
iptables -A PREROUTING -d 192.168.2.1 -p tcp --dport 80 -j DNAT --to-destination 192.168.2.1:8080Ops Engineer Perspective
Operations engineers ensure high‑availability, performance, and security of services; mistakes can cause severe business impact, so rigor and innovation are essential.
TCP/IP Seven‑Layer Model
Application – User‑level protocols (HTTP, FTP, DNS, etc.).
Presentation – Data representation, encryption, compression.
Session – Session establishment and termination.
Transport – TCP/UDP, ports, flow control.
Network – IP routing, logical addressing.
Data Link – MAC addressing, error detection.
Physical – Transmission media and signaling.
Common Nginx Modules
rewrite – URL rewriting.
access – Access control.
ssl – TLS encryption.
gzip – Response compression.
proxy – Reverse proxy.
upstream – Backend server definition.
cache_purge – Cache invalidation.
Web Server Load Architecture
Typical stack includes Nginx, HAProxy, Keepalived, and LVS.
Performance & Concurrency Checks
View HTTP concurrency and TCP states:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'Increase file descriptor limits:
* soft nofile 10240
* hard nofile 10240Useful Scripts
Ping sweep for 192.168.1.0/24:
#!/bin/bash
for ip in $(seq 1 255); do
ping -c 1 192.168.1.$ip > /dev/null 2>&1 && echo 192.168.1.$ip UP || echo 192.168.1.$ip DOWN
doneLog retention for Apache (keep last 7 days):
find /app/logs -type f -mtime +7 -name "*.log" -exec rm -f {} \;Backup website directory nightly:
# /bin/bash
cd /var/www && tar zcf /data/html-$(date +%m-%d%H).tar.gz html/
# crontab entry: 0 0 * * * /bin/sh /root/backup.shImages
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.