美文网首页
day 29 综合架构开场章节

day 29 综合架构开场章节

作者: 流云若雨 | 来源:发表于2019-08-12 08:46 被阅读0次

课程介绍部分

1. 系统路由配置方法  centos6 centos7
   查看系统路由表信息: netstat -rn / route -n / ip route show
2. 企业办公环境上网原理
   虚拟主机网络通讯原理
3. 系统中常用网络相关命令
4. 综合架构组成部分
5. 综合架构服务准备
   a 系统基础优化配置
   b 系统网络配置
   c 进行虚拟主机克隆操作

一.系统路由配置

作用:对网络线路可以进行选路
1.系统静态默认路由配置
centos6 (net-tools)
添加静态默认路由
[root@oldboyedu ~]# route add default gw 10.0.0.254   
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.254      0.0.0.0         UG    0      0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
[root@oldboyedu ~]# ping 223.5.5.5
PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=27.2 ms
删除静态默认路由
[root@oldboyedu ~]# route del default gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0

centos7 (iproute)
添加静态默认路由
[root@oldboyedu ~]# ip route add default via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.254      0.0.0.0         UG    0      0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
[root@oldboyedu ~]# ping 223.5.5.5
PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=27.4 ms
删除静态默认路由
[root@oldboyedu ~]# ip route del default via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0


2) 系统静态网段路由配置
centos6 (net-tools)
添加静态网段路由
[root@oldboyedu ~]# route add -net 223.5.5.0 netmask 255.255.255.0 gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
223.5.5.0       10.0.0.254      255.255.255.0   UG    0      0        0 eth0
删除静态网段路由
route del -net 223.6.6.0 netmask 255.255.255.0 gw 10.0.0.254

centos7 (iproute)
添加静态默认路由
[root@oldboyedu ~]# ip route add 223.6.6.0/24 via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
223.6.6.0       10.0.0.254      255.255.255.0   UG    0      0        0 eth0
删除静态默认路由
ip route del 223.6.6.0/24 via 10.0.0.254

3) 系统静态主机路由配置
centos6 (net-tools)
添加静态主机路由
[root@oldboyedu ~]# route add -host 223.5.5.5 gw 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
223.5.5.5       10.0.0.254      255.255.255.255 UGH   0      0        0 eth0
[root@oldboyedu ~]# ping 223.5.5.5
PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=26.9 ms
[root@oldboyedu ~]# ping 223.5.5.6
connect: 网络不可达
删除静态主机路由
route del -host 223.5.5.5 gw 10.0.0.254

centos7 (iproute)
添加静态主机路由
[root@oldboyedu ~]# ip route add 223.5.5.5/32 via 10.0.0.254
[root@oldboyedu ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
223.5.5.5       10.0.0.254      255.255.255.255 UGH   0      0        0 eth0
[root@oldboyedu ~]# ping 223.5.5.5
PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.
64 bytes from 223.5.5.5: icmp_seq=1 ttl=128 time=32.3 ms
[root@oldboyedu ~]# ping 223.5.5.6
connect: 网络不可达
删除静态主机路由
ip route del 223.5.5.5/32 via 10.0.0.254

上面的路由配置都是临时配置
要永久配置的话得去vim /etc/sysconfig/network-scripts/ifcfg-eth0

企业网络配置说

一个里程:进行网络拓扑规划
规划图
第二个里程:路由器上配置
配置路由接口地址
配置外网拨号设置
配置动态获取地址(DHCP)
第三个里程:交换机配置
配置交换机vlan设置:(命令行)
ps:交换机所有的接口属于一个广播域
1.创建vlan
    vlan xxxx
2.将指定接口划入指定vlan中
    switchport access vlan10
 trunk: 对传输数据不打标, 允许不同vlan数据包进行传输
 设置方式:
 1) 指定接口模式
 sw mode trunk
虚拟主机上网原理
问题一:ssh远程连接不上
  虚拟主机网络信息:
  01.虚拟网卡地址配置
  02.确认选择虚拟网卡
  03.确认远程服务是否开启
  04.确认安全服务关闭
    物理主机网络信息
    01.确认虚拟网卡激活
    02.确认虚拟网卡地址
    03确认虚拟网络服务  services.msc
  问题二:无法访问外网
    原因:
    01.网卡信息配置
    02.初始化虚拟网络配置
    03.确认虚拟网络服务   service.msc
    04.翻墙代理工具开启
   方式:桥接
图片.png

综合架构部署阶段

1.将基础部分知识 进行实际应用
2.综合架构所学习内容企业应用
3.综合架构学习各种服务程序  如何学习服务应用  排错配置方法
4.综合架构后续做铺垫      shell    mysql数据库  代码上线   jinkens
5.综合架构完后会有架构述职   
综合架构组成部分
01.  防火墙服务器    阻止非法入侵        iptables/firewalld
02.  负载均衡服务器  10.0.0.5/172.16.1.5    lb01        调度分配请求信息    nginx/lvs/haproxy(?)
     负载均衡服务器  10.0.0.6/172.16.1.6    lb02        调度分配请求信息    nginx/lvs/haproxy(?) 
03.  网站web服务器   10.0.0.7/172.16.1.7    web01       处理用户访问请求    nginx/apache/tomcat/php/python
     网站web服务器   10.0.0.8/172.16.1.8    web02       处理用户访问请求    nginx/apache/tomcat/php/python
     网站web服务器   10.0.0.9/172.16.1.9    web03       处理用户访问请求    nginx/apache/tomcat/php/python
04.  数据库服务器    10.0.0.51/172.16.1.51  db01        存储字符信息        mysql/mariadb/oracle(数据库)    
05.  存储服务器      10.0.0.31/172.16.1.31  nfs01       存储图片/视频/音频  nfs/分布式存储
                     10.0.0.32/172.16.1.32  nfs02       存储图片/视频/音频  nfs/分布式存储    
06.  缓存服务器      内存存储数据        memcache/redis/mongodb
07.  vpn服务器       10.0.0.61/172.16.1.61  m01         用户身份认证        pptp vpn  (自己研究)
    
08.  跳板机服务器    10.0.0.61/172.16.1.61  m01         监管作用            jumpserver(自己研究)
09.  批量管理服务器  10.0.0.61/172.16.1.61  m01         批量管理            ansible/saltstack
10.  监控服务器      10.0.0.71/172.16.1.71  zabbix      监控服务运行状态    zabbix
架构图
综合架构环境准备
1.网络配置进行调整
    a需要添加网卡信息
    b配置网卡地址信息
     cd /etc/sysconfig/network-scripts/
     cp ifcfg-eth0 ifcfg-eth1
     TYPE=Ethernet
     PROXY_METHOD=none
     BROWSER_ONLY=no
     BOOTPROTO=none
     DEFROUTE=yes
     IPV4_FAILURE_FATAL=no
     IPV6INIT=yes
     IPV6_AUTOCONF=yes
     IPV6_DEFROUTE=yes
     IPV6_FAILURE_FATAL=no
     IPV6_ADDR_GEN_MODE=stable-privacy
     NAME=eth1
     DEVICE=eth1
     ONBOOT=yes
     IPADDR=172.16.1.200
     PREFIX=24
     IPV6_PRIVACY=no
     systemctl restart network
检查确认:
[root@oldboyedu network-scripts]# ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:e5:d0:c7 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.200/24 brd 10.0.0.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::560b:9e4b:8f6b:f8fb/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:e5:d0:d1 brd ff:ff:ff:ff:ff:ff
    inet 172.16.1.200/24 brd 172.16.1.255 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::3a47:1ca6:b9e2:2f6c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
2.进行系统基础优化
  a关闭系统安全策略
   getenforce
   systemctl stop firewalld.service
   systemctl disable firewalld.service
  b更新yum源
   curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
   wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
   yum clean all清除下载缓存
   c 更新系统字符集
   
   d 更新本地hosts文件

cat >> /etc/hosts <<EOF
10.0.0.5 lb01
10.0.0.6 lb02
10.0.0.7 web01
10.0.0.8 web02
10.0.0.9 web03
10.0.0.31 nfs01
10.0.0.41 backup
10.0.0.51 db01
10.0.0.61 m01
10.0.0.71 zabbix
EOF

3) 虚拟主机克隆操作
   a 虚拟主机目录规划
   b 虚拟主机克隆操作 
     PS: 虚拟主机克隆好,一台一台开启进行修改网络配置  
     
4) 虚拟主机克隆后调整
   修改主机名称:
   hostnamectl set-hostname backup
   修改主机网卡地址:
   sed -ri 's#200#41#g;/UUID|HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth[01]

相关文章

  • day 29 综合架构开场章节

    课程介绍部分 一.系统路由配置 上面的路由配置都是临时配置要永久配置的话得去vim /etc/sysconfig/...

  • 2019-08-12

    day 30 综合架构开场章节 课程介绍 1. 备份服务概念介绍2. rsync备份服务软件使用方法3. rsyn...

  • day 30 综合架构备份章节

    一.课程介绍部分 01.学习方法---服务 02.网络知识常用命令 二.系统模板主机克隆说明 三.01.备份服务概...

  • 2019-08-14 综合架构存储服务

    day 32 综合架构存储服务章节 课程介绍: 1. rsync备份服务常见异常问题2. rsync备份服务全网备...

  • 2019-08-13

    day31 综合架构备份服务章节 课程介绍 1. rsync备份服务传输数据原理2. rsync备份服务命令参数说...

  • day 31综合架构备份服务章节

    课程介绍 rsync守护进程模式备份数据原理 错误说明: rsync命令参数说明 rsync守护进程备份服务企业应...

  • day 32综合架构存储服务章节

    一.课程介绍部分 二.课程回顾 三.rsync备份服务常见异常问题 四.网站存储服务概念介绍 五.网站存储服务部署过程

  • day 33综合架构存储服务章节

    课程介绍 课程知识回顾 网站存储服务配置文件参数信息 总结:影响数据存储因素 03. 服务端重要文件信息说明: 0...

  • 综合架构后续内容及期末架构开场

    综合架构的愿景 综合架构 : 公司网站架构 基础概念掌握 熟悉公司实际应用的服务 排错能力 Linux 提示-...

  • Day29综合架构基础介绍

    架构基础知识概述 什么是项目?类似于手机的app,每一个app都可以算做一个项目 什么是架构维护一个项目使用的一套...

网友评论

      本文标题:day 29 综合架构开场章节

      本文链接:https://www.haomeiwen.com/subject/lazqjctx.html