zoukankan      html  css  js  c++  java
  • 实操题

    转至:https://www.cnblogs.com/tui463/archive/2004/01/13/13114065.html

    实操题

    网络管理

    1、在eNSP中使用S5700交换机进行配置,通过一条命令划分vlan2、vlan3、vlan1004,通过端口组的方式配置端口1-5为access模式,并添加至vlan2中。配置端口10为trunk模式,并放行vlan3。创建三层vlan2,配置IP地址为:172.16.2.1/24,创建三层vlan1004,配置IP地址为:192.168.4.2/30。通过命令添加默认路由,下一跳为192.168.4.1。(使用完整命令)

    [Huawei]vlan batch 2 3 1004

    [Huawei]port-group 1

    [Huawei-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/5

    [Huawei-port-group-1]port link-type access

    [Huawei-port-group-1]port default vlan 2

    [Huawei]interface GigabitEthernet 0/0/10

    [Huawei-GigabitEthernet0/0/10]port link-type trunk

    [Huawei-GigabitEthernet0/0/10]port trunk allow-pass vlan 3

    [Huawei]interface Vlanif 2

    [Huawei-Vlanif2]ip address 172.16.2.1 24

    [Huawei]interface Vlanif 1004

    [Huawei-Vlanif1004]ip address 192.168.4.2 30

    [Huawei]ip route-static 0.0.0.0 0 192.168.4.1

    2、通过一条命令在S1交换机(交换机使用S5700)上创建vlan100、vlan101,配置vlan100网关为:172.16.100.254/24。配置vlan101网关为:172.16.101.254/24。配置g0/0/1端口为trunk模式,放行vlan 100。配置g0/0/2端口为access模式,所属vlan 101。将以上所有操作命令和返回结果以文本形式提交答题框。

    [SW1]vlan batch 100 101

    [SW1]interface Vlanif 100

    [SW1-Vlanif100]ip address 172.16.100.254 24

    [SW1]interface Vlanif 101

    [SW1-Vlanif101]ip address 172.16.101.254 24

    [SW1]interface GigabitEthernet 0/0/1

    [SW1-GigabitEthernet0/0/1]port link-type trunk

    [SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 100

    [SW1-GigabitEthernet0/0/1]quit

    [SW1]interface GigabitEthernet 0/0/2

    [SW1-GigabitEthernet0/0/2]port link-type access

    [SW1-GigabitEthernet0/0/2]port default vlan 101

    [SW1-GigabitEthernet0/0/2]quit

    3、配置路由器R1(路由器使用AR2220)端口g0/0/1地址为192.168.101.1/30,配置g0/0/2端口地址为12.12.12.2/30。添加静态路由去往192.168.1.0/24网段,下一跳地址为192.168.101.2,添加静态路由去往192.168.2.0/24,下一跳地址为12.12.12.1。将以上所有操作和返回结果以文本形式提交到答题框。

    [R1]interface GigabitEthernet 0/0/1

    [R1-GigabitEthernet0/0/1]ip address 192.168.101.1 30

    [R1-GigabitEthernet0/0/1]quit

    [R1]interface GigabitEthernet 0/0/2

    [R1-GigabitEthernet0/0/2]ip address 12.12.12.2

    [R1-GigabitEthernet0/0/2]quit

    [R1]ip route-static 192.168.1.0 24 192.168.101.2

    [R1]ip route-static 192.168.2.0 24 12.12.12.1

    yum源管理

    1、当前有一个centos7.2-1511.iso的镜像文件,使用这个文件配置yum源,要求将这个镜像文件挂载在/opt/centos目录。还存在一个ftp源,IP地址为192.168.100.200,ftp共享的目录为/opt,/opt目录中存在一个iaas目录(该目录下存在一个repodata目录)请问如何配置自己的local.repo文件,使得可以使用这两个地方的软件包,安装软件。请将local.repo文件的内容以文本形式提交到答题框。

    [centos]

    name=centos

    baseurl=file:///opt/centos

    gpgcheck=0

    enabled=1

    [iaas]

    name=iaas

    baseurl=ftp://192.168.100.200/iaas

    gpgcheck=0

    enabled=1

    2、当前有一个/opt目录,该目录中的文件如下所示:|—— ambari-2.6.0.0 |  |—— ambari |  |—— repodata |  |—— smartsense  |—— base |  |—— packages |  |—— repodata  请问如何配置自己的local.repo文件,使得可以使用这两个地方的软件包,安装软件。请将local.repo文件的内容以文本形式提交到答题框。

    [centos]

    name=centos

    baseurl=file:///opt/ambari-2.6.0.0

    gpgcheck=0

    enabled=1

    [iaas]

    name=iaas

    baseurl=file:///opt/base

    gpgcheck=0

    enabled=1

    FTP安装使用

    使用xserver1虚拟机,安装ftp服务,并配置ftp的共享目录为/opt。使用VMware软件继续启动提供的xserver2虚拟机(配置虚拟机xserver2的IP为192.168.100.12,主机名为xserver2),并创建该虚拟机的yum源文件ftp.repo使用xserver1的ftp源(配置文件中的FTP地址使用主机名)。配置完成后,将xserver2节点的ftp.repo文件以文本形式提交到答题框。

    [centos]

    name=centos

    baseurl=ftp://xserver1/centos

    gpgcheck=0

    enabled=1

    Samba管理

    使用xserver1虚拟机,安装Samba服务所需要的软件包,将xserver1节点中的/opt/share目录使用Samba服务共享出来(目录不存在请自行创建)。操作完毕后,将xserver1节点Samba配置文件中的[share]段落和执行netstat -ntpl命令的返回结果以文本形式提交到答题框。

    [share]

    path = /opt/share

    browseable = yes

    public = yes

    writable = yes

    [root@samba ~]# netstat -ntpl
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      2763/smbd           
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1548/sshd           
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2697/master         
    tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      2763/smbd           
    tcp6       0      0 :::139                  :::*                    LISTEN      2763/smbd           
    tcp6       0      0 :::22                   :::*                    LISTEN      1548/sshd           
    tcp6       0      0 ::1:25                  :::*                    LISTEN      2697/master         
    tcp6       0      0 :::445                  :::*                    LISTEN      2763/smbd          

    数据库管理

    1、使用VMware创建两台centos7系统的虚拟机,安装数据库服务,并将两台数据库配置为主从数据库模式(master和slave)。配置完成后,在从节点,执行show slave statusG查看从节点的复制状态。将查看从节点服务状态的返回结果以文本形式提交到答题框。(数据库用户名root,密码000000;关于数据库的命令均使用小写)

    mysql> show slave statusG

    ********************1.row********************

    Slave_IO_State: Waiting for master to send event

    Master_Host: 192.168.2.222 //主服务器地址

    Master_User: mysync //授权账户名,尽量避免使用root

    Master_Port: 3306 //数据库端口,部分版本没有此行

    Connect_Retry: 60

    Master_Log_File: mysql-bin.000004

    Read_Master_Log_Pos: 600 //#同步读取二进制日志的位置,大于等于Exec_Master_Log_Pos

    Relay_Log_File: ddte-relay-bin.000003

    Relay_Log_Pos: 251

    Relay_Master_Log_File: mysql-bin.000004

    Slave_IO_Running: Yes //此状态必须是Yes

    Slave_SQL_Running: Yes //此状态必须是Yes

    ......

    2、使用提供的“all-in-one”虚拟机,进入数据库。(1)创建本地用户examuser,密码为000000;(2)查询mysql数据库中的user表的host,user,password字段;(3)赋予这个用户对所有数据库拥有“查询”“删除”“更新”“创建”的本地权限。依次将操作命令和返回结果以文本形式提交到答题框。

    MariaDB [(none)]> insert into mysql.user(host,user,password) values("localhost","examuser",password("000000"));
    Query OK, 1 row affected, 4 warnings (0.01 sec)

    MariaDB [(none)]> use mysql
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    Database changed

    MariaDB [mysql]> select host,user,password from user;
    +-----------+----------+-------------------------------------------+
    | host      | user     | password                                  |
    +-----------+----------+-------------------------------------------+
    | localhost | root     | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
    | 127.0.0.1 | root     | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
    | ::1       | root     | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
    | localhost | examuser | *032197AE5731D4664921A6CCAC7CFCE6A0698693 |
    +-----------+----------+-------------------------------------------+
    4 rows in set (0.00 sec)

    MariaDB [mysql]> grant select,delete,update,create on *.* to examuser@'localhost' identified by '000000';
    Query OK, 0 rows affected (0.00 sec)

    3、使用VMware软件和提供的CentOS-7-x86_64-DVD-1511.iso创建虚拟机,自行配置好网络和YUM源,安装mariadb数据库,安装完毕后登录数据库,查询当前系统的时间和用户。依次将操作命令和返回结果以文本形式提交到答题框。(数据库用户名root,密码000000;关于数据库的命令均使用小写)

    MariaDB [(none)]> select sysdate();
    +---------------------+
    | sysdate()           |
    +---------------------+
    | 2020-09-15 05:47:59 |
    +---------------------+
    1 row in set (0.01 sec)

    MariaDB [(none)]> select user();
    +----------------+
    | user()         |
    +----------------+
    | root@localhost |
    +----------------+
    1 row in set (0.00 sec)

    Linux存储LVM管理

    1、使用VMware软件和提供的CentOS-7-x86_64-DVD-1511.iso创建虚拟机,自行配置好网络并多添加一块大小为20G的硬盘,使用fdisk命令对该硬盘进行分区,要求分出三个大小为5G的分区。使用这三个分区,创建名xcloudvg的卷组。然后创建名xcloudlv的逻辑卷,大小为12G,最后用xfs文件系统对逻辑卷进行格式化并挂载到/mnt目录下。将上述所有操作命令和返回结果以文本形式提交到答题框。

    [root@localhost ~]# pvcreate /dev/vdb1 /dev/vdb2 /dev/vdb3

    Physical volume "/dev/vdb1" successfully created

    Physical volume "/dev/vdb2" successfully created

    Physical volume "/dev/vdb3" successfully created

    [root@localhost ~]# vgcreate xcloudvg /dev/vdb[1-3]

    Volume group "xcloudvg" successfully created

    [root@localhost ~]# lvcreate -L +12G -n xcloudvg xcloudlv

    Logical volume "xcloudlv" created.

    [root@localhost ~]# mkfs.xfs /dev/mapper/xcloudvg-xcloudlv

    [root@localhost ~]# mount /dev/mapper/xcloudvg-xcloudlv /mnt/

    2、使用xserver1虚拟机,使用VMWare软件自行添加一块大小为20G的硬盘,使用fdisk命令对该硬盘进行分区,要求分出两个大小为5G的分区。使用两个分区,创建名xcloudvg的卷组并指定PE大小为16MB。将执行vgdisplay命令的返回结果以文本形式提交到答题框。

    [root@localhost ~]# pvcreate /dev/sdb1 /dev/sdb2
      Physical volume "/dev/sdb1" successfully created
      Physical volume "/dev/sdb2" successfully created

    [root@localhost ~]# vgcreate xcloudvg /dev/sdb[1-2] -s 16M
      Volume group "xcloudvg" successfully created

    [root@localhost ~]# vgdisplay 
      --- Volume group ---
      VG Name               centos
      System ID             
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               39.51 GiB
      PE Size               4.00 MiB
      Total PE              10114
      Alloc PE / Size       10103 / 39.46 GiB
      Free  PE / Size       11 / 44.00 MiB
      VG UUID               Izpuld-2eFu-xP0t-Z9Pv-lHAo-L357-DITdew
       
      --- Volume group ---
      VG Name               xcloudvg
      System ID             
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  1
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                0
      Open LV               0
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               9.97 GiB
      PE Size               16.00 MiB
      Total PE              638
      Alloc PE / Size       0 / 0   
      Free  PE / Size       638 / 9.97 GiB
      VG UUID               Ilp8Uw-t7pT-LLQl-bm7a-dlZM-XcXh-a9cdq0

    OpenStack管理

    使用VMware创建两台CentOS7.2的操作系统,自行配置网络与IP,使用提供的软件包,安装OpenStack平台。安装完成后,使用curl命令查询http://192.168.100.10/dashboard/auth/login/。将curl命令的查询结果以文本形式提交到答题框。

    [root@controller ~]# curl http://192.168.100.10/dashboard/auth/login/

    Login - XianDian Dashboard

    云计算基础架构服务平台

    Keystone管理

    使用提供的“all-in-one”虚拟机,创建用户testuser,密码为xiandian,将testuser用户分配给admin项目,赋予用户admin的权限。依次将操作命令和查询结果以文本形式提交到答题框。

    [root@xiandian ~ ]# source /etc/keystone/admin-openrc.sh

    [root@xiandian ~ ]#  openstack user create --domain demo --password xiandian testuser
    +-----------+----------------------------------+
    | Field     | Value                            |
    +-----------+----------------------------------+
    | domain_id | 9321f21a94ef4f85993e92a228892418 |
    | enabled   | True                             |
    | id        | 474aab088bd64383b0a3a032e6f9ba7e |
    | name      | testuser                         |
    +-----------+----------------------------------+

    [root@xiandian ~ ]# openstack role add --project admin --user testuser admin

    glance管理

    登录OpenStack的controller节点,使用crt的传输工具将提供的cirros-0.3.4-x86_64-disk.img镜像上传至“aas-all”节点的/root目录下;使用glance命令将镜像上传,并命名为mycirros,最后使用glance命令查看该镜像的详细信息。将上述所有操作命令和返回结果以文本形式提交到答题框。

    [root@xiandian ~]# source /etc/keystone/admin-openrc.sh

    [root@xiandian ~]# glance image-create --name mycirros --disk-format qcow2 --container-format bare --progress < cirros-0.3.4-x86_64-disk.img

    [=============================>] 100%
    +------------------+--------------------------------------+
    | Property         | Value                                |
    +------------------+--------------------------------------+
    | checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
    | container_format | bare                                 |
    | created_at       | 2020-09-15T13:21:53Z                 |
    | disk_format      | qcow2                                |
    | id               | 5cebbeb7-4da6-4a02-a4e0-e5f523349cd5 |
    | min_disk         | 0                                    |
    | min_ram          | 0                                    |
    | name             | mycirros                             |
    | owner            | f9ff39ba9daa4e5a8fee1fc50e2d2b34     |
    | protected        | False                                |
    | size             | 13287936                             |
    | status           | active                               |
    | tags             | []                                   |
    | updated_at       | 2020-09-15T13:21:53Z                 |
    | virtual_size     | None                                 |
    | visibility       | private                              |
    +------------------+--------------------------------------+

    [root@xiandian ~]# glance image-show 5cebbeb7-4da6-4a02-a4e0-e5f523349cd5
    +------------------+--------------------------------------+
    | Property         | Value                                |
    +------------------+--------------------------------------+
    | checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
    | container_format | bare                                 |
    | created_at       | 2020-09-15T13:21:53Z                 |
    | disk_format      | qcow2                                |
    | id               | 5cebbeb7-4da6-4a02-a4e0-e5f523349cd5 |
    | min_disk         | 0                                    |
    | min_ram          | 0                                    |
    | name             | mycirros                             |
    | owner            | f9ff39ba9daa4e5a8fee1fc50e2d2b34     |
    | protected        | False                                |
    | size             | 13287936                             |
    | status           | active                               |
    | tags             | []                                   |
    | updated_at       | 2020-09-15T13:21:53Z                 |
    | virtual_size     | None                                 |
    | visibility       | private                              |
    +------------------+--------------------------------------+

    Nova管理

    使用提供的“all-in-one”虚拟机,通过nova的相关命令创建名为exam,ID为1234,内存为1024M,硬盘为20G,虚拟内核数量为2的云主机类型,查看exam的详细信息。依次将操作命令及返回结果以文本形式提交到答题框。

    [root@xiandian ~ ]# nova flavor-create exam 1234 1024 20 2

    +------+------+-----------+------+-----------+------+-------+-------------+-----------+
    | ID   | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
    +------+------+-----------+------+-----------+------+-------+-------------+-----------+
    | 1234 | exam | 1024      | 20   | 0         |      | 2     | 1.0         | True      |
    +------+------+-----------+------+-----------+------+-------+-------------+-----------+

    [root@xiandian ~ ]# nova flavor-show 1234

    +----------------------------+-------+
    | Property                   | Value |
    +----------------------------+-------+
    | OS-FLV-DISABLED:disabled   | False |
    | OS-FLV-EXT-DATA:ephemeral  | 0     |
    | disk                       | 20    |
    | extra_specs                | {}    |
    | id                         | 1234  |
    | name                       | exam  |
    | os-flavor-access:is_public | True  |
    | ram                        | 1024  |
    | rxtx_factor                | 1.0   |
    | swap                       |       |
    | vcpus                      | 2     |
    +----------------------------+-------+

    Neutron管理

    使用VMWare软件启动提供的openstackallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。在dashboard界面创建云主机外部网络ext-net,子网为ext-subnet,云主机浮动IP可用网段为192.168.200.100~192.168.200.200,网关为192.168.200.1。创建云主机内部网络int-net1,子网为int-subnet1,云主机子网IP可用网段为10.0.0.100~10.0.0.200,网关为10.0.0.1。添加名为ext-router的路由器,添加网关在ext-net网络,添加内部端口到int-net1网络,完成内部网络int-net1和外部网络的连通。将执行neutron router-show ext-router命令所返回的结果以文本形式提交到答题框。

    [root@controller ~ ]# neutron router-show ab4a3754-3cd7-4748-b6ba-2bbf60c32db9
    +-------------------------+---------------------------------------------------------+
    | Field                   | Value                                                   |
    +-------------------------+---------------------------------------------------------+
    | admin_state_up          | True                                                    |
    | availability_zone_hints |                                                         |
    | availability_zones      | nova                                                    |
    | description             |                                                         |
    | distributed             | False                                                   |
    | external_gateway_info   | {"network_id": "057a7249-f9b2-4584-ba48-61ed0f9e0b43",  |
    |                         | "enable_snat": true, "external_fixed_ips":              |
    |                         | [{"subnet_id": "53f52117-4c87-4db8-9aa7-00b89e5ffc62",  |
    |                         | "ip_address": "192.168.200.3"}]}                        |
    | ha                      | False                                                   |
    | id                      | ab4a3754-3cd7-4748-b6ba-2bbf60c32db9                    |
    | name                    | ext-router                                              |
    | routes                  |                                                         |
    | status                  | ACTIVE                                                  |
    | tenant_id               | f9ff39ba9daa4e5a8fee1fc50e2d2b34                        |
    +-------------------------+---------------------------------------------------------+

    Cinder管理

    使用VMWare软件启动提供的openstackallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。使用cinder服务,创建名为“lvm”的卷类型,然后创建一块带“lvm”标识的云硬盘,名称为BlockVloume,大小为2G,查询该云硬盘详细信息。完成后,将cinder show BlockVloume命令的返回结果以文本形式提交到答题框。

    [root@xiandian ~]# cinder type-create lvm

    [root@xiandian ~]# cinder create --name BlockVloume --volume-type lvm 2

    [root@xiandian ~]# cinder show BlockVloume

    +--------------------------------+--------------------------------------+
    |            Property            |                Value                 |
    +--------------------------------+--------------------------------------+
    |          attachments           |                  []                  |
    |       availability_zone        |                 nova                 |
    |            bootable            |                false                 |
    |      consistencygroup_id       |                 None                 |
    |           created_at           |      2020-09-15T13:32:59.000000      |
    |          description           |                 None                 |
    |           encrypted            |                False                 |
    |               id               | ee6a021f-ba17-4986-ac8b-2e2d109d1c81 |
    |            metadata            |                  {}                  |
    |        migration_status        |                 None                 |
    |          multiattach           |                False                 |
    |              name              |             BlockVloume              |
    |     os-vol-host-attr:host      |          xiandian@lvm#LVM          |
    | os-vol-mig-status-attr:migstat |                 None                 |
    | os-vol-mig-status-attr:name_id |                 None                 |
    |  os-vol-tenant-attr:tenant_id  |   f9ff39ba9daa4e5a8fee1fc50e2d2b34   |
    |       replication_status       |               disabled               |
    |              size              |                  2                   |
    |          snapshot_id           |                 None                 |
    |          source_volid          |                 None                 |
    |             status             |              available               |
    |           updated_at           |      2020-09-15T13:33:00.000000      |
    |            user_id             |   0befa70f767848e39df8224107b71858   |
    |          volume_type           |                 lvm                  |
    +--------------------------------+--------------------------------------+

     

    Docker安装

    使用xserver1节点,自行配置YUM源,安装docker服务(需要用到的包为xserver1节点/root目录下的Docker.tar.gz)。安装完服务后,将registry_latest.tar上传到xserver1节点中并配置为私有仓库。要求启动registry容器时,将内部保存文件的目录映射到外部的/opt/registry目录,将内部的5000端口映射到外部5000端口。依次将启动registry容器的命令及返回结果、执行docker info命令的返回结果以文本形式提交到答题框。

    [root@master ~ ]# docker run -d -v /opt/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest

    62224e66c6cba850631dd4f0e86805817b7e7e47da6e24c08bf3122da3a5b977

    [root@master ~]# docker info
    Containers: 1
     Running: 1
     Paused: 0
     Stopped: 0
    Images: 11
    Server Version: 18.09.6
    Storage Driver: overlay2
     Backing Filesystem: xfs
     Supports d_type: true
     Native Overlay Diff: true
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
     Volume: local
     Network: bridge host macvlan null overlay
     Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
    runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
    init version: fec3683
    Security Options:
     seccomp
      Profile: default
    Kernel Version: 3.10.0-1127.19.1.el7.x86_64
    Operating System: CentOS Linux 7 (Core)
    OSType: linux
    Architecture: x86_64
    CPUs: 2
    Total Memory: 1.777GiB
    Name: slave
    ID: I5ST:BWUZ:OK3M:VZJF:3SWL:E2UF:PPLJ:XNQS:WOPU:JSYU:J2KG:M3BP
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    Labels:
    Experimental: false
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false
    Product License: Community Engine

    Docker运维

    使用xserver1节点,上传nginx_latest.tar到xserver1节点中,然后将该镜像打标签,上传至私有仓库。使用xserver2节点,自行安装docker服务,配置xserver2节点使用xserver1的私有仓库,配置完毕后,在xserver2节点拉取nginx_latest.tar镜像。最后将在xserver2上执行docker images命令返回的结果以文本形式提交到答题框。

    [root@master ~ ]# docker images

    REPOSITORY TAG IMAGE ID CREATED SIZE

    192.168.100.11:5000/nginx latest 94f6bc30fd27 4 seconds ago 126MB

    Docker管理

    1、假设当前存在docker镜像mysql:latest,将该镜像上传至本地,然后将该镜像推送至本地仓库(假设仓库地址为 192.168.100.100:5000),从私有仓库中拉取mariadb:v10.3.18镜像。运行mysql镜像,要求将内部3306端口映射到外部的13306端口,提供交互端口,后台运行,容器名为xmysql。最后将mysql镜像和创建的容器删除。依次提交操作命令。

    # docker load -i < mysql:latest

    # docker push 192.168.100.100:5000/mysql:latest

    # docker pull mariadb:v10.3.18

    # docker run --name xmysql -itd -p 13306:3306 mysql:latest /bin/bash

    # docker rmi mysql:latest

    # docker rm -f xmysql

    2、假设当前存在docker镜像tomcat:latest,现在将tomcat镜像导出,导出名称为tomcat_images.tar,放在/media目录下,将以上操作命令填入答题框。

    [root@server images]# docker save tomcat:latest > /media/tomcat_images.tar

    部署Swarm集群

    使用xserver1、xserver2节点,自行配置好网络,安装好docker-ce。部署Swarm集群,并安装Portainer图形化管理工具,部署完成后,使用浏览器登录ip:9000界面,进入Swarm控制台。将curl swarm ip:9000返回的结果以文本形式提交到答题框。

    [root@master ~ ]# curl 192.168.100.10:9000

    <!DOCTYPE html><html lang="en" ng-app="portainer">

    <head>

    <meta charset="utf-8">

    <title>Portainer</title>

    <meta name="description" content="">

    <meta name="author" content="Portainer.io">

    <div class="row" style="text-align:center">

    Loading Portainer...

    <i class="fa fa-cog fa-spin" style="margin-left:5px"></i>

    </div>

    <!-- !panel -->

    </div>

    LNMP环境部署

    使用xserver1节点,安装单节点lnmp环境。安装lnmp环境需要用到的YUM源为CentOS-7-x86_64-DVD-1511.iso和lnmp目录(均在/root目录下)。安装并配置完lnmp环境后。依次查询数据库、nginx、php服务的状态,并使用netstat -ntpl命令查看端口开放情况。最后依次将查询服务状态的返回结果,和查看端口开放情况的返回结果以文本形式提交到答题框。

    [root@localhost ~]# systemctl status mariadb

    [root@localhost ~]# systemctl status nginx

    [root@localhost ~]# systemctl status php-fpm

    [root@localhost ~]# netstat -ntpl

    WordPress应用系统

    1、使用xserver1节点,基于lnmp环境,部署WordPress应用(WordPress源码包在/root目录下)。应用部署完毕后,设置WordPress的站点标题为自己的姓名(例:名字叫张三,则设置站点标题为张三的BLOG),设置完毕后登录WordPress首页。最后将命令curl ip(ip为WordPress的首页ip)的返回结果以文本形式提交到答题框。

    [root@localhost ~]# curl 192.168.100.10

    <!DOCTYPE html>

    <title>张三 &#8211;又一个WordPress站点</title>

    <p>欢迎使用WordPress。这是您的第一篇文章。编辑或删除他,然后开始写作吧!</p>

    2、使用提供的软件包和VMware提供的centos7.2操作系统,完成LNMP+WordPress部署。部署完成后,进行登录,最后提交WordPress首页和后台管理界面。(设置WordPress名称为自己的姓名+BLOG,例如张三,则WordPress首页显示张三BLOG,答案的截图需体现这点)

  • 相关阅读:
    Javascript 操作select控件大全(新增、修改、删除、选中、清空、判断存在等) 转载
    FCKeditor 2.6 + Asp.Net 设置
    19个常用.net webservice服务集合
    ASP.NET Session无法使用或易丢失
    javascript实现缩略图
    Asp.net Excel导入或导出
    smarty截取中文乱码问题解决办法转载
    Git学习
    Android活动(Activity)的基本介绍
    Android活动(Activity)Toast和Menu
  • 原文地址:https://www.cnblogs.com/my-first-blog-lgz/p/13753271.html
Copyright © 2011-2022 走看看