在GBase V8版本,数据库的安装,升级,服务启停等,都需要在root权限下运行。而在V95版本,数据库所有服务全部运行在dbauser下,一般是gbase,但是一些环境设置操作,还是需要root权限才能操作的。root权限可以是root用户,或者sudo用户都可以,不要求必须是root用户。一些现场也不会提供root的密码。
目录导航
sudo用户运行SetSysEnv.py
[root@gbase_rh7_015 sudoers.d]# su - gbase
Last login: Mon Apr 24 09:36:53 CST 2023 on pts/0
[gbase@gbase_rh7_015 ~]$
[gbase@gbase_rh7_015 ~]$ sudo ./SetSysEnv.py --dbaUser=gbase
[gbase@gbase_rh7_015 ~]$ ll /tmp -rt
total 16
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-rtkit-daemon.service-YlG9uz
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-systemd-hostnamed.service-3p4q5h
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-cups.service-VLoG3n
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-colord.service-yCOKCU
drwx------ 3 root root 17 Apr 23 14:32 systemd-private-24ca765234c04bce98d8097686f952f7-systemd-localed.service-6y6vkP
drwx------ 2 root root 6 Apr 23 14:38 tracker-extract-files.0
-rw-rw-r-- 1 gbase gbase 9322 Apr 23 14:44 InstallTar_2023_04_23.log
drwx------ 3 root root 17 Apr 24 09:34 systemd-private-3f88f95c55d94f1080eb490fd66800bc-rtkit-daemon.service-qO71jJ
drwx------ 3 root root 17 Apr 24 09:34 systemd-private-3f88f95c55d94f1080eb490fd66800bc-cups.service-fhR0Cy
drwx------ 3 root root 17 Apr 24 09:34 systemd-private-3f88f95c55d94f1080eb490fd66800bc-colord.service-sKFAU5
-rw-r--r-- 1 root root 3297 Apr 24 09:37 SetSysEnv.log
[gbase@gbase_rh7_015 ~]$ tail /tmp/SetSysEnv.log
2023-04-24 09:37:31,733-root-INFO reference: ulimit -m, value: unlimited
2023-04-24 09:37:31,733-root-INFO exec cmd:su - gbase -c "ulimit -m"
2023-04-24 09:37:31,770-root-INFO exec cmd:su - gbase -c "ulimit -m",and return value:unlimited
2023-04-24 09:37:31,770-root-INFO Set system max memory size to end.
2023-04-24 09:37:31,770-root-INFO Set system virtual memory...
2023-04-24 09:37:31,770-root-INFO reference: ulimit -v, value: unlimited
2023-04-24 09:37:31,771-root-INFO exec cmd:su - gbase -c "ulimit -v"
2023-04-24 09:37:31,810-root-INFO exec cmd:su - gbase -c "ulimit -v",and return value:unlimited
2023-04-24 09:37:31,810-root-INFO Set system virtual memory to end
2023-04-24 09:37:31,811-root-INFO Modify system env end.
[gbase@gbase_rh7_015 ~]$