Ikoula Corporate
Espace client
Support
Blog
Wiki
Site web Ikoula
查看“配置一个代理医管局对 Cloudstack”的源代码
←
配置一个代理医管局对 Cloudstack
Jump to navigation
Jump to search
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看和复制此页面的源代码。
<span data-link_translate_en_title="Configure a Proxy HA on Cloudstack" data-link_translate_en_url="Configure+a+Proxy+HA+on+Cloudstack"></span>[[:en:Configure a Proxy HA on Cloudstack]][[en:Configure a Proxy HA on Cloudstack]] <span data-link_translate_fr_title="Configurer un HA Proxy sur Cloudstack" data-link_translate_fr_url="Configurer_un_HA_Proxy_sur_Cloudstack"></span>[[:fr:Configurer un HA Proxy sur Cloudstack]][[fr:Configurer un HA Proxy sur Cloudstack]] <br /> 这篇文章是从由软件进行自动翻译。你可以[[:fr:Configurer un HA Proxy sur Cloudstack|看到这篇文章的源代码]]<br /><span data-translate="fr"></span> ==介绍 == 您想要配置 '''医管局代理 ''' 在 Cl或 dstack 平台上。这篇文章将解释的方法通过一个示例配置。 ==执行 == 在这里是为了执行接下来的程序 '''医管局代理 ''' 在 Debian 的实例上 8 "杰西 " 根据 Cl或 dstack。<br> '''注意 ''':''这种方法也适用于框架的一项专门条文 ''. ===创建新的实例 HAProxy === 你会发现程序用于创建实例 Cl或 dstack en ''直接路由 '' 对 [[:fr:Deploiement d'une instance en zone direct-routing]] 和在 ''提前路由 '' 对 [[:fr:Deploiement d'une instance en zone advanced-routing]] ==配置新实例 HAProxy == ;现在开始我们的 VM [[File:InfoVM.png]] ;我们可以从综合控制台或 ssh 连接 [[File:ConnectVM.png]] ===系统必备组件 === 前提之一是维护其系统最新情况。<br> <pre> apt-get update apt-get upgrade </pre> 你 Debian 的系统保持最新,请确保你有官方资料库的列表。你可以找到在 Ikoula 资料库和安装说明的可用列表 [[:fr:Quelles_sont_les_sources_des_d%C3%A9p%C3%B4ts_debian_chez_Ikoula|a 这个地址]]. <div style="background-color: #FF9999;"> '''警告 ''': 在对您的系统进行任何更改之前仍在努力筹划 {{Template:Sauvegarde}} 您的文件时处理不当。<br> 对 {{Template:Serveur}} 生产,认为执行这些操作,在非高峰时段,尽量减少影响你的行动。</div> 我们的实例安装 ''负载平衡 '' 根据 Cloudstack 我们需要服务 '''医管局代理 '''.<br> ===医管局代理设置 === ;若要安装医管局代理版本 1.5在您的终端中运行下面的命令 <pre> apt-get install haproxy </pre> ;如果你想要的医管局代理版本最新版本 1.6运行以下命令 <pre> # Ajout du repo echo deb http://httpredir.debian.org/debian jessie-backports main | tee /etc/apt/sources.list.d/backports.list apt-get install debian-keyring # Recuperation de la cle gpg gpg --keyring /usr/share/keyrings/debian-keyring.gpg --export bernat@debian.org | apt-key add - # Mise a jour des depots apt-get update # Installation de haproxy apt-get install haproxy -t jessie-backports-1.6 </pre> ===医管局代理激活 === ;医管局代理现在安装,我们现在通过更改已启用值来启用它 =0 通过启用 =1 在这两个文件 /etc/default/haproxy et /etc/init.d/haproxy <pre># activation de HA Proxy dans /etc/default/haproxy sed -i "s/ENABLED=0/ENABLED=1/g" /etc/default/haproxy # activation de 医管局代理 dans /etc/init.d/haproxy sed -i "s/ENABLED=0/ENABLED=1/g" /etc/init.d/haproxy </pre> ===医管局代理配置 === 医管局代理执行配置文件中 '''/etc/haproxy/haproxy.cfg''' . ;下面是一个示例配置 d ''''HAProxy''' <pre> global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy user haproxy group haproxy daemon defaults log global mode http option httplog option dontlognull contimeout 5000 clitimeout 50000 srvtimeout 50000 errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http listen cluster_web xxx.xxx.xxx.xxx:80 mode http balance roundrobin option httpclose option forwardfor server web1 yyy.yyy.yyy.yyy:80 check server web2 zzz.zzz.zzz.zzz:80 check stats enable stats hide-version stats refresh 30s stats show-node stats auth ikoula:ikoula stats uri /stats </pre> Ip 地址登陆的 ip 地址是我们 {{Template:Serveur}} 负载平衡、 yyy.yyy.yyy.yyy 和 zzz.zzz.zzz.zzz 地址是我们 {{Template:Serveur}}后面的 web s ''负载平衡器 ''. {| border="1" cellpadding="20" cellspacing="0" |listen cluster_web |地址和端口的医管局代理服务将需要侦听连接。 |- |mode |摆动模式,在我们的示例 '''http''' 为 web |- |balance |用于负载分布,在我们的示例封合写的算法 <br>可用的值是 : '''封合写,源,至少连接,第一反应 ''' |- |server |宣言 》 的各种服务器背后我们 ''负载平衡器 ''在我们的示例 '''web1''' et '''web2'''. |- |stats |将 stats 页的访问配置 ''负载平衡器 ''<br>在我们的示例页面将可对登陆 /与统计 '''ikoula'''/'''ikoula''' 如登录名和密码 |- |} ===医管局代理开始 === ;我们现在可以开始 '''医管局代理 ''' <pre> service haproxy start </pre> ou <pre> etc/init.d/haproxy start </pre> ;让我们对我们登陆 ip /统计数据,并利用我们的登录名和密码我们准时医管局代理管理页。 [[File:HAProxyStats.png]] ;我们现在可以连接到我们 {{Template:Serveur}}在 s ''SSH'' 打字 <pre># Serveur web1 ssh root@yyy.yyy.yyy.yyy # Serveur web2 ssh root@zzz.zzz.zzz.zzz </pre> ===配置 {{Template:Serveur}}web s === ;如果 {{Template:Serveur}}s 还没有它不安装的 web 服务,例如 <pre> apt-get install apache2 php5 </pre> ;一旦安装了 web 服务,或者如果 {{Template:Serveur}} 已经有了一个 web 1 和 web 2 在统计信息页中以绿色显示 [[File:HAProxyStat2.png]] ;如果您尝试访问 {{Template:Serveur}} 使用地址 xxx.xxx.xxx 你落在测试页 {{Template:Serveur}} web1 或 web 2 根据分配做 [[File:HAProxSite.png]] == 配置持久性 == ===通过源 IP 持久性 === 为了配置持久性的源 ip 地址只需更改平开医管局代理配置文件中的通过添加选项 ''粘 ''. ;启用的源 ip 地址通过持久性 ''棍子表 ''这是与我们的配置示例 <pre> listen cluster_web xxx.xxx.xxx.xxx:80 mode http # Modifier le mode de balancement balance source hash-type consistent # Ajouter une stick-table afin de garder en mémoire les IP stick-table type ip size 1m expire 1h stick on src option httpclose option forwardfor server web1 yyy.yyy.yyy.yyy:80 check server web2 zzz.zzz.zzz.zzz:80 check stats enable stats hide-version stats refresh 30s stats show-node stats auth utilisateur:motdepasse stats uri /stats </pre> 上面的示例允许实现持久性的 ''负载平衡 '' 基于用户的 IP。通过确保这种持久性 ''棍子表 '' 谁还记得有联系的 IPS {{Template:Serveur}}.<br> 这 ''stick-table'' 有一个大小为 1MB 和过期每小时。当用户连接到 {{Template:Serveur}} 它仍然是在这同一 {{Template:Serveur}} 直到期满的表或在出现错误时的 {{Template:Serveur}}.<br> <div style="background-color: #FFCC99;"> '''注意 ''': 所需的内存 ''stick-table'' 相对较低,在范围内 25.000 针对 1MB。要么 40MB 1.000.000 IP 地址。</div> ===通过 Cookie 持久性 === 另一种方法,以确保持续是秋千的使用 cookie。Cookie 是为了存储的信息在用户的计算机上放置一个小文件 {{Template:Serveur}}.<br> ====方法 ''cookie 插入 ''==== 第一个示例就是一个专门设计的附加 cookie 到创造 '''医管局代理 '''. ;编辑医管局代理配置文件,并将以下行添加到我们的配置 <pre> listen cluster_web xxx.xxx.xxx.xxx:80 mode http # Modifier le mode de balancement balance roundrobin # option du cookie cookie SRVNAME insert indirect nocache option httpclose option forwardfor server web1 yyy.yyy.yyy.yyy:80 cookie WeB1 check server web2 zzz.zzz.zzz.zzz:80 cookie WeB2 check stats enable stats hide-version stats refresh 30s stats show-node stats auth utilisateur:motdepasse stats uri /stats </pre> 上面的示例允许执行我们通过专用的 cookie 持久性会话。当连接 ''负载平衡器 '' 将客户端定向到两个之一 {{Template:Serveur}}s 和添加称为一个 cookie, '''SRVNAME''' 与值 '''WeB1''' ou '''WeB2''' 之后的分布作。<br> 选项 ''间接 '' 防止产生一个 cookie,如果另一个有效的 cookie 已存在为访问者和 ''使用 NoCache '' 避免了缓存的 cookie 之间第位访客和 ''负载平衡器 ''.<br> [[File:HACookieInsert.png]] ==== 方法 ''cookie 前缀 ''==== 第二个例子是一个预先存在的 cookie 预 fixage,这个方法会很有用,如果你想要只上一些饼干的持久性,或你不想创建一个专用的 cookie 到 '''HA Proxy'''. ;编辑医管局代理配置文件,并将以下行添加到我们的配置 <pre> listen cluster_web xxx.xxx.xxx.xxx:80 mode http # Modifier le mode de balancement balance roundrobin # option du cookie cookie PHPSESSID prefix indirect nocache option httpclose option forwardfor server web1 yyy.yyy.yyy.yyy:80 cookie WeB1 check server web2 zzz.zzz.zzz.zzz:80 cookie WeB2 check stats enable stats hide-version stats refresh 30s stats show-node stats auth utilisateur:motdepasse stats uri /stats </pre> 上面的示例允许设立的我们通过前缀对现有的 cookie 的会话持久性。当连接 ''负载平衡器 '' 将客户端定向到两个之一 {{Template:Serveur}}s 将前缀添加到命名的 cookie '''PHPSESSID''' 与值 '''WeB1''' ou '''WeB2''' 之后的分布作。<br> 选项 ''indirect'' 防止产生一个 cookie,如果另一个有效的 cookie 已存在为访问者和 ''nocache'' 避免了缓存的 cookie 之间第位访客和 ''负载平衡器 ''.<br> [[File:HACookiePrefix.png]] ==配置 ''保持 ''== 根据您的配置,您可能需要激活 ''保持 ''.<br> ''保持 '' 允许对 ''负载平衡器 '' 重用之间的现有连接 {{Template:Serveur}} 和用户,而不是启动一个新的连接,为每个请求。 ;编辑医管局代理配置文件,并将以下行添加到我们的配置 <pre> listen cluster_web xxx.xxx.xxx.xxx:80 mode http balance roundrobin # Modifier la directive de fermeture option http-server-close # Ajouter un delai de 3000 secondes avant fermeture timeout http-keep-alive 3000 option forwardfor server web1 yyy.yyy.yyy.yyy:80 check server web2 zzz.zzz.zzz.zzz:80 check stats enable stats hide-version stats refresh 30s stats show-node stats auth utilisateur:motdepasse stats uri /stats </pre> ==实施 SSL 管理 == 它可能有助于建立 SSL 重定向你网站管理,例如,在具有空间安全的网站。<br> 为了执行 HTTP 重定向 -> 在他的 HTTPS '''HA Proxy''' 文档是可用: [[:fr: Mettre en place une redirection SSL HA Proxy]] [[Category:cloudstack]] [[Category:公共云]] [[Category:私有云]] <br /> <comments />
该页面使用的模板:
模板:Sauvegarde
(
查看源代码
)
模板:Serveur
(
查看源代码
)
返回至
配置一个代理医管局对 Cloudstack
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息
投稿
fr-wiki.ikoula.com
en-wiki.ikoula.com
es-wiki.ikoula.com
it-wiki.ikoula.com
nl-wiki.ikoula.com
de-wiki.ikoula.com
pt-wiki.ikoula.com
ru-wiki.ikoula.com
pl-wiki.ikoula.com
ro-wiki.ikoula.com
ja-wiki.ikoula.com
zh-wiki.ikoula.com
he-wiki.ikoula.com
ar-wiki.ikoula.com