1 Star 0 Fork 42

戴明明/DMShellInstall

forked from hnyuanzj/DMShellInstall 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
使用 单链路盘 部署三节点dsc日志(centos7).txt 194.95 KB
一键复制 编辑 原始数据 按行查看 历史
hnyuanzj 提交于 2022-12-24 17:25 . 修改后缀名
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865
[BEGIN] 2022/12/20 11:08:55
> -oi N
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
请选择达梦数据库部署类型:单机[si]/数据守护[dw]/dsc集群[dsc]
dsc
达梦数据库安装部署类型: dsc
校验 192.168.2.26,192.168.2.27,192.168.2.28 地址,请等待!!!
校验 172.16.2.26,172.16.2.27,172.16.2.28 地址,请等待!!!
校验 /dev/sdc 磁盘,请等待!!!
校验 /dev/sdd 磁盘,请等待!!!
校验 /dev/sdg,/dev/sdh 磁盘,请等待!!!
校验 /dev/sde,/dev/sdf 磁盘,请等待!!!
校验 /dev/sdi,/dev/sdj 磁盘,请等待!!!
主库安装 expect 软件用于 root 用户互信:
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
OS-YUM | 3.6 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 expect.x86_64.0.5.45-14.el7_1 将被 安装
--> 正在处理依赖关系 libtcl8.5.so()(64bit),它被软件包 expect-5.45-14.el7_1.x86_64 需要
--> 正在检查事务
---> 软件包 tcl.x86_64.1.8.5.13-8.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=====================================================================================================================================================================================================================
Package 架构 版本 源 大小
=====================================================================================================================================================================================================================
正在安装:
expect x86_64 5.45-14.el7_1 OS-YUM 262 k
为依赖而安装:
tcl x86_64 1:8.5.13-8.el7 OS-YUM 1.9 M
事务概要
=====================================================================================================================================================================================================================
安装 1 软件包 (+1 依赖软件包)
总下载量:2.1 M
安装大小:4.9 M
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 6.9 MB/s | 2.1 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : 1:tcl-8.5.13-8.el7.x86_64 1/2
正在安装 : expect-5.45-14.el7_1.x86_64 2/2
验证中 : 1:tcl-8.5.13-8.el7.x86_64 1/2
验证中 : expect-5.45-14.el7_1.x86_64 2/2
已安装:
expect.x86_64 0:5.45-14.el7_1
作为依赖被安装:
tcl.x86_64 1:8.5.13-8.el7
完毕!
所有节点 root 用户配置互信:
# 192.168.2.26:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.26:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.26:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.27:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.27:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.27:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.28:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.28:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.28:22 SSH-2.0-OpenSSH_7.4
spawn scp -rq /root/.ssh root@192.168.2.26:~
send: spawn id exp6 not open
while executing
"send "123456\r""
spawn ssh-copy-id -i root@192.168.2.26
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)
send: spawn id exp6 not open
while executing
"send "123456\r""
spawn scp -rq /root/.ssh root@192.168.2.27:~
root@192.168.2.27's password:
spawn ssh-copy-id -i root@192.168.2.27
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)
send: spawn id exp6 not open
while executing
"send "123456\r""
spawn scp -rq /root/.ssh root@192.168.2.28:~
root@192.168.2.28's password:
spawn ssh-copy-id -i root@192.168.2.28
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)
send: spawn id exp6 not open
while executing
"send "123456\r""
拷贝脚本以及安装包到节点:192.168.2.27
dwnode.sh 100% 566 149.0KB/s 00:00
DMShellInstall 100% 133KB 38.8MB/s 00:00
dm8_20221121_x86_rh6_64.iso 100% 959MB 68.3MB/s 00:14
拷贝脚本以及安装包到节点:192.168.2.28
dwnode.sh 100% 566 113.9KB/s 00:00
DMShellInstall 100% 133KB 11.7MB/s 00:00
dm8_20221121_x86_rh6_64.iso 100% 959MB 87.2MB/s 00:11
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 18:11:25 CST
操作系统版本:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
cpu信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 142
型号名称: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
步进: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
超管理器厂商: VMware
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 256K
L3 缓存: 8192K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
内存信息:
total used free shared buff/cache available
Mem: 2827 258 1354 9 1214 2414
Swap: 8191 0 8191
total used free shared buff/cache available
Mem: 2.8G 258M 1.3G 9.4M 1.2G 2.4G
Swap: 8.0G 0B 8.0G
挂载信息:
/dev/mapper/centos-root / xfs defaults 0 0
UUID=dc24af02-0269-4d90-88b9-c6fdb8c27470 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 9.5M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/mapper/centos-root 91G 2.7G 89G 3% /
/dev/sr0 4.4G 4.4G 0 100% /mnt/cdrom
/dev/sda1 1014M 151M 864M 15% /boot
tmpfs 283M 0 283M 0% /run/user/0
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buff/cache available
Mem: 2895196 257952 1393364 9672 1243880 2479412
Swap: 0 0 0
#/dev/mapper/centos-swap swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
12月 20 18:09:02 centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 20 18:09:03 centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
12月 20 18:09:03 centos7 firewalld[783]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.
12月 20 18:11:25 centos7 systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 20 18:11:25 centos7 systemd[1]: Stopped firewalld - dynamic firewall daemon.
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
Static hostname: dcs01
Icon name: computer-vm
Chassis: vm
Machine ID: f4a41440d98d417dbb5516d46b966467
Boot ID: 4aac348e9a3a448ebb558b7d08ffc9ed
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
#==============================================================#
配置时间同步
#==============================================================#
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:chronyd(8)
man:chrony.conf(5)
12月 20 18:09:02 centos7 systemd[1]: Starting NTP client/server...
12月 20 18:09:02 centos7 chronyd[760]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
12月 20 18:09:02 centos7 chronyd[760]: Frequency 0.000 +/- 1000000.000 ppm read from /var/lib/chrony/drift
12月 20 18:09:02 centos7 systemd[1]: Started NTP client/server.
12月 20 18:11:26 dcs01 systemd[1]: Stopping NTP client/server...
12月 20 18:11:26 dcs01 systemd[1]: Stopped NTP client/server.
2022年 12月 20日 星期二 18:11:26 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/boot/vmlinuz-3.10.0-1160.el7.x86_64
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8 numa=off transparent_hugepage=never elevator=deadline"
--
index=1
kernel=/boot/vmlinuz-0-rescue-f4a41440d98d417dbb5516d46b966467
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
#==============================================================#
创建 DMDBA 用户以及安装目录
#==============================================================#
更改用户 dmdba 的密码 。
passwd:所有的身份验证令牌已经成功更新。
dmdba:x:54321:54321::/home/dmdba:/bin/bash
uid=54321(dmdba) gid=54321(dinstall) 组=54321(dinstall),54322(dmdba)
#==============================================================#
配置系统参数
#==============================================================#
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
sysctl: cannot stat /proc/sys/vm/numa_stat: 没有那个文件或目录
vm.overcommit_memory = 0
#==============================================================#
配置用户限制
#==============================================================#
dmdba - nice 0
dmdba - as unlimited
dmdba - fsize unlimited
dmdba - nproc 131072
dmdba - nofile 131072
dmdba - core unlimited
dmdba - data unlimited
root - nice 0
root - as unlimited
root - fsize unlimited
root - nproc 131072
root - nofile 131072
root - core unlimited
root - data unlimited
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=65536
DefaultLimitNPROC=10240
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
session include postlogin
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
禁用 RemoveIPC
#==============================================================#
[Login]
RemoveIPC=no
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export MALLOC_ARENA_MAX=1
export DM_HOME=/opt/dmdbms
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DM_HOME/bin
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
export PS1="[`whoami`@`hostname`:"'\w]$ '
alias ds='disql SYSDBA/SYSDBA:5236 '
alias dsql='disql SYSDBA/SYSDBA:5236 \`'
alias dssql='disql -S SYSDBA/SYSDBA:5236 \`'
alias dmlog='cd $DM_HOME/log'
#==============================================================#
挂载达梦安装镜像
#==============================================================#
总用量 959M
-r-xr-xr-x. 1 root root 2.7M 11月 21 16:25 DM8 Install.pdf
-r-xr-xr-x. 1 root root 957M 11月 21 16:27 DMInstall.bin
#==============================================================#
安装达梦数据库软件
#==============================================================#
解压安装程序.........
2022-12-20 18:11:55
[INFO] 安装达梦数据库...
2022-12-20 18:11:55
[INFO] 安装 基础 模块...
2022-12-20 18:12:00
[INFO] 安装 服务器 模块...
2022-12-20 18:12:01
[INFO] 安装 客户端 模块...
2022-12-20 18:12:05
[INFO] 安装 驱动 模块...
2022-12-20 18:12:06
[INFO] 安装 手册 模块...
2022-12-20 18:12:07
[INFO] 安装 服务 模块...
2022-12-20 18:12:08
[INFO] 移动日志文件。
2022-12-20 18:12:09
[INFO] 更改安装目录权限完成。
2022-12-20 18:12:09
[INFO] 正在启动DmAPService服务...
2022-12-20 18:12:09
[INFO] 启动DmAPService服务成功。
2022-12-20 18:12:09
[INFO] 安装达梦数据库完成。
#==============================================================#
创建UDEV规则文件
#==============================================================#
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2925a3a21b23d0b3ab2e0ed23d8", SYMLINK+="asmdisk/dmdcr01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b0fb1cb3a94b5aa53bbdfb33e", SYMLINK+="asmdisk/dmvote01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29f5060aeacfef9425dcf0ed8b8", SYMLINK+="asmdisk/dmlog01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ef21b336d5ba88407bb08028b", SYMLINK+="asmdisk/dmlog02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29475ea6b8d04aa528eac4cc13a", SYMLINK+="asmdisk/dmarch01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29d9a3f36c9a14cbd2b7ddba1aa", SYMLINK+="asmdisk/dmarch02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b340cd9876c9e6dc7a607b11d", SYMLINK+="asmdisk/dmdata01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29c33ac798cc07d562fac5e8c83", SYMLINK+="asmdisk/dmdata02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
#==============================================================#
查看udev磁盘
#==============================================================#
ls -lh /dev/asmdisk
总用量 0
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmarch01 -> ../sde
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmarch02 -> ../sdf
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmdata01 -> ../sdi
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmdata02 -> ../sdj
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmdcr01 -> ../sdc
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmlog01 -> ../sdg
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmlog02 -> ../sdh
lrwxrwxrwx. 1 root root 6 12月 20 18:12 dmvote01 -> ../sdd
#==============================================================#
创建dsc参数文件
#==============================================================#
ls -lh /dmdata/DMDSC/
总用量 16K
-rw-r--r--. 1 dmdba dinstall 387 12月 20 18:12 dmasvrmal.ini
-rw-r--r--. 1 dmdba dinstall 195 12月 20 18:12 dmcssm.ini
-rw-r--r--. 1 dmdba dinstall 1.4K 12月 20 18:12 dmdcr_cfg.ini
-rw-r--r--. 1 dmdba dinstall 413 12月 20 18:12 dmdcr.ini
#==============================================================#
注册css和asm服务
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCss.service to /usr/lib/systemd/system/DmCSSServiceCss.service.
创建服务(DmCSSServiceCss)完成
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceAsmsvr.service to /usr/lib/systemd/system/DmASMSvrServiceAsmsvr.service.
创建服务(DmASMSvrServiceAsmsvr)完成
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 481 12月 20 18:12 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 778 12月 20 18:12 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 18:12 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 18:12 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 18:12 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 18:12 /home/dmdba/scripts/query_dm.sql
#==============================================================#
配置节点:192.168.2.27
#==============================================================#
节点 192.168.2.27 开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 18:13:10 CST
操作系统版本:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
cpu信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 142
型号名称: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
步进: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
超管理器厂商: VMware
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 256K
L3 缓存: 8192K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
内存信息:
total used free shared buff/cache available
Mem: 2827 249 1454 9 1123 2412
Swap: 8191 0 8191
total used free shared buff/cache available
Mem: 2.8G 249M 1.4G 9.4M 1.1G 2.4G
Swap: 8.0G 0B 8.0G
挂载信息:
/dev/mapper/centos-root / xfs defaults 0 0
UUID=dc24af02-0269-4d90-88b9-c6fdb8c27470 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 9.5M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/mapper/centos-root 91G 2.7G 89G 3% /
/dev/sr0 4.4G 4.4G 0 100% /mnt/cdrom
/dev/sda1 1014M 151M 864M 15% /boot
tmpfs 283M 0 283M 0% /run/user/0
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buff/cache available
Mem: 2895196 249140 1495900 9660 1150156 2477200
Swap: 0 0 0
#/dev/mapper/centos-swap swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
12月 20 18:10:04 centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 20 18:10:05 centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
12月 20 18:10:05 centos7 firewalld[786]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.
12月 20 18:13:10 centos7 systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 20 18:13:10 centos7 systemd[1]: Stopped firewalld - dynamic firewall daemon.
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
Static hostname: dsc02
Icon name: computer-vm
Chassis: vm
Machine ID: f4a41440d98d417dbb5516d46b966467
Boot ID: 211f2cc512c340498f774d2005f3baaa
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
#==============================================================#
配置时间同步
#==============================================================#
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:chronyd(8)
man:chrony.conf(5)
12月 20 18:10:04 centos7 systemd[1]: Starting NTP client/server...
12月 20 18:10:04 centos7 chronyd[754]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
12月 20 18:10:04 centos7 chronyd[754]: Frequency 0.000 +/- 1000000.000 ppm read from /var/lib/chrony/drift
12月 20 18:10:04 centos7 systemd[1]: Started NTP client/server.
12月 20 18:13:10 dsc02 systemd[1]: Stopping NTP client/server...
12月 20 18:13:10 dsc02 systemd[1]: Stopped NTP client/server.
2022年 12月 20日 星期二 18:13:10 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/boot/vmlinuz-3.10.0-1160.el7.x86_64
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8 numa=off transparent_hugepage=never elevator=deadline"
--
index=1
kernel=/boot/vmlinuz-0-rescue-f4a41440d98d417dbb5516d46b966467
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
#==============================================================#
创建 DMDBA 用户以及安装目录
#==============================================================#
更改用户 dmdba 的密码 。
passwd:所有的身份验证令牌已经成功更新。
dmdba:x:54321:54321::/home/dmdba:/bin/bash
uid=54321(dmdba) gid=54321(dinstall) 组=54321(dinstall),54322(dmdba)
#==============================================================#
配置系统参数
#==============================================================#
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
sysctl: cannot stat /proc/sys/vm/numa_stat: 没有那个文件或目录
vm.overcommit_memory = 0
#==============================================================#
配置用户限制
#==============================================================#
dmdba - nice 0
dmdba - as unlimited
dmdba - fsize unlimited
dmdba - nproc 131072
dmdba - nofile 131072
dmdba - core unlimited
dmdba - data unlimited
root - nice 0
root - as unlimited
root - fsize unlimited
root - nproc 131072
root - nofile 131072
root - core unlimited
root - data unlimited
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=65536
DefaultLimitNPROC=10240
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
session include postlogin
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
禁用 RemoveIPC
#==============================================================#
[Login]
RemoveIPC=no
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export MALLOC_ARENA_MAX=1
export DM_HOME=/opt/dmdbms
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DM_HOME/bin
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
export PS1="[`whoami`@`hostname`:"'\w]$ '
alias ds='disql SYSDBA/SYSDBA:5236 '
alias dsql='disql SYSDBA/SYSDBA:5236 \`'
alias dssql='disql -S SYSDBA/SYSDBA:5236 \`'
alias dmlog='cd $DM_HOME/log'
#==============================================================#
挂载达梦安装镜像
#==============================================================#
总用量 959M
-r-xr-xr-x. 1 root root 2.7M 11月 21 16:25 DM8 Install.pdf
-r-xr-xr-x. 1 root root 957M 11月 21 16:27 DMInstall.bin
#==============================================================#
安装达梦数据库软件
#==============================================================#
解压安装程序.........
2022-12-20 18:13:37
[INFO] 安装达梦数据库...
2022-12-20 18:13:37
[INFO] 安装 基础 模块...
2022-12-20 18:13:41
[INFO] 安装 服务器 模块...
2022-12-20 18:13:42
[INFO] 安装 客户端 模块...
2022-12-20 18:13:46
[INFO] 安装 驱动 模块...
2022-12-20 18:13:48
[INFO] 安装 手册 模块...
2022-12-20 18:13:48
[INFO] 安装 服务 模块...
2022-12-20 18:13:50
[INFO] 移动日志文件。
2022-12-20 18:13:50
[INFO] 更改安装目录权限完成。
2022-12-20 18:13:51
[INFO] 正在启动DmAPService服务...
2022-12-20 18:13:51
[INFO] 启动DmAPService服务成功。
2022-12-20 18:13:51
[INFO] 安装达梦数据库完成。
#==============================================================#
拷贝UDEV规则文件
#==============================================================#
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2925a3a21b23d0b3ab2e0ed23d8", SYMLINK+="asmdisk/dmdcr01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b0fb1cb3a94b5aa53bbdfb33e", SYMLINK+="asmdisk/dmvote01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29f5060aeacfef9425dcf0ed8b8", SYMLINK+="asmdisk/dmlog01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ef21b336d5ba88407bb08028b", SYMLINK+="asmdisk/dmlog02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29475ea6b8d04aa528eac4cc13a", SYMLINK+="asmdisk/dmarch01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29d9a3f36c9a14cbd2b7ddba1aa", SYMLINK+="asmdisk/dmarch02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b340cd9876c9e6dc7a607b11d", SYMLINK+="asmdisk/dmdata01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29c33ac798cc07d562fac5e8c83", SYMLINK+="asmdisk/dmdata02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
#==============================================================#
查看udev磁盘
#==============================================================#
ls -lh /dev/asmdisk
总用量 0
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmarch01 -> ../sde
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmarch02 -> ../sdf
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmdata01 -> ../sdi
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmdata02 -> ../sdj
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmdcr01 -> ../sdc
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmlog01 -> ../sdg
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmlog02 -> ../sdh
lrwxrwxrwx. 1 root root 6 12月 20 18:13 dmvote01 -> ../sdd
#==============================================================#
拷贝dsc参数文件
#==============================================================#
ls -lh /dmdata/DMDSC/
总用量 16K
-rw-r--r--. 1 dmdba dinstall 387 12月 20 18:14 dmasvrmal.ini
-rw-r--r--. 1 dmdba dinstall 195 12月 20 18:14 dmcssm.ini
-rw-r--r--. 1 dmdba dinstall 1.4K 12月 20 18:14 dmdcr_cfg.ini
-rw-r--r--. 1 dmdba dinstall 413 12月 20 18:14 dmdcr.ini
#==============================================================#
注册css和asm服务
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCss.service to /usr/lib/systemd/system/DmCSSServiceCss.service.
创建服务(DmCSSServiceCss)完成
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceAsmsvr.service to /usr/lib/systemd/system/DmASMSvrServiceAsmsvr.service.
创建服务(DmASMSvrServiceAsmsvr)完成
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 481 12月 20 18:14 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 778 12月 20 18:14 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 18:14 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 18:14 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 18:14 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 18:14 /home/dmdba/scripts/query_dm.sql
Connection to 192.168.2.27 closed.
节点 192.168.2.27 配置完成!
#==============================================================#
配置节点:192.168.2.28
#==============================================================#
节点 192.168.2.28 开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 18:15:22 CST
操作系统版本:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
cpu信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 142
型号名称: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
步进: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
超管理器厂商: VMware
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 256K
L3 缓存: 8192K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
内存信息:
total used free shared buff/cache available
Mem: 2827 251 1452 9 1123 2410
Swap: 8191 0 8191
total used free shared buff/cache available
Mem: 2.8G 251M 1.4G 9.4M 1.1G 2.4G
Swap: 8.0G 0B 8.0G
挂载信息:
/dev/mapper/centos-root / xfs defaults 0 0
UUID=dc24af02-0269-4d90-88b9-c6fdb8c27470 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 9.5M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/mapper/centos-root 91G 2.7G 89G 3% /
/dev/sr0 4.4G 4.4G 0 100% /mnt/cdrom
/dev/sda1 1014M 151M 864M 15% /boot
tmpfs 283M 0 283M 0% /run/user/0
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buff/cache available
Mem: 2895196 250944 1494056 9640 1150196 2475340
Swap: 0 0 0
#/dev/mapper/centos-swap swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
12月 20 18:11:35 centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 20 18:11:36 centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
12月 20 18:11:36 centos7 firewalld[783]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.
12月 20 18:15:22 centos7 systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 20 18:15:22 centos7 systemd[1]: Stopped firewalld - dynamic firewall daemon.
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
Static hostname: dsc03
Icon name: computer-vm
Chassis: vm
Machine ID: f4a41440d98d417dbb5516d46b966467
Boot ID: 09c0e9a276b844628f4380f38268f0f4
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
#==============================================================#
配置时间同步
#==============================================================#
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:chronyd(8)
man:chrony.conf(5)
12月 20 18:11:35 centos7 systemd[1]: Starting NTP client/server...
12月 20 18:11:35 centos7 chronyd[760]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
12月 20 18:11:35 centos7 chronyd[760]: Frequency 0.000 +/- 1000000.000 ppm read from /var/lib/chrony/drift
12月 20 18:11:35 centos7 systemd[1]: Started NTP client/server.
12月 20 18:15:23 dsc03 systemd[1]: Stopping NTP client/server...
12月 20 18:15:23 dsc03 systemd[1]: Stopped NTP client/server.
2022年 12月 20日 星期二 18:15:23 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/boot/vmlinuz-3.10.0-1160.el7.x86_64
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8 numa=off transparent_hugepage=never elevator=deadline"
--
index=1
kernel=/boot/vmlinuz-0-rescue-f4a41440d98d417dbb5516d46b966467
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
#==============================================================#
创建 DMDBA 用户以及安装目录
#==============================================================#
更改用户 dmdba 的密码 。
passwd:所有的身份验证令牌已经成功更新。
dmdba:x:54321:54321::/home/dmdba:/bin/bash
uid=54321(dmdba) gid=54321(dinstall) 组=54321(dinstall),54322(dmdba)
#==============================================================#
配置系统参数
#==============================================================#
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
sysctl: cannot stat /proc/sys/vm/numa_stat: 没有那个文件或目录
vm.overcommit_memory = 0
#==============================================================#
配置用户限制
#==============================================================#
dmdba - nice 0
dmdba - as unlimited
dmdba - fsize unlimited
dmdba - nproc 131072
dmdba - nofile 131072
dmdba - core unlimited
dmdba - data unlimited
root - nice 0
root - as unlimited
root - fsize unlimited
root - nproc 131072
root - nofile 131072
root - core unlimited
root - data unlimited
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=65536
DefaultLimitNPROC=10240
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
session include postlogin
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
禁用 RemoveIPC
#==============================================================#
[Login]
RemoveIPC=no
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export MALLOC_ARENA_MAX=1
export DM_HOME=/opt/dmdbms
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DM_HOME/bin
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
export PS1="[`whoami`@`hostname`:"'\w]$ '
alias ds='disql SYSDBA/SYSDBA:5236 '
alias dsql='disql SYSDBA/SYSDBA:5236 \`'
alias dssql='disql -S SYSDBA/SYSDBA:5236 \`'
alias dmlog='cd $DM_HOME/log'
#==============================================================#
挂载达梦安装镜像
#==============================================================#
总用量 959M
-r-xr-xr-x. 1 root root 2.7M 11月 21 16:25 DM8 Install.pdf
-r-xr-xr-x. 1 root root 957M 11月 21 16:27 DMInstall.bin
#==============================================================#
安装达梦数据库软件
#==============================================================#
解压安装程序.........
2022-12-20 18:15:48
[INFO] 安装达梦数据库...
2022-12-20 18:15:49
[INFO] 安装 基础 模块...
2022-12-20 18:15:53
[INFO] 安装 服务器 模块...
2022-12-20 18:15:53
[INFO] 安装 客户端 模块...
2022-12-20 18:15:57
[INFO] 安装 驱动 模块...
2022-12-20 18:15:59
[INFO] 安装 手册 模块...
2022-12-20 18:16:00
[INFO] 安装 服务 模块...
2022-12-20 18:16:01
[INFO] 移动日志文件。
2022-12-20 18:16:02
[INFO] 更改安装目录权限完成。
2022-12-20 18:16:02
[INFO] 正在启动DmAPService服务...
2022-12-20 18:16:02
[INFO] 启动DmAPService服务成功。
2022-12-20 18:16:02
[INFO] 安装达梦数据库完成。
#==============================================================#
拷贝UDEV规则文件
#==============================================================#
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c2925a3a21b23d0b3ab2e0ed23d8", SYMLINK+="asmdisk/dmdcr01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b0fb1cb3a94b5aa53bbdfb33e", SYMLINK+="asmdisk/dmvote01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29f5060aeacfef9425dcf0ed8b8", SYMLINK+="asmdisk/dmlog01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29ef21b336d5ba88407bb08028b", SYMLINK+="asmdisk/dmlog02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29475ea6b8d04aa528eac4cc13a", SYMLINK+="asmdisk/dmarch01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29d9a3f36c9a14cbd2b7ddba1aa", SYMLINK+="asmdisk/dmarch02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29b340cd9876c9e6dc7a607b11d", SYMLINK+="asmdisk/dmdata01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29c33ac798cc07d562fac5e8c83", SYMLINK+="asmdisk/dmdata02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
#==============================================================#
查看udev磁盘
#==============================================================#
ls -lh /dev/asmdisk
总用量 0
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmarch01 -> ../sde
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmarch02 -> ../sdf
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmdata01 -> ../sdi
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmdata02 -> ../sdj
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmdcr01 -> ../sdc
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmlog01 -> ../sdg
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmlog02 -> ../sdh
lrwxrwxrwx. 1 root root 6 12月 20 18:16 dmvote01 -> ../sdd
#==============================================================#
拷贝dsc参数文件
#==============================================================#
ls -lh /dmdata/DMDSC/
总用量 16K
-rw-r--r--. 1 dmdba dinstall 387 12月 20 18:16 dmasvrmal.ini
-rw-r--r--. 1 dmdba dinstall 195 12月 20 18:16 dmcssm.ini
-rw-r--r--. 1 dmdba dinstall 1.4K 12月 20 18:16 dmdcr_cfg.ini
-rw-r--r--. 1 dmdba dinstall 413 12月 20 18:16 dmdcr.ini
#==============================================================#
注册css和asm服务
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCss.service to /usr/lib/systemd/system/DmCSSServiceCss.service.
创建服务(DmCSSServiceCss)完成
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceAsmsvr.service to /usr/lib/systemd/system/DmASMSvrServiceAsmsvr.service.
创建服务(DmASMSvrServiceAsmsvr)完成
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 481 12月 20 18:16 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 778 12月 20 18:16 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 18:16 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 18:16 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 18:16 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 18:16 /home/dmdba/scripts/query_dm.sql
Connection to 192.168.2.28 closed.
节点 192.168.2.28 配置完成!
#==============================================================#
初始化asm磁盘
#==============================================================#
DMASMCMD V8
ASM>create dcrdisk '/dev/asmdisk/dmdcr01' 'dmdcr01'
[Trace]The ASM initialize dcrdisk /dev/asmdisk/dmdcr01 to name DMASMdmdcr01
Used time: 12.957(ms).
ASM>create votedisk '/dev/asmdisk/dmvote01' 'dmvote01'
[Trace]The ASM initialize votedisk /dev/asmdisk/dmvote01 to name DMASMdmvote01
Used time: 5.013(ms).
ASM>create asmdisk '/dev/asmdisk/dmlog01' 'dmlog01'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmlog01 to name DMASMdmlog01
Used time: 4.661(ms).
ASM>create asmdisk '/dev/asmdisk/dmlog02' 'dmlog02'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmlog02 to name DMASMdmlog02
Used time: 6.656(ms).
ASM>create asmdisk '/dev/asmdisk/dmarch01' 'dmarch01'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmarch01 to name DMASMdmarch01
Used time: 9.649(ms).
ASM>create asmdisk '/dev/asmdisk/dmarch02' 'dmarch02'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmarch02 to name DMASMdmarch02
Used time: 7.696(ms).
ASM>create asmdisk '/dev/asmdisk/dmdata01' 'dmdata01'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmdata01 to name DMASMdmdata01
Used time: 3.046(ms).
ASM>create asmdisk '/dev/asmdisk/dmdata02' 'dmdata02'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmdata02 to name DMASMdmdata02
Used time: 3.904(ms).
ASM>init dcrdisk '/dev/asmdisk/dmdcr01' from '/dmdata/DMDSC/dmdcr_cfg.ini'identified by 'Welcome1'
[Trace]DG 126 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1).
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
[Trace]DG 126 alloc 4 extents for 0xfe000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1.
Used time: 233.976(ms).
ASM>init votedisk '/dev/asmdisk/dmvote01' from '/dmdata/DMDSC/dmdcr_cfg.ini'
[Trace]DG 125 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1).
[Trace]DG 125 allocate 4 extents for file 0xfd000002.
[Trace]DG 125 alloc 4 extents for 0xfd000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1.
Used time: 54.207(ms).
#==============================================================#
启动css和asm服务
#==============================================================#
Starting DmCSSServiceCss: [ OK ]
节点 192.168.2.26 启动成功
Starting DmCSSServiceCss: [ OK ]
节点 192.168.2.27 启动成功
Starting DmCSSServiceCss: [ OK ]
节点 192.168.2.28 启动成功
Starting DmASMSvrServiceAsmsvr: [ OK ]
节点 192.168.2.26 启动成功
Starting DmASMSvrServiceAsmsvr: [ OK ]
节点 192.168.2.27 启动成功
Starting DmASMSvrServiceAsmsvr: [ OK ]
节点 192.168.2.28 启动成功
#==============================================================#
创建ASM磁盘组
#==============================================================#
DMASMTOOL V8
Used time: 41.548(ms).
ASM>ASM>DMASMTOOL V8
Used time: 23.699(ms).
ASM>ASM>DMASMTOOL V8
Used time: 45.583(ms).
ASM>ASM>DMASMTOOL V8
Used time: 18.445(ms).
ASM>ASM>DMASMTOOL V8
Used time: 49.596(ms).
ASM>ASM>DMASMTOOL V8
Used time: 42.031(ms).
ASM>ASM>
#==============================================================#
初始化达梦数据库
#==============================================================#
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2023-11-21
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: +DMLOG/log/dmdsc0_log01.log
log file path: +DMLOG/log/dmdsc0_log02.log
log file path: +DMLOG/log/dmdsc1_log01.log
log file path: +DMLOG/log/dmdsc1_log02.log
log file path: +DMLOG/log/dmdsc2_log01.log
log file path: +DMLOG/log/dmdsc2_log02.log
write to dir [+DMDATA/data/DMDSC].
create dm database success. 2022-12-20 18:16:37
数据库初始化完成
#==============================================================#
注册服务并启动数据库
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMDSC.service to /usr/lib/systemd/system/DmServiceDMDSC.service.
创建服务(DmServiceDMDSC)完成
Starting DmServiceDMDSC: connnect dmasmtool successfully.
[ OK ]
节点 192.168.2.26 启动成功
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMDSC.service to /usr/lib/systemd/system/DmServiceDMDSC.service.
创建服务(DmServiceDMDSC)完成
Starting DmServiceDMDSC: connnect dmasmtool successfully.
[ OK ]
节点 192.168.2.27 启动成功
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMDSC.service to /usr/lib/systemd/system/DmServiceDMDSC.service.
创建服务(DmServiceDMDSC)完成
Starting DmServiceDMDSC: connnect dmasmtool successfully.
[ OK ]
节点 192.168.2.28 启动成功
#==============================================================#
创建数据库归档
#==============================================================#
在节点 192.168.2.26 创建归档
密钥过期时间:2023-11-21
操作已执行
已用时间: 2.906(毫秒). 执行号:0.
操作已执行
已用时间: 13.853(毫秒). 执行号:0.
操作已执行
已用时间: 12.904(毫秒). 执行号:0.
操作已执行
已用时间: 12.531(毫秒). 执行号:0.
操作已执行
已用时间: 37.829(毫秒). 执行号:0.
操作已执行
已用时间: 5.601(毫秒). 执行号:0.
在节点 192.168.2.27 创建归档
密钥过期时间:2023-11-21
操作已执行
已用时间: 3.698(毫秒). 执行号:0.
操作已执行
已用时间: 13.699(毫秒). 执行号:0.
操作已执行
已用时间: 13.993(毫秒). 执行号:0.
操作已执行
已用时间: 12.610(毫秒). 执行号:0.
操作已执行
已用时间: 50.696(毫秒). 执行号:0.
操作已执行
已用时间: 14.967(毫秒). 执行号:0.
在节点 192.168.2.28 创建归档
密钥过期时间:2023-11-21
操作已执行
已用时间: 3.624(毫秒). 执行号:0.
操作已执行
已用时间: 16.052(毫秒). 执行号:0.
操作已执行
已用时间: 15.522(毫秒). 执行号:0.
操作已执行
已用时间: 15.122(毫秒). 执行号:0.
操作已执行
已用时间: 45.483(毫秒). 执行号:0.
操作已执行
已用时间: 13.418(毫秒). 执行号:0.
#==============================================================#
在 192.168.2.28 创建备份
#==============================================================#
密钥过期时间:2023-11-21
NAME DESCRIBE
-------- -------------------------------------------------------------------------------
bak_full 周六全量备份,并删除30天之前的备份。
bak_inc 周日到周五做增量备份,如果失败,清除8天前备份,做全量备份
NAME COMMAND
--------- --------------------------------------------------------------------------------------------------------
bak_clear CALL SF_BAKSET_BACKUP_DIR_ADD('DISK','/dmbak/DMDSC'); CALL SP_DB_BAKSET_REMOVE_BATCH('DISK',SYSDATE-30);
#==============================================================#
优化数据库基础参数
#==============================================================#
密钥过期时间:2023-11-21
修改cpu相关参数:
SP_SET_PARA_VALUE(2,'WORKER_THREADS',1);
SP_SET_PARA_VALUE(2,'TASK_THREADS',4);
SP_SET_PARA_VALUE(2,'IO_THR_GROUPS',2);
修改内存池相关参数:
SP_SET_PARA_VALUE(2,'MAX_OS_MEMORY',80);
SP_SET_PARA_VALUE(2,'MEMORY_POOL',100);
SP_SET_PARA_VALUE(2,'MEMORY_N_POOLS',1);
SP_SET_PARA_VALUE(2,'MEMORY_TARGET',0);
修改缓冲区相关参数:
SP_SET_PARA_VALUE(2,'BUFFER',1000);
SP_SET_PARA_VALUE(2,'MAX_BUFFER',1000);
SP_SET_PARA_VALUE(2,'BUFFER_POOLS',3);
SP_SET_PARA_VALUE(2,'RECYCLE',80);
SP_SET_PARA_VALUE(2,'RECYCLE_POOLS',2);
修改fast_pool相关参数:
SP_SET_PARA_VALUE(2,'FAST_POOL_PAGES',3000);
SP_SET_PARA_VALUE(2,'FAST_ROLL_PAGES',1000);
修改内存检测参数为1:
SP_SET_PARA_VALUE(2,'MEMORY_MAGIC_CHECK',1);
非DSC环境将ENABLE_FREQROOTS设置为1,注意DM7 V$instance视图没有dsc_role字段,DM7这部分可以删掉:
修改HASH相关参数:
SP_SET_PARA_VALUE(1,'HJ_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HJ_BUF_SIZE',50);
SP_SET_PARA_VALUE(1,'HAGR_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HAGR_BUF_SIZE',50);
修改排序相关参数:
SP_SET_PARA_VALUE(2,'SORT_FLAG',0);
SP_SET_PARA_VALUE(2,'SORT_BLK_SIZE',1);
SP_SET_PARA_VALUE(2,'SORT_BUF_SIZE',10);
SP_SET_PARA_VALUE(2,'SORT_BUF_GLOBAL_SIZE',500);
修改其他内存参数:
SP_SET_PARA_VALUE(2,'RLOG_POOL_SIZE',256);
SP_SET_PARA_VALUE(2,'CACHE_POOL_SIZE',200);
SP_SET_PARA_VALUE(2,'DICT_BUF_SIZE',50);
SP_SET_PARA_VALUE(2,'VM_POOL_TARGET',16384);
SP_SET_PARA_VALUE(2,'SESS_POOL_TARGET',16384);
修改实例相关参数:
SP_SET_PARA_VALUE(2,'USE_PLN_POOL',1);
SP_SET_PARA_VALUE(2,'ENABLE_MONITOR',1);
SP_SET_PARA_VALUE(2,'TEMP_SIZE',1024);
SP_SET_PARA_VALUE(2,'TEMP_SPACE_LIMIT',102400);
SP_SET_PARA_VALUE(2,'MAX_SESSIONS',1500);
SP_SET_PARA_VALUE(2,'MAX_SESSION_STATEMENT',20000);
SP_SET_PARA_VALUE(2,'PK_WITH_CLUSTER',0);
SP_SET_PARA_VALUE(2,'ENABLE_ENCRYPT',0);
修改优化器相关参数:
SP_SET_PARA_VALUE(2,'OLAP_FLAG',2);
SP_SET_PARA_VALUE(2,'VIEW_PULLUP_FLAG',1);
SP_SET_PARA_VALUE(2,'OPTIMIZER_MODE',1);
SP_SET_PARA_VALUE(2,'ADAPTIVE_NPLN_FLAG',0);
开启并行PURGE:
SP_SET_PARA_VALUE(2,'PARALLEL_PURGE_FLAG',1);
开启手动并行:
SP_SET_PARA_VALUE(2,'PARALLEL_POLICY',2);
UNDO_RETENTION如果放大,可以适当调大UNDO_EXTENT_NUM。负载高的时候,减少文件系统的申请/释放操作:
SP_SET_PARA_VALUE(2,'UNDO_EXTENT_NUM',16);
开启SQL 注入HINT功能:
SP_SET_PARA_VALUE(2,'ENABLE_INJECT_HINT',1);
开启数据异步追踪:
SP_SET_PARA_VALUE(1,'SVR_LOG',1);
开启操作系统认证:
sp_set_para_value(2,'ENABLE_LOCAL_OSAUTH',1);
重启数据库,优化参数生效
关闭数据库
[monitor] 2022-12-20 18:18:02: CSS MONITOR V8
[monitor] 2022-12-20 18:18:02: CSS MONITOR SYSTEM IS READY.
[monitor] 2022-12-20 18:18:02: Wait CSS Control Node choosed...
[monitor] 2022-12-20 18:18:03: Wait CSS Control Node choosed succeed.
[monitor] 2022-12-20 18:18:03: 组(GRP_DMDSC)中节点对应的CSS自动拉起标记已经处于关闭状态
[monitor] 2022-12-20 18:18:03: 通知CSS(seqno:0)执行EP STOP(GRP_DMDSC)
[monitor] 2022-12-20 18:18:13: 通知当前活动的CSS执行清理操作
[monitor] 2022-12-20 18:18:14: 清理CSS(0)请求成功
[monitor] 2022-12-20 18:18:14: 清理CSS(1)请求成功
[monitor] 2022-12-20 18:18:14: 清理CSS(2)请求成功
[monitor] 2022-12-20 18:18:14: 命令EP STOP GRP_DMDSC执行成功
启动数据库
[monitor] 2022-12-20 18:18:20: CSS MONITOR V8
[monitor] 2022-12-20 18:18:20: CSS MONITOR SYSTEM IS READY.
[monitor] 2022-12-20 18:18:20: Wait CSS Control Node choosed...
[monitor] 2022-12-20 18:18:22: Wait CSS Control Node choosed succeed.
[monitor] 2022-12-20 18:18:22: 通知CSS(seqno:0)执行EP STARTUP(DMDSC0)
[monitor] 2022-12-20 18:18:30: 通知CSS(seqno:0)执行EP STARTUP(DMDSC0)成功
[monitor] 2022-12-20 18:18:30: 通知CSS(seqno:1)执行EP STARTUP(DMDSC1)
[monitor] 2022-12-20 18:18:39: 通知CSS(seqno:1)执行EP STARTUP(DMDSC1)成功
[monitor] 2022-12-20 18:18:39: 通知CSS(seqno:2)执行EP STARTUP(DMDSC2)
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:2)执行EP STARTUP(DMDSC2)成功
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:0)打开节点(DMDSC0)的自动拉起功能
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:0)打开节点(DMDSC0)的自动拉起功能成功
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:1)打开节点(DMDSC1)的自动拉起功能
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:1)打开节点(DMDSC1)的自动拉起功能成功
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:2)打开节点(DMDSC2)的自动拉起功能
[monitor] 2022-12-20 18:18:48: 通知CSS(seqno:2)打开节点(DMDSC2)的自动拉起功能成功
[monitor] 2022-12-20 18:18:48: 打开CSS自动拉起功能成功
[monitor] 2022-12-20 18:18:48: 通知当前活动的CSS执行清理操作
[monitor] 2022-12-20 18:18:48: 清理CSS(0)请求成功
[monitor] 2022-12-20 18:18:49: 清理CSS(1)请求成功
[monitor] 2022-12-20 18:18:49: 清理CSS(2)请求成功
[monitor] 2022-12-20 18:18:49: 命令EP STARTUP GRP_DMDSC执行成功
#==============================================================#
创建DMDBA用户,密码:SYSDBA
#==============================================================#
密钥过期时间:2023-11-21
USERNAME
----------
SYSAUDITOR
SYSSSO
SYSDBA
DMDBA
SYS
#==============================================================#
查询数据库优化结果:
#==============================================================#
密钥过期时间:2023-11-21
PARA_NAME DEFAULT_VALUE PARA_VALUE
--------------------- ------------- ----------
MAX_OS_MEMORY 100 80
MAX_SESSION_STATEMENT 10000 20000
TRX_VIEW_MODE 1 1
MAX_SESSIONS 10000 1500
IO_THR_GROUPS 8 2
ADAPTIVE_NPLN_FLAG 3 0
OPTIMIZER_MODE 1 1
TOP_DIS_HASH_FLAG 1 1
TOP_ORDER_OPT_FLAG 0 0
VIEW_PULLUP_FLAG 0 1
USE_PLN_POOL 1 1
TASK_THREADS 16 16
WORKER_THREADS 16 1
SESS_POOL_TARGET 16384 16384
SESS_POOL_SIZE 64 64
VM_POOL_TARGET 16384 16384
DICT_BUF_SIZE 50 50
HAGR_BUF_SIZE 500 50
HAGR_BUF_GLOBAL_SIZE 5000 1000
HJ_BUF_SIZE 500 50
HJ_BUF_GLOBAL_SIZE 5000 1000
SORT_FLAG 0 0
SORT_BUF_GLOBAL_SIZE 1000 500
SORT_BLK_SIZE 1 1
SORT_BUF_SIZE 20 10
MAX_BUFFER 1000 1000
RECYCLE_POOLS 3 1
RECYCLE 300 80
BUFFER_POOLS 9 3
BUFFER 1000 1000
MEMORY_MAGIC_CHECK 1 1
MEMORY_TARGET 15000 0
MEMORY_N_POOLS 1 1
MEMORY_POOL 500 100
PK_WITH_CLUSTER 0 0
ENABLE_MONITOR 1 1
SVR_LOG 0 1
DATETIME_FMT_MODE 0 0
COMPATIBLE_MODE 0 0
CLOB_LIKE_MAX_LEN 10240 10240
ENABLE_ENCRYPT 0 0
REDOS_PARALLEL_NUM 1 1
RLOG_POOL_SIZE 256 256
CACHE_POOL_SIZE 100 200
TEMP_SPACE_LIMIT 0 102400
TEMP_SIZE 10 1024
OLAP_FLAG 2 2
恭喜您,达梦数据库DMDSC已经安装完成!
[root@centos7 soft]# su - dmdba
[dmdba@dcs01:~]$ dmcssm /dmdata/DMDSC/dmcssm.ini
[monitor] 2022-12-20 18:19:10: CSS MONITOR V8
[monitor] 2022-12-20 18:19:10: CSS MONITOR SYSTEM IS READY.
[monitor] 2022-12-20 18:19:10: Wait CSS Control Node choosed...
[monitor] 2022-12-20 18:19:11: Wait CSS Control Node choosed succeed.
show
monitor current time:2022-12-20 18:19:12, n_group:3
=================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 0] ========================================
[CSS0] auto check = TRUE, global info:
[ASM0] auto restart = FALSE
[DMDSC0] auto restart = TRUE
[CSS1] auto check = TRUE, global info:
[ASM1] auto restart = FALSE
[DMDSC1] auto restart = TRUE
[CSS2] auto check = TRUE, global info:
[ASM2] auto restart = FALSE
[DMDSC2] auto restart = TRUE
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2022-12-20 18:19:12 CSS0 0 9341 Control Node OPEN WORKING OK TRUE 101537 101846
2022-12-20 18:19:12 CSS1 1 9341 Normal Node OPEN WORKING OK TRUE 106796 107084
2022-12-20 18:19:12 CSS2 2 9341 Normal Node OPEN WORKING OK TRUE 110222 110490
=================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 0] ========================================
n_ok_ep = 3
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)
(2, 2)
sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL
crash process over flag is TRUE
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2022-12-20 18:19:12 ASM0 0 9351 Control Node OPEN WORKING OK TRUE 122899 123144
2022-12-20 18:19:12 ASM1 1 9351 Normal Node OPEN WORKING OK TRUE 128213 128438
2022-12-20 18:19:12 ASM2 2 9351 Normal Node OPEN WORKING OK TRUE 131586 131791
=================== group[name = GRP_DMDSC, seq = 2, type = DB, Control Node = 0] ========================================
n_ok_ep = 3
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)
(2, 2)
sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL
crash process over flag is TRUE
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2022-12-20 18:19:12 DMDSC0 0 5236 Control Node OPEN WORKING OK TRUE 404203 404245
2022-12-20 18:19:12 DMDSC1 1 5236 Normal Node OPEN WORKING OK TRUE 406835 406869
2022-12-20 18:19:12 DMDSC2 2 5236 Normal Node OPEN WORKING OK TRUE 406130 406155
==================================================================================================================
exit
[dmdba@dcs01:~]$ exit
登出
[END] 2022/12/20 11:18:33
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/cndba/DMShellInstall.git
git@gitee.com:cndba/DMShellInstall.git
cndba
DMShellInstall
DMShellInstall
master

搜索帮助