本文以Exadata X8 HC 1/4 rack为例,介绍整个Exadata刷机的步骤。
我理解刷机最关键的就两大步骤:第一步是全部机器刷OS,第二步是使用OEDA一键刷机。至于其它全部工做都是在为这两步作准备。本着对之后刷机能够快速参考,梳理细节步骤以下:html
使用适配本身电脑版本的OEDA,根据实际刷机需求进行配置,最终会生成一系列配置文件(主要有customer-rack-InstallationTemplate.html、customer-rack-preconf_xxx.csv、customer-rack.xml等)。linux
注:这一环节须要同时摸清楚现场状况,肯定网络规划(包含Admin、Client、Private网络IP规划)、确承认用的DNS、NTP服务器,这些信息在OEDA配置时都会用到。
同时建议准备好配置PXE服务器的环境(可使用跳起色,也可使用本身准备的虚拟机,后面有具体PXE服务搭建步骤)。shell
1)OS介质(包含DB节点和CELL节点的OS介质)
2)根据上步OEDA的配置结果,从生成的customer-rack-InstallationTemplate.html文件中的Appendix B部分,下载列表中全部介质(一般包含GI、DB、对应补丁以及AHF)数据库
注:这一环节能够梳理出各机器对应的MAC地址,并整理好下载的介质、preconf.csv、customer-rack.xml等配置文件,后面步骤都会用到。服务器
--梳理本次刷机环境的各机器名及其eth0对应的MAC(在ILOM下查看eth0的MAC地址命令:show /SYS/MB/NET0): dbm08dbadm02 00:10:e0:e9:55:fa dbm08dbadm01 00:10:e0:e6:cb:6a dbm08celadm03 00:10:e0:e9:63:80 dbm08celadm02 00:10:e0:e8:d9:32 dbm08celadm01 00:10:e0:e9:62:c0
注:这里的dbm08就是rack的名字,是自定义的,由于这里使用rack显示很差,因此使用本次真实的rack名称代替。网络
4.1 安装配置tftp:
安装tftp:
tftp server是基于xinetd的服务,须要安装xinetd、tftp、tftp-serveroracle
# yum -y install xinetd tftp tftp-server
配置tftp:app
# vi /etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } # vi /usr/lib/systemd/system/tftp.service [Service] ExecStart=/usr/sbin/in.tftpd -s /tftpboot 建立目录/tftpboot: # mkdir /tftpboot 启动tftp: # systemctl daemon-reload # systemctl start tftp 查看tftp: # systemctl status tftp 设置开机启动: # systemctl enable tftp
安装syslinux:运维
# mkdir /tftpboot/pxelinux.cfg # yum -y install syslinux # rpm -ql syslinux | grep pxelinux.0 /usr/share/syslinux/gpxelinux.0 /usr/share/syslinux/pxelinux.0 # cp /usr/share/syslinux/pxelinux.0 /tftpboot/ # ls /tftpboot/ pxelinux.0 pxelinux.cfg #
测试ftp:dom
#cd /tmp #tftp 192.168.18.250 tftp> get pxelinux.0 tftp> quit # # ls pxelinux.0 pxelinux.0 # ##注意selinux要关闭
4.2 安装配置DHCP
编辑配置文件:vi /etc/dhcp/dhcpd.conf
set vendorclass = option vendor-class-identifier; option pxe-system-type code 93 = unsigned integer 16; set pxetype = option pxe-system-type; ddns-update-style none; allow booting; allow bootp; subnet 192.168.18.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option routers 192.168.18.250; option domain-name "customerbj.com"; option domain-name-servers 192.168.18.250; range dynamic-bootp 192.168.18.121 192.168.18.140; default-lease-time 21600; max-lease-time 43200; # Enable UEFI Netboot if substring(vendorclass, 0, 9)="PXEClient" { if pxetype=00:06 or pxetype=00:07 { filename "efi/BOOTX64.efi"; } else { filename "pxelinux.0"; } } next-server 192.168.18.250; host dbm08dbadm02 { hardware ethernet 00:10:e0:e9:55:fa; fixed-address 192.168.18.2; } host dbm08dbadm01 { hardware ethernet 00:10:e0:e6:cb:6a; fixed-address 192.168.18.1; } host dbm08celadm03 { hardware ethernet 00:10:e0:e9:63:80; fixed-address 192.168.18.5; } host dbm08celadm02 { hardware ethernet 00:10:e0:e8:d9:32; fixed-address 192.168.18.4; } host dbm08celadm01 { hardware ethernet 00:10:e0:e9:62:c0; fixed-address 192.168.18.3; } host vm-pxe { hardware ethernet 00:10:e0:79:8b:b5; fixed-address 192.168.18.250; next-server 192.168.18.250; } }
Note:这里遇到一个问题,先记录下留做后续思考:就是起初next-server部分,fixed-address对应的IP地址配置错误没发现,但最终也没影响到OS安装?是由于DHCP这部分没用吗?
启动DHCP服务并设置开机自启:
启动dhcp: # systemctl start dhcpd 查看dhcp状态: # systemctl status dhcpd 检查dhcp是否开机启动: # systemctl list-unit-files |grep dhcp 设置开机启动dhcp: # systemctl enable dhcpd
4.3 安装配置http服务
Linux7对应的设置为:
# vi /etc/httpd/conf.d/pxe.conf Alias /tftpboot /tftpboot <Directory /tftpboot> Options indexes FollowSymLinks Allow from all Require all granted </Directory>
测试http服务正常:
# vi /tftpboot/http.txt “http test” # wget http://127.0.0.1/tftpboot/http.txt # curl http://127.0.0.1/tftpboot/http.txt --有正确返回无报错表示配置没问题。 # systemctl start httpd # systemctl stop httpd # systemctl status httpd
5.1 系统介质准备:
[root@x52-103218 tftpboot]# unzip V1004139-01.zip [root@x52-103218 tftpboot]# unzip V1004140-01.zip
5.2 准备.EFI文件:
解压OS镜像文件:
挂载镜像文件,提取efi相关文件:
# mount -o loop /tftpboot/compute_20.1.3.0.0_LINUX.X64***.iso /20isodb # ls /20isodb/EFI/BOOT BOOTX64.efi grub.cfg grubx64.efi mmx64.efi TRANS.TBL 复制三个*.efi到/tftpboot/efi目录下:(这几个文件cell与db是相同的) # mkdir /tftpboot/efi # cp /20isodb/EFI/BOOT/*.efi /tftpboot/efi # cp /20isodb/cellbits/commonos.tbz /tmp # tar -xvf /tmp/commonos.tbz 解压后会有shim-x64-15-2.0.7.el7.x86_64.rpm文件: # rpm2cpio shim-x64-15-2.0.7.el7.x86_64.rpm| cpio -idmv ./boot/efi/EFI/BOOT/BOOTX64.EFI ./boot/efi/EFI/BOOT/fbx64.efi ./boot/efi/EFI/redhat/BOOT.CSV ./boot/efi/EFI/redhat/BOOTX64.CSV ./boot/efi/EFI/redhat/mmx64.efi ./boot/efi/EFI/redhat/shim.efi ./boot/efi/EFI/redhat/shimx64.efi ./etc/yum/protected.d/shim-x64.conf 10051 blocks # cp ./boot/efi/EFI/redhat/shim.efi /tftpboot/efi # cp ./boot/efi/EFI/redhat/shimx64.efi /tftpboot/efi # ls /tftpboot/efi/ BOOTX64.efi grubx64.efi mmx64.efi shim.efi shimx64.efi 查看文件权限: rwx------. 1 root root 1203584 Nov 8 08:56 shim.efi 须要修改成755: #chmod 755 shim.efi #cd /tmp # wget http://192.168.18.250/tftpboot/efi/shim.efi 可以成功wget代表配置正确。 BOOTX64.efi grubx64.efi mmx64.efi shim.efi shimx64.efi
上面这几个都是efi引导文件,须要在dhcpd.conf文件中进行配置:filename "efi/BOOTX64.efi"; 实际这里须要测试确认是否适配,好比本次刷机X8-2使用的是BOOTX64.efi,听说有的系统可能须要使用shim.efi或shimx64.efi才能够,目前我尚未实际遇到。
5.3 配置启动文件:
计算节点的启动引导文件:vi /tftpboot/efi/db
set default 0 set timeout=10 menuentry 'Exadata Compute Node' { echo "Loading efi/vmlinuz" linuxefi efi/vmlinux-iso-20.1.3.0.0-201023-compute stit dhcp pxe boot-from=uefi factory reboot-on-success notests=diskgroup iso_uri=http://192.168.18.250/tftpboot/compute_20.1.3.0.0_LINUX.X64_201023-1.x86_64.iso preconf=http://192.168.18.250/tftpboot/preconf.csv console=ttyS0,115200n8 echo "Loading efi/initrd.img" initrdefi efi/initrd-iso-20.1.3.0.0-201023-compute.img echo "Booting installation kernel" }
存储节点的启动引导文件:vi /tftpboot/efi/cell
set default 0 set timeout=10 menuentry 'Exadata Storage Cell' { echo "Loading efi/vmlinuz" linuxefi efi/vmlinux-iso-20.1.3.0.0-201023-cell stit dhcp pxe boot-from=uefi factory reboot-on-success notests=diskgroup iso_uri=http://192.168.18.250/tftpboot/cell_20.1.3.0.0_LINUX.X64_201023-1.x86_64.iso preconf=http://192.168.18.250/tftpboot/preconf.csv console=ttyS0,115200n8 echo "Loading efi/initrd.img" initrdefi efi/initrd-iso-20.1.3.0.0-201023-cell.img echo "Booting installation kernel" }
要确保上述路径和文件名均正确:
把镜像软件解压出的initrd-iso* 和vmlinux-iso*文件复制到/tftpboot/efi目录下: # mv initrd-iso* vmlinux-iso* /tftpboot/efi/ 把*.iso和*.iso.md5放到/tftpboot目录下: # cp *.iso *.iso.md5 /tftpboot 把OEDA工具生成的网络配置文件preconf.csv放到/tftpboot目录下: # cat /tftpboot/preconf.csv 在preconf.csv文件中须要把各个主机NET0的MAC加入到Management后面 请确保preconf.csv文件里面已经添加了eth0对应的mac地址,在安装系统过程当中会将IP配置信息设置到对应的主机上.
配置文件:这里的格式要求为:grub.cfg-01-MAC地址(要小写,且中间使用中划线替代冒号),例以下面这样:
dbm08: cp db grub.cfg-01-00-10-e0-e9-55-fa cp db grub.cfg-01-00-10-e0-e6-cb-6a cp cell grub.cfg-01-00-10-e0-e9-63-80 cp cell grub.cfg-01-00-10-e0-e8-d9-32 cp cell grub.cfg-01-00-10-e0-e9-62-c0
5.4 开始安装系统:
登陆到各节点的ILOM,设置并开始安装系统:
dbm08: 192.168.18.6~10,以第一台为例:
# ssh 192.168.18.6 设置下次开机启动设备为PXE: -> set /HOST boot_device=pxe Set 'boot_device' to 'pxe' -> show /HOST boot_device /HOST Properties: boot_device = pxe 重启系统: -> reset /System Are you sure you want to reset /System (y/n)? y Performing hard reset on /System 登陆控制台查看安装信息: -> start /SP/console Are you sure you want to start /SP/console (y/n)? y Serial console started. To stop, type ESC ( 进入控制台查看: … 显示整个安装过程
可使用imageinfo来查看全部节点的系统信息:
特别注意安装版本和激活日期,确认reimage成功,通常存储节点的安装就绪时间要短于计算节点,耐心等待。
6.1 上传介质及配置文件
把OEDA软件(服务器版本)及相关介质传送到第一台数据库主机上:
# mkdir -p /u01/soft/onecommand cd /u01/soft/onecommand scp 192.168.18.250:/u01/media/p30640393_201300_Linux-x86-64.zip ./ unzip p30640393_201300_Linux-x86-64.zip cd linux-x64/WorkDir/ scp 192.168.18.250:/u01/media/p* ./ scp 192.168.18.250:/u01/media/ahf_setup ./ scp 192.168.18.250:/u01/media/V98206* ./ 上传OEDA生成的customer-rack.xml文件: # scp 192.168.18.250:/u01/media/customer* /u01/soft/onecommand/linux-x64
6.2 运行reclaimdisks.sh:
这步实际会释放pvs/vgs/lvs相对应的剩余空间,本次就释放3T+,以前也遇到过有些环境会直接提示不适用,那就不用操做。
查看当前的分区信息: # /opt/oracle.SupportTools/reclaimdisks.sh -check 在一键部署前须要先在全部数据库节点上运行reclaimdisks.sh: # /opt/oracle.SupportTools/reclaimdisks.sh -free -reclaim
6.3 执行一键部署
列出全部步骤:
# cd /u01/soft/onecommand/linux-x64/ # ./install.sh -cf customer-rack.xml -l Initializing 1. Validate Configuration File 2. Setup Required Files 3. Create Users 4. Setup Cell Connectivity 5. Verify Infiniband 6. Calibrate Cells 7. Create Cell Disks 8. Create Grid Disks 9. Install Cluster Software 10. Initialize Cluster Software 11. Install Database Software 12. Relink Database with RDS 13. Create ASM Diskgroups 14. Create Databases 15. Create Pluggable Databases 16. Apply Security Fixes 17. Install Autonomous Health Framework 18. Create Installation Summary 19. Resecure Machine
能够一步一步执行:
# nohup /u01/soft/onecommand/linux-x64/install.sh -cf customer-rack.xml -s 1 & Initializing Executing Validate Configuration File /////
能够指定步骤依次执行:
# nohup /u01/soft/onecommand/linux-x64/install.sh -cf customer-rack.xml -r 2-18 &
注:不一样版本步骤总数和内容有细微差异,记住最后一步的Resecure Machine建议不要执行,执行完成后则整个刷机过程完毕。
日志在/u01/soft/onecommand/linux-x64/log目录下,每一步都有对应的日志文件。
可使用-u来回退某一步操做,如:
# /u01/soft/onecommand/linux-x64/install.sh -cf customer-rack.xml -u 2
最后刷机完成,留意"Create Installation Summary"步骤的输出信息,能够将一些信息下载下来备用,好比EXAchk的巡检信息,相关帐号密码信息等。特别强调的是,EXAchk的巡检信息最好仍是确认下,看是否有比较严重的问题须要解决的。
7.1 环境变量配置
发现当前并不会自动配置环境变量,须要手工配置。
以节点1为例:
grid用户: export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/19.0.0.0/grid export ORACLE_SID=+ASM1 export PATH=$ORACLE_HOME/bin:$PATH oracle用户: export GRID_HOME=/u01/app/19.0.0.0/grid export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1 export ORACLE_SID=cdb1db11 export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATH
节点2对应ORACLE_SID修改匹配便可。
7.2 新建符合要求的测试库
刷机的库有时并不符合实际使用要求,若须要创建新库,一般建议使用图形dbca建库,可最大程度避免出错。这里经过VNC链接到跳起色,假设是“:2”,参考命令以下:
xhost + ssh 192.168.18.1 su - oracle export DISPLAY=192.168.18.250:2 dbca
这些就都是基础DBA的运维操做,通常也不会有啥问题。