云嘉云平台

设置公网IP

ubuntu系统

编辑50-cloud-init.yaml文件

# cat /etc/netplan/50-cloud-init.yaml 

network:
    version: 2
    ethernets:
        ens3:
            addresses:
            - 10.0.9.80/24
            match:
                macaddress: fa:16:3e:cb:48:95
            mtu: 1500
            nameservers:
                addresses:
                - 119.29.29.29
                - 114.114.114.114
                search: []
            routes:
            -   to: 0.0.0.0/0
                via: 10.0.9.1
            set-name: ens3
        ens7:  # 按系统网卡名称配置
            addresses:
            - x.x.x.x/25   # 按平台ui界面给出的ip地址
            match:
               macaddress: fa:16:3e:78:fb:f9
            mtu: 1500
            nameservers:
                addresses:
                - 119.29.29.29     # 按平台网络子网规划的DNS域名服务器
                - 114.114.114.114
                search: []
            routes:
            -   to: 0.0.0.0/0
                via: x.x.x.1   # 按平台规划的网关地址
            set-name: ens7

配置生效

# netplan apply

获取地址

# dhclient

centos7系统

新增ifcfg-eth1文件

# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
BOOTPROTO=dhcp
DEVICE=eth1
MTU=1500
ONBOOT=yes
TYPE=Ethernet
USERCTL=no

获取地址

# dhclient

格式化磁盘

查看磁盘分区

# fdisk -l

Disk /dev/vda: 137.4 GB, 137438953472 bytes, 268435456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d9559

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048     2099199     1048576   83  Linux
/dev/vda2         2099200   268435455   133168128   8e  Linux LVM

Disk /dev/vdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos_bogon-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos_bogon-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos_bogon-home: 78.5 GB, 78508982272 bytes, 153337856 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

格式化磁盘

# mkfs.xfs /dev/vdb
meta-data=/dev/vdb               isize=512    agcount=4, agsize=32768000 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=131072000, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=64000, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

查看UUID

# blkid 
/dev/mapper/centos_bogon-root: UUID="b1e53d30-c4c8-498f-8d0b-f4e7650914d5" TYPE="xfs" 
/dev/vda2: UUID="a58Rql-MErT-0Bwg-ewzE-3PKL-nzdB-c8e49F" TYPE="LVM2_member" 
/dev/vda1: UUID="9dd3421e-12fe-422b-93e4-259ed17894f9" TYPE="xfs" 
/dev/mapper/centos_bogon-swap: UUID="ba39f203-2ec9-47b6-99e7-54b36ef4b4f0" TYPE="swap" 
/dev/sr0: UUID="2022-07-20-18-15-19-00" LABEL="config-2" TYPE="iso9660" 
/dev/vdb: UUID="fd547c4e-7464-4d72-8752-5dc43ebec82b" TYPE="xfs" 
/dev/mapper/centos_bogon-home: UUID="6daec062-4408-4bf9-a768-514bcbcb58de" TYPE="xfs" 

挂载磁盘

# echo `blkid |grep /dev/vdb | awk '{print $2}'` /data xfs defaults 0 0 >> /etc/fstab

 

posted @ 2022-08-22 10:28  小吉猫  阅读(87)  评论(0编辑  收藏  举报