如何screen
用于启动新会话并在该会话中运行命令而不终止该会话?
screen -S myScreenName runSomething
Run Code Online (Sandbox Code Playgroud)
我试过上面的命令,它说
[screen is terminating]
Run Code Online (Sandbox Code Playgroud)
它是否运行了命令然后杀死了屏幕?我希望在运行命令后分离屏幕而不是杀死它。那怎么办呢?
使用 Puppet 时,我收到类似的错误消息
returned 1 instead of one of [0]
有没有办法输出/获取实际的错误消息?
在 Ubuntu 14.04 上,当内存和交换使用率达到 100% 时,必须增加交换文件。
在实时生产服务器上,是否可以在对服务造成最小中断的情况下增加交换?
的输出free -h
:
total used free shared buffers cached
Mem: 3.9G 3.4G 435M 24K 1.2M 7.5M
-/+ buffers/cache: 3.4G 443M
Swap: 8.0G 6.6G 1.4G
Run Code Online (Sandbox Code Playgroud) 在 Ubuntu 14.04 x64 服务器上,Haproxy 使用 3.3 GB 内存和 6.8 GB 交换,同时处理 52k 连接。在大部分流量被重定向到另一个 haproxy 框之前,CPU 使用率也一直飙升至 100%。流量主要是持久性 TCP 连接。
pid = 3185 (process #1, nbproc = 1)
uptime = 0d 6h14m21s
system limits: memmax = unlimited; ulimit-n = 524341
maxsock = 524341; maxconn = 262144; maxpipes = 0
current conns = 54303; current pipes = 0/0
Running tasks: 1/54336
Run Code Online (Sandbox Code Playgroud)
注意到内存使用量在大约 50k 连接时急剧上升。ulimit -n
设置为1048576
。
问题:内存使用量是否异常高?我们怎样才能减少内存消耗?
我还从另一个问题中阅读了以下内容,是否相关?我应该如何检查 TCP 设置是否足够(对于持久 TCP 连接),以免导致内存使用量大幅增加?
At 54000 concurrent connections, you …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Windows 上使用 pgAdmin 连接到postgresql
在 localhost 的 Ubuntu 12.04 VM 上运行的 9.1.8。主机的 5432 端口转发到 VM 的 5432 端口。
pgAdmin 错误:
Error connecting to the server: could not receive data from server: Software caused connection abortion (0x00002745/10053)
配置文件
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '*'
port = 5432
Run Code Online (Sandbox Code Playgroud)
pg_hba.conf
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
host all all 0.0.0.0/0 md5
host all all 127.0.0.1/32 md5
host all all …
Run Code Online (Sandbox Code Playgroud) 在运行 Haproxy 的 Ubuntu 14.04 上,在 之后service haproxy reload
,Haproxy 突然将其背后的所有服务器报告为关闭。
经过一番挖掘,我发现 ping 不能正常工作,有时它能够成功 ping,然后几秒钟后我们得到错误ping: sendmsg: Operation not permitted
。
也无法解决subdomain.domain.com
。
iptables -L
没有显示任何规则。iptables --flush
没有帮助。
有任何想法吗?
root@some-test:~# ping 107.1.1.1
PING 107.1.1.1 (107.1.1.1) 56(84) bytes of data.
64 bytes from 107.1.1.1: icmp_seq=1 ttl=63 time=0.425 ms
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
64 bytes from 107.1.1.1: icmp_seq=6 ttl=63 time=0.390 ms
64 bytes …
Run Code Online (Sandbox Code Playgroud) 我对 linux 系统很陌生。我可以选择使用 .rpm安装软件 ( ImageMagick ) 或从 .tar.gz 编译源代码(我已经完成了)。
我应该(你)选择哪一个?
如果我选择rpm,我应该使用rpm -Uvh <filename>
还是使用yum
来安装rpm?
如果我选择安装二进制文件,通常的安装方式是什么(供 Apache/httpd 使用)?我想我应该下载.tar.gz
文件/usr/local/src
,解压用它tar zxvf <filename>
,那么./configure
,make
,make install
。通常,如果我这样做,二进制文件是否会自动变为喜欢/usr/bin
(它适用于 ImageMagick)并为所有用户设置环境路径?
当我安装 pdo-pgsql 时,扩展已安装到其中/usr/lib/php/extensions/no-debug-non-zts-20090626/
,因此不会自动加载。在 中php.ini
,我extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
已经定义了。
片段 php.ini
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
zend_extension = "/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
extension = "eaccelerator.so"
extension = "pdo.so"
extension = "pdo_pgsql.so"
extension = "pdo_sqlite.so"
extension = "sqlite.so"
extension = "pdo_mysql.so"
Run Code Online (Sandbox Code Playgroud)
修改工作
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
zend_extension = "/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
extension = "eaccelerator.so"
extension = "pdo.so"
extension = …
Run Code Online (Sandbox Code Playgroud) 我有一个使用 Virtualmin / Webmin 的网络服务器(带有 LAMP 的 Ubuntu 12.04)。因为我刚从 Cpanel 系统搬过来,所以我在配置 DNS 时遇到了噩梦!
使用 intoDNS.com,失败的报告是:
Mismatched NS records WARNING: One or more of your nameservers did not return any of your NS records.
DNS servers responded ERROR: One or more of your nameservers did not respond: The ones that did not respond are: 123.123.123.123 213.251.188.141x
Multiple Nameservers ERROR: Looks like you have less than 2 nameservers. According to RFC2182 section 5 you must have at least 3 nameservers, and no …
Run Code Online (Sandbox Code Playgroud) 我在安装php-fpm
与apache2-mpm-worker
. Ť他是导向,我以下。
根据指南的第 5 步,
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
Run Code Online (Sandbox Code Playgroud)
但是我php5-fcgi
在/usr/lib
,但只有/usr/bin/php5-cgi
and找不到,/usr/bin/php-cgi
我不确定它们是否相同。
所以我将步骤 5 中的行更改为:
Alias /php5-fcgi /usr/bin/php5-fcgi
FastCgiExternalServer /usr/bin/php5-fcgi -host 127.0.0.1:9000 -pass-header
Run Code Online (Sandbox Code Playgroud)
在重新启动 Apache 时,它的日志给出了错误:
[notice] caught SIGTERM, shutting down
[alert] (4)Interrupted system call: FastCGI: read() from pipe failed (0)
[alert] (4)Interrupted system call: FastCGI: the PM is shutting down, Apache seems to have disappeared - bye
[notice] Apache/2.2.22 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 configured …
Run Code Online (Sandbox Code Playgroud) 我有 2 sites-enabled
,server_name
如下:
server_name www.mysite.com mysite.com
Run Code Online (Sandbox Code Playgroud)
和
server_name dev.mysite.com
Run Code Online (Sandbox Code Playgroud)
问题:当我通过其 IP 地址访问该网站时,通过查看访问/错误日志,似乎 nginx 正在root
使用dev.mysite.com
.
nginx 如何决定服务哪个?我们可以迫使它服务过root
的www.mysite.com
时,该网站正在使用的IP地址访问?
配置文件
server {
listen 80;
server_name www.mysite.com mysite.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /var/www/mysite/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args ;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 300;
}
}
Run Code Online (Sandbox Code Playgroud) 是否可以在 Ubuntu 18.04 中将 2 个磁盘和 1 个 RAID 阵列组合成 1 个逻辑卷?
我打算在这台机器上设置一个 PostgreSQL 数据库,并认为让它在 1 个单个卷中存储数据比跨越多个卷更好(我认为这需要手动配置,如创建多个表空间)。
我的系统当前配置为具有
/dev/sda5
:2 TB 驱动器(包含 Ubuntu 18.04)/dev/sdb
:2 TB 驱动器(空)/dev/md0
: RAID-10 阵列(2 TB 可用,使用 mdadm 的软件 RAID,空)谢谢!
ubuntu ×10
linux ×7
apache-2.2 ×2
centos ×2
database ×2
networking ×2
php-fpm ×2
postgresql ×2
bash ×1
bind ×1
debian ×1
fastcgi ×1
gnu-screen ×1
haproxy ×1
imagemagick ×1
lvm ×1
memory ×1
nameserver ×1
nginx ×1
php ×1
php.ini ×1
php5 ×1
ping ×1
puppet ×1
raid ×1
rpm ×1
swap ×1
tcp ×1
vagrant ×1
yum ×1