阿里云SLB配置
2018-03-21 15:17
295 查看
一、简介
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务。负载均衡可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。二、配置SLB
1.购买SLB并接入交换机公网SLB是可以直接分发到内网服务器的,这样可以不占用公网带宽。
这里使用内网SLB示例,因为免费。
2.配置后端服务器
(1)环境介绍
ip | 环境 |
---|---|
172.17.198.246 | SLB的分发ip |
172.17.198.242 | 单机LNMP |
172.17.198.238 | 单机LNMP |
ip | 权重 | 文件 |
---|---|---|
172.17.198.242 | 1 | index.php |
172.17.198.238 | 3 | inex.html |
前端端口80,分发到后端服务器的80端口。
4.写入访问文件并且配置nginx
[root@172.17.198.238 test]# cat index.html test 2018 [root@172.17.198.242 test]# cat index.php <?php phpinfo(); ?>
三、访问
1.使用curl -H “Host:zwwl.test.com”指定域名测试,负载均衡配置成功。[root@zhangwan22222222 ~]# curl 172.17.198.246:80 -H "Host:zwwl.test.com" test 2018 [root@zhangwan22222222 ~]# curl 172.17.198.246:80 -H "Host:zwwl.test.com" test 2018 [root@zhangwan22222222 ~]# curl 172.17.198.246:80 -H "Host:zwwl.test.com" test 2018 [root@zhangwan22222222 ~]# curl 172.17.198.246:80 -H "Host:zwwl.test.com"|less % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head>; <style type="text/css"> body {background-color: #fff; color: #222; font-family: sans-serif;} pre {margin: 0; font-family: monospace;} a:link {color: #009; text-decoration: none; background-color: #fff;} a:hover {text-decoration: underline;} table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}
相关文章推荐
- 阿里云SLB负载均衡配置
- 记阿里云SLB后配置Nginx反向代理百度地图API的坑
- [置顶] 阿里云堡垒机配置负载均衡SLB
- 阿里云slb和ucloud负载均衡ulb添加ssl证书将http服务https化的配置详解
- 阿里云slb和ucloud负载均衡ulb添加ssl证书将http服务https化的配置详解
- 阿里云SLB配置http跳转https
- 阿里云负载均衡器(SLB)的配置方法
- 阿里云负载均衡SLB配置https
- 阿里云SLB HTTPS证书配置
- 阿里云centOS配置lamp环境
- 阿里云服务器 ubuntu14.04 配置ftp
- Linux配置阿里云镜像
- 阿里云配置https
- 基于阿里云SLB/ESS/EIP/ECS/VPC的同城高可用方案演练
- 阿里云服务器Svn-Server无法连接,阿里云服务器SVNServer配置
- ubuntu阿里云服务器图形界面配置
- 阿里云ECS Ubuntu配置PHP开发环境
- java maven速度慢解决方案,配置阿里云镜像
- 使用阿里云配置中心ACM实现zookeeper依赖服务的透明Failover迁移