这是我的date命令的输出:
[root@r1304 ~]# date
Wed Apr 18 15:43:28 GST 2012
Run Code Online (Sandbox Code Playgroud)
我想将默认系统时区更改为亚洲/迪拜。我按照教程做了这个:
ln -sf /usr/share/zoneinfo/Asia/Dubai /etc/localtime
Run Code Online (Sandbox Code Playgroud)
但是没有效果。似乎这在 CentOS 6 中的做法有所不同。如何更改时区?
我的/admin网站上有一个目录,我想允许管理员通过 Web 表单上传大文件。这是我的 nginx.com 的外观:
http {
# ...
client_max_body_size 16M;
# ...
server {
server_name example.com;
root /var/www/example.com;
index index.php;
location /admin {
client_max_body_size 256M;
}
# ...
}
}
Run Code Online (Sandbox Code Playgroud)
这不起作用。/admin/index.php脚本无法上传大于 16Mb 的文件:413 请求实体太大
但是,如果我移动client_max_body_size到server块一切工作正常。但我不想仅对admin目录进行此更改。
根据docs,client_max_body_size可以放置在location块内以仅覆盖所需路径的设置。
可能有什么问题?
我的 LAMP 服务器遇到了一些问题。最近一切都变得非常缓慢,尽管我网站上的访问者数量没有太大变化。当我运行top命令时,它说 MySQL 进程占用了 150-200% 的 CPU。这怎么可能,我一直认为 100% 是最大值?
我正在运行具有 1.5 GB RAM 的 Ubuntu 9.04 服务器版。
my.cnf 设置:
key_buffer = 64M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
max_connections = 200
table_cache = 512
table_definition_cache = 512
thread_concurrency = 2
read_buffer_size = 1M
sort_buffer_size = 4M
join_buffer_size = 1M
query_cache_limit = 1M # the maximum size of individual query results
query_cache_size = 128M
Run Code Online (Sandbox Code Playgroud)
这是MySQLTuner的输出:

该top命令:

这个问题的原因可能是什么?我可以更改我的my.cnf …
我刚刚用 mysql (percona 5.5) 安装了一个新的 ubuntu 服务器,但它拒绝接受来自远程主机的连接
如果我尝试远程连接到此服务器,会发生以下情况:
mysql -h10.0.0.2 -uroot -pmypassowrd
ERROR 2003 (HY000): Can't connect to MySQL server on '10.0.0.2' (111)
telnet 10.0.0.2 3306
Trying 10.0.0.2...
telnet: Unable to connect to remote host: Connection refused
Run Code Online (Sandbox Code Playgroud)
当我检查 mysql 是否侦听远程连接时,我看到了:
sudo netstat -ntlup | grep mysql
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 127018/mysqld
Run Code Online (Sandbox Code Playgroud)
如您所见,它表示127.0.0.1:3306“我只接受本地连接”。
我检查了我的skip_networking和bind-address变量 - 一切都关闭了:
mysql> show variables like '%skip_networking%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| skip_networking | OFF | …Run Code Online (Sandbox Code Playgroud) 我正在编写一个 shell 脚本来备份我的系统(像这样:https : //help.ubuntu.com/8.04/serverguide/C/backup-shellscripts.html)。
在我的系统中存储此文件的最佳位置是什么?我知道,我可以把它放在任何地方,但是如果将它存储在正在备份的目录中会怎样?这里的最佳做法是什么?
我正在运行 Ubuntu 服务器。
我有一个由 nginx 服务的网站,每分钟大约有 60 000 个请求。最近,我启用了open file cache并且看到了性能的显着提高。但是到了晚上,当负载最大时,响应时间仍然很大,并且nginx使用了大量的IO。
这是我当前的设置:
open_file_cache max=10000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
Run Code Online (Sandbox Code Playgroud)
而且我还剩下一些记忆:
free -m
total used free shared buffers cached
Mem: 7910 6917 992 0 439 885
-/+ buffers/cache: 5592 2317
Swap: 8099 0 8099
Run Code Online (Sandbox Code Playgroud)
问题:现在我可以为open_file_cache max=10000和 其他参数选择正确的值吗?10000够了吗,是太小了还是太大了?有没有办法监控打开的文件缓存使用情况?
我有两台Linux服务器。我是管理员,我日常工作的一部分是检查所有日志中是否有错误或奇怪的消息。所以,每天早上我都会检查:
在服务器 #1 上:
/var/log/syslog
/var/www/example.com/error.log
/var/log/redis.log
...and so on
Run Code Online (Sandbox Code Playgroud)
在服务器 #2 上:
/var/log/syslog
/var/lib/mysql_error.log
/var/lib/mysql_slow.log
Run Code Online (Sandbox Code Playgroud)
通过终端打开每个文件非常无聊且效率低下。是否有一些工具可以从所有服务器收集日志并将它们显示在一个地方?
我有一台专用于 MySQL 服务器的 linux 机器,负载相当高。今天我醒来,看到数据库服务器宕机了,我很害怕。我可以通过 SSH 连接到它,但它正在响应bus error每个命令:
[root@r1304 home]# ls
Bus error
[root@r1304 home]# tail /var/log/messages
Bus error
[root@r1304 home]# reboot
Bus error
[root@r1304 home]# free -m
Bus error
[root@r1304 home]# chkdisk
Bus error
Run Code Online (Sandbox Code Playgroud)
我去了数据中心并进行了硬重置,这似乎有所帮助,但半小时后情况再次发生,现在我什至无法通过 SSH 连接了。
任何想法这可能是什么?如何诊断此类问题以及可能的修复方法是什么?
服务器具有 32 GB RAM、2 个带软件 RAID 的 SSD 驱动器
更新 根据 Zabbix 的说法,当 MySQL 死掉时,进程数量会急剧增加,直到我进行了硬重置。那些可能是什么?
进程数