- redo 日志是 MySQL 的一个重要组成部分,它记录了每个事务对数据库做出的修改,以保证数据的一致性* 和完整性。当系统出现宕机或崩溃时,redo 日志可以用于数据的恢复。
- redo 日志过大时,会导致系统运行缓慢、空间不足,甚至引起硬盘故障。
采取以下措施
1 . 调整 redo 日志的大小:可以通过修改参数 innodb_log_file_size 来控制 redo 文件的大小。根据实际情况来调整 redo 日志的大小,避免过大而引起问题。
2 . 定期清空 redo 日志:如果 redo 日志过大,可以使用 FLUSH LOGS 命令来清空日志文件。这样可以释放磁盘空间,但同时也会丢失未提交的修改数据,需要谨慎使用。
3 . 对于一些不重要的操作,可以关闭 redo 日志:MySQL 支持通过 SET sql_log_bin=0 来关闭 redo 日志。这对于一些不需要备份的操作是非常有用的,可以有效减小 redo 日志的体积。
在实际使用 MySQL 时,我们需要注意 redo 日志的大小,及时调整和清空。这样可以保证系统的稳定性,同时也能提高系统的性能。
多子项目工程 nginx 配置
项目部署位置:/export/Instances/cf-static-page-jkplus/runtime
子项目index位置 / 域名访问默认位置:/export/Instances/cf-static-page-jkplus/runtime/jkplus-static/index.html
server {
listen 80;
server_name cf.jr.example.com;
access_log /export/nginx/logs/cf.jr.example.com_access.log main;
error_log /export/nginx/logs/cf.jr.example.com_error.log warn;
index index.html /jkplus-static/index.html;
error_page 404 502 503 500 =301 https://cf.jr.example.com;
location / {
try_files $uri $uri/ @fallback;
root /export/Instances/cf-static-page-jkplus/runtime;
}
location @fallback {
root /export/Instances/cf-static-page-jkplus/runtime/jkplus-static;
}
}
nginx代理转发 解决跨域 url重写
location ^~ /billingOperation {
proxy_set_header Host 'billing-operation-ite.example.com';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://billing-operation-ite.example.com/;
proxy_read_timeout 300;
expires -1;
}
1、header 配置 host 解决 跨域问题
2、proxy_pass 域名最后 + / 自动重写url,去除location包含的部分
注意:
如果写rewrite :
redirect 造成302
permanent 造成301
iptables条目示例
-
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 11.50.49.166:8080
-
iptables -t nat -A PREROUTING -d 10.226.144.202/32 -p tcp --dport 8080 -j DNAT --to-destination 11.50.49.166:8080
-
iptables -t nat -A POSTROUTING -d 10.226.144.202/32 -p tcp --dport 8080 -j SNAT --to-source 11.50.49.166:8080
nginx.conf 标准配置
user admin admin;
worker_processes auto;
worker_cpu_affinity auto;
error_log /export/nginx/logs/nginx_error.log warn;
pid /export/nginx/logs/nginx.pid;
worker_rlimit_nofile 65535;
web_mgr addr=a.b.com port=80;
events
{
use epoll;
worker_connections 65535;
}
http
{
include mime.types;
default_type application/octet-stream;
server_tokens on;
log_format main '$scheme $http_host $remote_addr $server_addr [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent" '
'$upstream_addr '
'$upstream_response_time $request_time $http_x_forwarded_for' ' $limit_req_hit';
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 0;
client_body_buffer_size 2048k;
fastcgi_intercept_errors on;
client_header_timeout 180;
client_body_timeout 180;
proxy_connect_timeout 90;
proxy_read_timeout 180;
proxy_send_timeout 180;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
server_name_in_redirect off;
proxy_hide_header X-Powered-By;
gzip on;
gzip_min_length 100;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
# error_page 400 401 402 403 404 405 408 410 412 413 414 415 500 501 502 503 506 =
vhost_traffic_status_zone;
server {
listen 9006;
server_name 0.0.0.0;
location /status {
vhost_traffic_status_display;
vhost_traffic_status_display_format json;
}
}
include domain/*.cfg;
}

