Centos7+Nginx负载均衡(Load Balance)配置详情介绍

Centos7+Nginx负载均衡(Load Balance)配置详情介绍

随着互联网信息的爆炸性增长,负载均衡(load balance)已经不再是一个很陌生的话题,顾名思义,负载均衡即是将负载分摊到不同的服务单元,既保证服务的可用性,又保证响应足够快,给用户很好的体验。快速增长的访问量和数据流量催生了各式各样的负载均衡产品,很多专业的负载均衡硬件提供了很好的功能,但却价格不菲,这使得负载均衡软件大受欢迎,Nginx就是其中的一个,在linux下有Nginx、LVS、Haproxy等等服务可以提供负载均衡服务,而且Nginx提供了几种分配方式(策略),当然现在主流的公有云(Windows Azure)提供的服务在均衡分配方式基本上都类似于Nginx的轮询(round robin)分配方式和加权轮询(Weight round robin)分配方式,对于其他公有云产品没有具体试验过,所以我们今天主要介绍一下Nginx下的几种分配方式,具体见下:

1、轮询(默认)

每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器down掉,能自动剔除。

2、weight

指定轮询几率,weight和访问比率成正比,用于后端服务器性能不均的情况。 例如:

upstreamserver_pool{
serverweight=10;
serverweight=10;
}

3、ip_hash

每个请求按访问ip的hash结果分配,这样每个访客固定访问一个后端服务器,可以解决session的问题。 例如:

upstreamserver_pool{
ip_hash;
server:80;
server:80;
}

4、fair(第三方)

按后端服务器的响应时间来分配请求,响应时间短的优先分配。

upstreamserver_pool{
server:80;
server:80;
fair;
}

注意:整个分配方式是通过修改定义负载均衡的server配置中添加的。

我们今天主要介绍我个人认为使用最多的几种方式吧;前面四种。

我们后端使用两台Apache服务作为WEB服务,具体安装就不多介绍了。

Yuminstallhttpd

查看httpd 版本

rpm-qa|grephttpd

接下来我们首先要为apache定义一个 默认的页面,方便区分;我们为了后面的数据统计所以页面内容显示的比较少

Vim/var/www/httml/
</html>
<!DOCTYPEhtml>
<html>
<head>
<title>WelcometoApache</title>
<style>
body{
35em;
margin:0auto;
font-family:Tahoma,Verdana,Arial,sans-serif;
}
</style>
<styletype="text/css">
h1{color:red}
h2{color:blue}
h3{color:green}
h4{color:yellow}
}
</style>
</head><bodybgcolor='7D7DFF'>
<h2>HostName:A-S----->IP:</h2>
</body>
</html>

保存退出,启动服务

Systemctlstarthttpd

然后添加默认的防火墙端口8o

Firewall-cmd--zone=public--add-port='80/tcp'--permanent
或者vim/etc/firewalld/zone/
添加一下格式
<portportocal='tcp'port='80'>

我们测试访问

我们准备第二台WEB服务()我们按照第一台的方式进行配置,再次就跳过了。

第二台主机的配置: 主机名 B-S

安装好httpd后,我们将a-s上的index拷贝到b-s服务器上

scproot@:/var/www/html/

然后修改文件

我们为了后面的测试,我们将两台服务器的显示内容修改一下,为了通过服务进行批量测试。

将两台Apache WEB服务的文件只显示服务器的名称及IP地址。

接下来我们就部署Nginx,在Centos7上yum安装需要定义yum源

cd/etc/
vim
添加以下内容
[epel]
name=aliyunepel
baseurl=/epel/7Server/x86_64/
gpgcheck=0
YuminstallNginx
Nginx

启动服务

systemctlstartNginx

我们接下来需要编辑Nginx的默认配置文件来修改负载的配置

我们首先查看默认的配置文件

#usernobody;
worker_processes1;

#error_loglogs/;
#error_loglogs/notice;
#error_loglogs/info;

#pidlogs/;


events{
worker_connections1024;
}


http{
include;
default_typeapplication/octet-stream;

#log_formatmain'$remote_addr-$remote_user[$time_local]"$request"'
#'$status$body_bytes_sent"$http_referer"'
#'"$http_user_agent""$http_x_forwarded_for"';

#access_loglogs/main;

sendfileon;
#tcp_nopushon;

#keepalive_timeout0;
keepalive_timeout65;

#gzipon;

server{
listen80;
server_namelocalhost;

#charsetkoi8-r;

#access_loglogs/main;

location/{
roothtml;
index;
}

#error_page404/;

#redirectservererrorpagestothestaticpage/
#
error_page500502503504/;
location=/{
roothtml;
}

#proxythePHPscriptstoApachelisteningon:80
#
#location~\.PHP${
#proxy_pass;
#}

#passthePHPscriptstoFastCGIserverlisteningon:9000
#
#location~\.PHP${
#roothtml;
#fastcgi_pass:9000;
#fastcgi_index;
#fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;
#includefastcgi_params;
#}

#denyaccessto.htaccessfiles,ifApache'sdocumentroot
#concurswithNginx'sone
#
#location~/\.ht{
#denyall;
#}
}


#anothervirtualhostusingmixofIP-,name-,andport-basedconfiguration
#
#server{
#listen8000;
#listensomename:8080;
#server_namesomenamealias;

#location/{
#roothtml;
#index;
#}
#}


#HTTPSserver
#
#server{
#listen443ssl;
#server_namelocalhost;

#ssl_certificate;
#ssl_certificate_key;

#ssl_session_cacheshared:SSL:1m;
#ssl_session_timeout5m;

#ssl_ciphersHIGH:!aNULL:!MD5;
#ssl_prefer_server_cipherson;

#location/{
#roothtml;
#index;
#}
#}

}

然后我们需要修改默认配置

upstream{
server:80;
server:80;
}

我们首先配置轮询的方式

#Formoreinformationonconfiguration,see:
#*OfficialEnglishDocumentation:/en/docs/
#*OfficialRussianDocumentation:/ru/docs/
userNginx;
worker_processesauto;
error_log/var/log/Nginx/;
pid/run/;
#Loaddynamicmodules.See/usr/share/Nginx/.
include/usr/share/Nginx/modules/*.conf;
events{
worker_connections1024;
}
http{
log_formatmain'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_referer"'
'"$http_user_agent""$http_x_forwarded_for"';
access_log/var/log/Nginx/main;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout65;
types_hash_max_size2048;
include/etc/Nginx/;
default_typeapplication/octet-stream;
#增加后端服务器的负载方式,我们默认使用轮询
upstream{
server:80;
server:80;
}

#Loadmodularconfigurationfilesfromthe/etc/Nginx/directory.
#See/en/docs/ngx_core_#include
#formoreinformation.
include/etc/Nginx//*.conf;
server{
#listen80default_server;
#listen[::]:80default_server;
#server_name_;
listen80;
server_name;
root/usr/share/Nginx/html;
#Loadconfigurationfilesforthedefaultserverblock.
include/etc/Nginx//*.conf;
#增加的服务器配置
location/{
proxy_redirectoff;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_pass;
}
error_page404/;
location=/{
}
error_page500502503504/;
location=/{
}
}
#SettingsforaTLSenabledserver.
#
#server{
#listen443sslhttp2default_server;
#listen[::]:443sslhttp2default_server;
#server_name_;
#root/usr/share/Nginx/html;
#
#ssl_certificate"/etc/pki/Nginx/";
#ssl_certificate_key"/etc/pki/Nginx/private/";
#ssl_session_cacheshared:SSL:1m;
#ssl_session_timeout10m;
#ssl_ciphersHIGH:!aNULL:!MD5;
#ssl_prefer_server_cipherson;
#
##Loadconfigurationfilesforthedefaultserverblock.
#include/etc/Nginx//*.conf;
#
#location/{
#}
#
#error_page404/;
#location=/{
#}
#
#error_page500502503504/;
#location=/{
#}
#}
}

保存会重启服务

SystemcrestartNginx

然后测试访问,访问结果基本上都是一个后端服务器分配一次

我们使用以下命令执行十次

foriin$(seq10);docurl;done
[root@bogonNginx]#foriin$(seq10);docurl;done
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:B-S----->IP:

接下来我们配置加权轮询分配方式

我们只修改一下部分

upstream{
server:80weight=10max_fails=2fail_timeout=30s;
server:80weight=5max_fails=2fail_timeout=30s;
}
#供proxy_pass和fastcgi_pass指令中使用的代理服务器
#后台如果有动态应用的时候,ip_hash指令可以通过hash算法
#将客户端请求定位到同一台后端服务器上,解决session共享,#但建议用动态应用做session共享
#server用于指定一个后端服务器的名称和参数
#weight代表权,重默认为1,权重越高被分配的客户端越多
#max_fails指定时间内对后端请求失败的次数
#fail_timeout达到max_fails指定的失败次数后暂停的时间
#down参数用来标记为离线,不参与负载均衡.在ip_hash下使用
#backup仅仅在非backup服务器宕机或繁忙的时候使用

修改后的代码如下:

#Formoreinformationonconfiguration,see:
#*OfficialEnglishDocumentation:/en/docs/
#*OfficialRussianDocumentation:/ru/docs/
userNginx;
worker_processesauto;
error_log/var/log/Nginx/;
pid/run/;
#Loaddynamicmodules.See/usr/share/Nginx/.
include/usr/share/Nginx/modules/*.conf;
events{
worker_connections1024;
}
http{
log_formatmain'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_referer"'
'"$http_user_agent""$http_x_forwarded_for"';
access_log/var/log/Nginx/main;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout65;
types_hash_max_size2048;
include/etc/Nginx/;
default_typeapplication/octet-stream;
#增加后端服务器的负载方式,我们默认使用轮询
upstream{
server:80weight=10max_fails=2fail_timeout=30s;
server:80weight=5max_fails=2fail_timeout=30s;
}
#供proxy_pass和fastcgi_pass指令中使用的代理服务器
#后台如果有动态应用的时候,不参与负载均衡.在ip_hash下使用
#backup仅仅在非backup服务器宕机或繁忙的时候使用
#Loadmodularconfigurationfilesfromthe/etc/Nginx/directory.
#See/en/docs/ngx_core_#include
#formoreinformation.
include/etc/Nginx//*.conf;
server{
#listen80default_server;
#listen[::]:80default_server;
#server_name_;
listen80;
server_name;
root/usr/share/Nginx/html;
#Loadconfigurationfilesforthedefaultserverblock.
include/etc/Nginx//*.conf;
location/{
proxy_redirectoff;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_pass;
}
error_page404/;
location=/{
}
error_page500502503504/;
location=/{
}
}
#SettingsforaTLSenabledserver.
#
#server{
#listen443sslhttp2default_server;
#listen[::]:443sslhttp2default_server;
#server_name_;
#root/usr/share/Nginx/html;
#
#ssl_certificate"/etc/pki/Nginx/";
#ssl_certificate_key"/etc/pki/Nginx/private/";
#ssl_session_cacheshared:SSL:1m;
#ssl_session_timeout10m;
#ssl_ciphersHIGH:!aNULL:!MD5;
#ssl_prefer_server_cipherson;
#
##Loadconfigurationfilesforthedefaultserverblock.
#include/etc/Nginx//*.conf;
#
#location/{
#}
#
#error_page404/;
#location=/{
#}
#
#error_page500502503504/;
#location=/{
#}
#}
}

我们重启进行测试

[root@bogonNginx]#foriin$(seq10);docurl;done
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:B-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:

接下来我们测试第三种,ip_hash;每个请求按访问ip的hash结果分配,这样每个访客固定访问一个后端服务器,可以解决的问题。

我们只修改server部分

upstream{
ip_hash;
server:80;
server:80;
}

修改后的整体代码:

#Formoreinformationonconfiguration,see:
#*OfficialEnglishDocumentation:/en/docs/
#*OfficialRussianDocumentation:/ru/docs/
userNginx;
worker_processesauto;
error_log/var/log/Nginx/;
pid/run/;
#Loaddynamicmodules.See/usr/share/Nginx/.
include/usr/share/Nginx/modules/*.conf;
events{
worker_connections1024;
}
http{
log_formatmain'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_referer"'
'"$http_user_agent""$http_x_forwarded_for"';
access_log/var/log/Nginx/main;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout65;
types_hash_max_size2048;
include/etc/Nginx/;
default_typeapplication/octet-stream;
#增加后端服务器的负载方式,我们默认使用轮询
upstream{
ip_hash;
server:80;
server:80;
}
#供proxy_pass和fastcgi_pass指令中使用的代理服务器
#后台如果有动态应用的时候,不参与负载均衡.在ip_hash下使用
#backup仅仅在非backup服务器宕机或繁忙的时候使用
#Loadmodularconfigurationfilesfromthe/etc/Nginx/directory.
#See/en/docs/ngx_core_#include
#formoreinformation.
include/etc/Nginx//*.conf;
server{
#listen80default_server;
#listen[::]:80default_server;
#server_name_;
listen80;
server_name;
root/usr/share/Nginx/html;
#Loadconfigurationfilesforthedefaultserverblock.
include/etc/Nginx//*.conf;
location/{
proxy_redirectoff;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_pass;
}
error_page404/;
location=/{
}
error_page500502503504/;
location=/{
}
}
#SettingsforaTLSenabledserver.
#
#server{
#listen443sslhttp2default_server;
#listen[::]:443sslhttp2default_server;
#server_name_;
#root/usr/share/Nginx/html;
#
#ssl_certificate"/etc/pki/Nginx/";
#ssl_certificate_key"/etc/pki/Nginx/private/";
#ssl_session_cacheshared:SSL:1m;
#ssl_session_timeout10m;
#ssl_ciphersHIGH:!aNULL:!MD5;
#ssl_prefer_server_cipherson;
#
##Loadconfigurationfilesforthedefaultserverblock.
#include/etc/Nginx//*.conf;
#
#location/{
#}
#
#error_page404/;
#location=/{
#}
#
#error_page500502503504/;
#location=/{
#}
#}
}

保存退出后,我们测试

[root@bogonNginx]#foriin$(seq10);docurl;done
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:
HostName:A-S----->IP:

最后我们介绍一下fairl

按后端服务器的响应时间来分配请求,响应时间短的优先分配

upstream{
server:80;
server:80;
fair;
}


修改后的整体代码

#Formoreinformationonconfiguration,see:
#*OfficialEnglishDocumentation:/en/docs/
#*OfficialRussianDocumentation:/ru/docs/
userNginx;
worker_processesauto;
error_log/var/log/Nginx/;
pid/run/;
#Loaddynamicmodules.See/usr/share/Nginx/.
include/usr/share/Nginx/modules/*.conf;
events{
worker_connections1024;
}
http{
log_formatmain'$remote_addr-$remote_user[$time_local]"$request"'
'$status$body_bytes_sent"$http_referer"'
'"$http_user_agent""$http_x_forwarded_for"';
access_log/var/log/Nginx/main;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
keepalive_timeout65;
types_hash_max_size2048;
include/etc/Nginx/;
default_typeapplication/octet-stream;
#增加后端服务器的负载方式,我们默认使用轮询
upstream{
server:80;
server:80;
fair;
}
#供proxy_pass和fastcgi_pass指令中使用的代理服务器
#后台如果有动态应用的时候,不参与负载均衡.在ip_hash下使用
#backup仅仅在非backup服务器宕机或繁忙的时候使用
#Loadmodularconfigurationfilesfromthe/etc/Nginx/directory.
#See/en/docs/ngx_core_#include
#formoreinformation.
include/etc/Nginx//*.conf;
server{
#listen80default_server;
#listen[::]:80default_server;
#server_name_;
listen80;
server_name;
root/usr/share/Nginx/html;
#Loadconfigurationfilesforthedefaultserverblock.
include/etc/Nginx//*.conf;
location/{
proxy_redirectoff;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_pass;
}
error_page404/;
location=/{
}
error_page500502503504/;
location=/{
}
}
#SettingsforaTLSenabledserver.
#
#server{
#listen443sslhttp2default_server;
#listen[::]:443sslhttp2default_server;
#server_name_;
#root/usr/share/Nginx/html;
#
#ssl_certificate"/etc/pki/Nginx/";
#ssl_certificate_key"/etc/pki/Nginx/private/";
#ssl_session_cacheshared:SSL:1m;
#ssl_session_timeout10m;
#ssl_ciphersHIGH:!aNULL:!MD5;
#ssl_prefer_server_cipherson;
#
##Loadconfigurationfilesforthedefaultserverblock.
#include/etc/Nginx//*.conf;
#
#location/{
#}
#
#error_page404/;
#location=/{
#}
#
#error_page500502503504/;
#location=/{
#}
#}
}

Centos7+Nginx负载均衡(Load Balance)配置详情介绍的更多相关文章

  1. HTML5 Web缓存和运用程序缓存(cookie,session)

    这篇文章主要介绍了HTML5 Web缓存和运用程序缓存(cookie,session),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  2. iOS Swift上弃用后Twitter.sharedInstance().session()?. userName的替代方案

    解决方法如果您仍在寻找解决方案,请参阅以下内容:

  3. 使用Fabric SDK iOS访问Twitter用户时间线

    我试图在这个问题上挣扎两天.我正在使用FabricSDK和Rest工具包,试图为Twitter使用不同的RestAPIWeb服务.我可以使用具有authTokenSecret,authToken和其他值的会话对象的TWTRLogInButton成功登录.当我尝试获取用户时间线时,我总是得到失败的响应,作为:{“errors”:[{“code”:215,“message”:“BadAuthentic

  4. ios – 如何从Apple Watch调用iPhone上定义的方法

    有没有办法从Watchkit扩展中调用iPhone上的类中定义的方法?根据我的理解,目前在Watchkit和iPhone之间进行本地通信的方法之一是使用NSUserDefaults,但还有其他方法吗?

  5. 当iOS应用程序进入后台时,TCP和UDP(与多播)连接会发生什么

    我创建了几个实验:设置1:我创建了一个TCPSender应用程序和一个TCPReceiver应用程序.在本次实验中,我在iOS设备上启动了TCPSender,在另一台iOS设备上启动了TCPReceiver.然后两者都经过验证已建立连接并发送和接收数据.然后我将TCPReceiver应用程序置于后台.TCPSender应用程序指示连接丢失和崩溃(是的,我打算这样).设置2:我创建了一个UDPSen

  6. ios – 使用Swift的Lumberjack 2.0记录器

    我以前使用物镜C的Lumberjack记录器,我喜欢它.现在我开始学习Swift,我不能在那里使用我最喜欢的记录器.有人可以一步一步地写出我能做到的事吗?在Lumberjack2.0发布之前,我尝试在这里找到一些东西,但所有主题都是自定义包装器.我做了什么:>我用Cocoapods添加了Lumberjack;>我将“#import”添加到Bridging-Header文件中.我不知道接下来该怎么办?因为在ObjC中我有宏:staticconstintddLogLevel=LOG_LEVEL_INFO;el

  7. ios8 – iOS 8上的ptrace

    我试图在ptrace上调用一个像thisptrace一样的函数;但是当我尝试使用#include导入它时,Xcode会给我一个错误’sys/ptrace.h’文件找不到.我错过了什么,我是否需要导入一个库,或者这在iOS上根本不可用?

  8. ios – 如何将视频从AVAssetExportSession保存到相机胶卷?

    在此先感谢您的帮助.解决方法只需使用session.outputURL=…

  9. ios – 使用AVCaptureSession sessionPreset = AVCaptureSessionPresetPhoto拉伸捕获的照片

    解决方法所以我解决了我的问题.这是我现在使用的代码,它工作正常:…重要的输出imagaView:一些额外的信息:相机图层必须是全屏,并且outputimageView也必须是.我希望这些对某些人来说也是有用的信息.

  10. 我可以在iOS中自定义Twitter工具包的登录按钮吗?

    我已经下载了Twitter工具包框架并添加了用Twitter登录的代码.但是,我不希望登录按钮看起来像那样.我想要一个用于登录的自定义按钮.我能这样做吗?我只想使用这个框架,因为这也适用于iOS系统帐户.解决方法根据document:在按下按钮中添加代码:Objective-C的迅速

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部