安装前准备
软硬件要求
硬件要求
(1)芯片:x86架构
(2)内存:1G以上,Kylin系统3G以上
(3)硬盘:25G以上,/tmp目录2G以上
//查看CPU架构(方法一)
[root@localhost ~]# arch
x86_64
//查看CPU架构(方法二)
[root@localhost /]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 167
model name : 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz
stepping : 1
microcode : 0x40
cpu MHz : 2712.000
cache size : 12288 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid 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 cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid md_clear flush_l1d arch_capabilities
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips : 5424.00
clflush size : 64
cache_alignment : 64
address sizes : 45 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 167
model name : 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz
stepping : 1
microcode : 0x40
cpu MHz : 2712.000
cache size : 12288 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid 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 cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid md_clear flush_l1d arch_capabilities
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips : 5424.00
clflush size : 64
cache_alignment : 64
address sizes : 45 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 167
model name : 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz
stepping : 1
microcode : 0x40
cpu MHz : 2712.000
cache size : 12288 KB
physical id : 1
siblings : 2
core id : 0
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid 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 cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid md_clear flush_l1d arch_capabilities
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips : 5424.00
clflush size : 64
cache_alignment : 64
address sizes : 45 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 167
model name : 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz
stepping : 1
microcode : 0x40
cpu MHz : 2712.000
cache size : 12288 KB
physical id : 1
siblings : 2
core id : 1
cpu cores : 2
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 27
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid 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 cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid md_clear flush_l1d arch_capabilities
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips : 5424.00
clflush size : 64
cache_alignment : 64
address sizes : 45 bits physical, 48 bits virtual
power management:
//查看内存容量(方法一)
[root@localhost ~]# free -h
total used free shared buff/cache available
Mem: 2.8Gi 636Mi 1.6Gi 13Mi 658Mi 1.9Gi
Swap: 3.2Gi 0B 3.2Gi
//查看内存容量(方法二)
[root@localhost /]# cat /proc/meminfo
MemTotal: 2957632 kB
MemFree: 919736 kB
MemAvailable: 1426816 kB
Buffers: 3836 kB
Cached: 711360 kB
SwapCached: 0 kB
Active: 1276500 kB
Inactive: 476748 kB
Active(anon): 1040412 kB
Inactive(anon): 11820 kB
Active(file): 236088 kB
Inactive(file): 464928 kB
Unevictable: 32 kB
Mlocked: 32 kB
SwapTotal: 3358716 kB
SwapFree: 3358716 kB
Dirty: 312 kB
Writeback: 0 kB
AnonPages: 1025960 kB
Mapped: 302628 kB
Shmem: 14180 kB
Slab: 126812 kB
SReclaimable: 65112 kB
SUnreclaim: 61700 kB
KernelStack: 10096 kB
PageTables: 11656 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 4837532 kB
Committed_AS: 4814560 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
Percpu: 65024 kB
HardwareCorrupted: 0 kB
AnonHugePages: 606208 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 180032 kB
DirectMap2M: 4014080 kB
DirectMap1G: 2097152 kB
//查看硬盘容量
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.5G 4.0K 1.5G 1% /dev/shm
tmpfs 1.5G 9.6M 1.5G 1% /run
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/mapper/klas-root 28G 7.4G 21G 27% /
tmpfs 1.5G 4.0K 1.5G 1% /tmp
/dev/sda1 1014M 211M 804M 21% /boot
tmpfs 289M 40K 289M 1% /run/user/0
/dev/sr0 4.1G 4.1G 0 100% /run/media/root/Kylin-Server-10
//查看/tmp目录容量
[root@localhost ~]# df -h /tmp
文件系统 容量 已用 可用 已用% 挂载点
tmpfs 1.5G 4.0K 1.5G 1% /tmp
软件要求
(1)linux版本:2.6以上
(2)glibc版本:2.3以上
(3)gcc 版本:7.3以上(ODBC安装使用到)
//查看linux内核版本
[root@localhost ~]# cat /proc/version
Linux version 4.19.90-24.4.v2101.ky10.x86_64 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Mon May 24 12:14:55 CST 2021
//查看glibc依赖库版本
[root@localhost ~]# ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 自由软件基金会。
这是一个自由软件;请见源代码的授权条款。本软件不含任何没有担保;甚至不保证适销性
或者适合某些特殊目的。
由 Roland McGrath 和 Ulrich Drepper 编写。
//查看gcc编译器版本
[root@localhost ~]# gcc --version
gcc (GCC) 7.3.0
Copyright © 2017 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
安装初始化
(1)开放防火墙端口/关闭防火墙
(2)关闭selinux
(3)创建达梦数据库安装组
(4)创建达梦数据库安装用户并设置到安装组中(root用户安装会出问题)
(5)设置达梦数据库安装用户密码
(6)创建安装目录并更改目录的所属用户和所属组
(7)创建达梦数据库镜像挂载点
(8)挂载达梦数据库镜像
关闭防火墙服务
//关闭防火墙(临时关闭)
[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-08-30 12:15:38 CST; 1h 28min ago
Docs: man:firewalld(1)
Main PID: 1044 (firewalld)
Tasks: 2
Memory: 34.7M
CGroup: /system.slice/firewalld.service
└─1044 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid
8月 30 12:15:38 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
8月 30 12:15:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2022-08-30 13:44:22 CST; 4s ago
Docs: man:firewalld(1)
Process: 1044 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 1044 (code=exited, status=0/SUCCESS)
8月 30 12:15:38 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
8月 30 12:15:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
8月 30 13:44:21 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
8月 30 13:44:22 localhost.localdomain systemd[1]: firewalld.service: Succeeded.
8月 30 13:44:22 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
//关闭防火墙(永久关闭-通过关闭防火墙服务开机自启实现)
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
开放防火墙端口
//查看防火墙状态
[dmdba@localhost dm]$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-08-26 13:35:40 CST; 6min ago
Docs: man:firewalld(1)
Main PID: 1063 (firewalld)
Tasks: 2
Memory: 25.3M
CGroup: /system.slice/firewalld.service
└─1063 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid
//添加防火墙端口
[root@localhost ~]# firewall-cmd --add-port=5236/tcp --permanent
success
//重新加载防火墙
[root@localhost ~]# firewall-cmd --reload
success
//查看防火墙开放的端口
[root@localhost ~]# firewall-cmd --list-ports
5236/tcp
关闭selinux检查
//临时关闭
[root@localhost /]# setenforce 0
setenforce: SELinux is disabled
//永久关闭
[root@localhost ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# ukmls - Multi Level Security protection.
# ukmcs -ukmcs variants of the SELinux policy.
SELINUXTYPE=ukmcs
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
创建达梦数据库安装组
[root@localhost /]# groupadd dinstall
[root@localhost /]# cat /etc/group | grep dinstall
dinstall:x:1000:
创建达梦数据库安装用户
[root@localhost /]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
[root@localhost /]# id dmdba
用户id=1000(dmdba) 组id=1000(dinstall) 组=1000(dinstall)
设置达梦数据库安装用户密码
[root@localhost /]# passwd dmdba
更改用户 dmdba 的密码 。
新的 密码:
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
创建达梦数据库安装目录
[root@localhost /]# mkdir /dm8
[root@localhost /]# ll -d /dm8
drwxr-xr-x 2 root root 6 8月 26 13:09 /dm8
更改安装目录所用户和所属组
[root@localhost /]# chown dmdba:dinstall dm8
[root@localhost /]# ll -d /dm8
drwxr-xr-x 2 dmdba dinstall 6 8月 26 13:09 /dm8
创建达梦数据库镜像挂载点
[root@localhost /]# mkdir /mnt/dm
[root@localhost /]# ll -d /mnt/dm
drwxr-xr-x 2 root root 6 8月 26 13:11 /mnt/dm
挂载达梦数据库镜像
[root@localhost /]# mount /opt/dm8_20220525_x86_rh6_64.iso /mnt/dm
mount: /mnt/dm: WARNING: source write-protected, mounted read-only.
常见的问题
(1)/tmp目录空间不足报错
(2)文件打开数过小警告
/tmp目录空间不足报错解决方法
//修改/etc/fstab文件(永久生效)
//添加tmpfs /tmp tmpfs defaults,size=2G,noatime,mode=1777 0 0
//重新挂载目录使更改生效
[root@localhost /]# vim /etc/fstab
[root@localhost /]# cat /etc/fstab
# /etc/fstab
# Created by anaconda on Thu Aug 25 16:21:58 2022
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/klas-root / xfs defaults 0 0
UUID=6c006d8a-99dc-4b45-a60a-dba80365353b /boot xfs defaults 0 0
/dev/mapper/klas-swap none swap defaults 0 0
# <file system> <mount point> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs defaults,size=2G,noatime,mode=1777 0 0
[root@localhost /]# mount /tmp
[root@localhost /]# df -h /tmp
文件系统 容量 已用 可用 已用% 挂载点
tmpfs 2.0G 0 2.0G 0% /tmp
文件打开数过小警告
//使用ulimit命令(会话级临时生效)
[root@localhost /]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 11341
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 102400
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@localhost /]# ulimit -n 102400
[root@localhost /]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 11341
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 102400
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 102400
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
//修改/etc/security/limits.conf文件(永久生效)
//在/etc/security/limits.conf文件中写入 dmdba soft nofile 102400 dmdba hard nofile 204800 root soft nofile 102400 root hard nofile 204800
[root@localhost ~]# vim /etc/security/limits.conf
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open file descriptors
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
dmdba soft nofile 102400
dmdba hard nofile 204800
root soft nofile 102400
root hard nofile 204800
# End of file