陈老师:1415968548 郑老师:2735197625 乐老师:354331153
客服热线:
19941464235/19906632509(微信同号)

客服微信

【Oracle OCP】vmware16安装rhel8

作者:炎燚小寶
发布时间:2023-12-19 09:16
浏览量:329

本文为云贝教育 刘峰 原创,请尊重知识产权,转发请注明出处,不接受任何抄袭、演绎和未经注明出处的转载。

环境说明

软件
版本
vmware
16+
redhat
8+

一、新建虚拟机配置


1.1、新建虚拟机



1.2、先选自定义,下一步


1.3、选择16.x,下一步


1.4、选择稍后安装操作系统


1.5、选择LINUX REDHAT 8版本


1.6、自定义虚拟机名称和位置(不要使用默认的名称和路径)



1.7、配置处理器,默认1核


1.8、内存配置,默认2G够用


1.9、网络配置,默认NAT


1.10、选择IO控制器类型,默认即可



1.11、选择磁盘接口,默认即可




1.12 创建虚拟磁盘


1.13、分配磁盘容量

分配50G,安装操作系统,下面的选项表示用多少分配多少

1.14、确认虚拟机配置信息,点击完成


二、规划虚拟机配置


2.1、查看虚拟机的配置,点击编辑虚拟机设置

2.2、配置ISO文件路径





2.3、选择添加磁盘


2.4、选择添加磁盘,下一步


2.5、选择磁盘类型,默认配置,下一步


2.6、创建新的虚拟机磁盘


2.7、指定50GB


2.8、完成添加


2.9、重复上述操作添加一块20GB的磁盘


2.10、确认虚拟机配置


三、安装


第二步里已经指定了安装ISO文件,直接点击开始安装

3.1、开启虚拟机



3.2、 选择安装操作系统

虚拟机界面单击鼠标,进入操作界面,按上键选择安装操作系统
ctl+atl退出界面

3.3 、选择语言,默认英语


3.4、 配置时间和日期



选择中国上海,完成配置


3.5、 选择带GUI的安装包,默认配置即可


3.6、 配置磁盘分区


选择第一块50G盘,自定义配置


选择标准分区,不使用LVM,点击添加分区


配置/boot分区 500M

配置SWAP分区 4096M



剩下的磁盘给/分区



点击确认,接受配置。另外两块盘暂时不要配置,等操作系统安装完成之后再配置


3.7、 关闭kdump和安全策略



3.8、 网络配置

详见《01-操作系统网络配置》和4.2章节,这里跳过

3.9、 开始安装


3.10、 配置root密码

为了防止后期忘记root密码,建议给root的密码设置为root。当然生产环境禁止这样设置

3.11、 安装完成,点击重启即可


3.12、接受协议,完成安装




四、初始化配置


4.1、 配置主机名

#hostnamectl set-hostname Oracle19c04

#bash

# hostname
Oracle19c04

4.2、 配置网络


1)自动配置IP

显示连接
查看IP配置信息



这里IP是自动分配的,我们也可以手工指定IP



2)手工配置IP


查看网卡信息

[root@Oracle19c04 network-scripts]# nmcli con show 
NAME    UUID                                  TYPE      DEVICE 
ens160  bc5226c7-5985-480c-9ad7-3ab65e01d2d1  ethernet  ens160 
virbr0  2a18e5e8-73b2-4e1b-a40e-a265960d1c2c  bridge    virbr0


编辑配置文件:/etc/sysconfig/network-scripts/ifcfg-ens160

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=ens160
UUID=bc5226c7-5985-480c-9ad7-3ab65e01d2d1
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.2.101
PREFIX=24
GATEWAY=192.168.2.2


重启网卡

ifdown ens160
ifup ens160


配置dns解析,以下配置二选一

nameserver 8.8.8.8
或
nameserver 114.114.114.114


测试外网

[root@Oracle19c04 network-scripts]# ping www.baidu.com
PING www.a.shifen.com (180.101.50.242) 56(84) bytes of data.
64 bytes from 180.101.50.242 (180.101.50.242): icmp_seq=1 ttl=128 time=13.8 ms
64 bytes from 180.101.50.242 (180.101.50.242): icmp_seq=2 ttl=128 time=15.2 ms



4.3 存储挂载配置

1)查看未使用的磁盘

# fdisk -l

Disk /dev/nvme0n2: 50 GiB, 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/nvme0n3: 20 GiB, 21474836480 bytes, 41943040 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


2) 分区存储

规划如下:
/dev/nvme0n2挂载到/u01目录,用于安装数据库软件和存储数据库文件
/dev/nvme0n3挂载到/soft目录,用于存放数据库安装介质


针对磁盘分区

# fdisk /dev/nvme0n2 

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x457970ba.

Command (m for help): p
Disk /dev/nvme0n2: 50 GiB, 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
Disklabel type: dos
Disk identifier: 0x457970ba

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-104857599, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-104857599, default 104857599): 

Created a new partition 1 of type 'Linux' and of size 50 GiB.

Command (m for help): p
Disk /dev/nvme0n2: 50 GiB, 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
Disklabel type: dos
Disk identifier: 0x457970ba

Device         Boot Start       End   Sectors Size Id Type
/dev/nvme0n2p1       2048 104857599 104855552  50G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


具体命令解释如下:

Help:

  DOS (MBR)
   a   toggle a bootable flag
   b   edit nested BSD disklabel
   c   toggle the dos compatibility flag

  Generic
   d   delete a partition
   F   list free unpartitioned space
   l   list known partition types
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition

  Misc
   m   print this menu
   u   change display/entry units
   x   extra functionality (experts only)

  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file

  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table


确认分区

# file /dev/nvme0n2p1
/dev/nvme0n2p1: block special (259/7)



3)格式化分区

mkfs.xfs /dev/nvme0n2p1



4)挂载分区


创建挂载目录

mkdir /u01


挂载分区到指定目录

mount /dev/nvme0n2p1 /u01


检查挂载点

df -Th


针对第二块盘也是同样的操作



5)配置自动挂载

编辑配置文件 /etc/fstab

/dev/nvme0n2p1 /u01 xfs defaults 0 0


也可以查出分区的UUID,通过UUDI挂载

[root@Oracle19c04 ~]# blkid /dev/nvme0n2p1 
/dev/nvme0n2p1: UUID="90d6542a-ac29-4ed7-9d91-927224b92b7e" TYPE="xfs" PARTUUID="457970ba-01"

UUID=90d6542a-ac29-4ed7-9d91-927224b92b7e /u01 xfs defaults 0 0


4.4 配置YUM源

1)下载yum文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo


2) 测试yum

yum -y install lrzsz