前言:安装oracle rac过程中,本地接显示器安装比较费事,采用远程安装更方便、有效、安全;一般建议使用VNCserver服务器远程管理,即使网络异常,也不会影响数据的部署,本次将vncserver服务部署过程记录下,方便小伙伴们后期安装维护。
一、安装vnc服务端(安装linux oracle过程中使用vnc,不使用其他的,容易造成安装中断)
yum install tigervnc tigervnc-server
vim /etc/sysconfig/vncservers
VNCSERVERS="1:root 2:grid 3:oracle"
VNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared -depth 24"
VNCSERVERARGS[2]="-geometry 1024x768 -alwaysshared -depth 24"
VNCSERVERARGS[3]="-geometry 1024x768 -alwaysshared -depth 24"
vncpasswd
vncserver
检查防火墙状态:firewall-cmd --state
检查防火墙条目:firewall-cmd --list-all
安装oracle完成后,关闭vncserver进程
[root@db01 ~]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 8448
:2 9251
备注:本地挂载yum源(rhel.repo)
mount /dev/sr0 /mnt(挂载光盘镜像)
[root@rac1 yum.repos.d]# pwd
/etc/yum.repos.d
[root@rac1 yum.repos.d]# cat rhel.repo
[ORHEL]
name=ORHEL
baseurl=file:///mnt
gpgkey=file:///mnt/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1
二、解决不同用户vnc服务器(grid、oracle)
问题症状:vnc-viewer登录到服务器后,root用户可以打开终端工具,而grid和oracle却无法打开;
1、检查配置文件/etc/sysconfig/vncservers
2、检查grid用户xstartup文件
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/etc/X11/xinit/xinitrc
# Assume either Gnome or KDE will be started by default when installed
# We want to kill the session automatically in this case when user logs out. In case you modify
# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should
# be responsible to modify below code to avoid that your session will be automatically killed
if [ -e /usr/bin/gnome-session& kde& -o -e /usr/bin/startkde ]; then
vncserver -kill $DISPLAY
fi
3、开启需要登录用户的vnc服务
[grid@rac1 .vnc]$ vncserver :2
4、vncserver服务使用完成后,需要关闭服务,减少安全风险
[grid@rac1 .vnc]$ ps -ef |grep vnc
[grid@rac1 .vnc]$ kill -9 2203(杀死进程服务)
[root@rac1 ~]# ps aux|grep vnc(检查是否存在vncserver服务)