DM7在linux下部署
程序员文章站
2022-06-03 09:46:09
...
1.检查服务器环境:
#获取系统位数
getconf LONG_BIT
#查询系统信息
cat /etc/issue
#查询系统名称
uname -a
2.创建安装用户
a.创建用户组dinstall
groupadd dinstall
b.创建安装用户dmdba
useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
c.初始化用户密码
passwd dmdba
#或者使用
echo "dmdba" | passwd dmdba --stdin
3.配置linux下操作系统限制
data seg size (kbytes, -d)
#建议用户设置为1048576(1G)以上或unlimited,此参数过小将导致数据库启动失败
file size (blocks, -f)
#建议用户设置为unlimited,此参数过小将导致数据库安装或初始化失败
open files (-n)
#建议用户设置为65536以上或者unlimited
virtual memory (kbytes, -v)
#建议用户设置为1048576(1G)以上或unlimited,此参数过小将导致数据库启动失败
修改open files操作如下:
echo "
* - nofile 65535
* - nproc 65535
" >> /etc/security/limits.conf
如需要对安装用户更改unlimited限制修改内容如下:
echo "
dmdba soft nproc 2047
dmdba hard nproc 16384
dmdba soft nofile 4096
dmdba hard nofile 65536
dmdba soft stack 10240
dmdba soft core unlimited
dmdba hard core unlimited
">>/etc/security/limits.conf
4.规划DM数据库安装位置并配置环境变量
mkdir -p /iflytek/{dmdba,dm}
chown -R dmdba:dinstall /iflytek/{dmdba,dm}
su - dmdba
echo "
export DM_HOME=/iflytek/dmdba
export PATH=$PATH:$DM_HOME/bin
" >> ~/.bash_profile
source ~/.bash_profile
5.安装DM数据库
a.解压iso文件
[[email protected] iflytek]# mount dm7开发版(rh7-64)20190917.iso /mnt
mount: /dev/loop0 is write-protected, mounting read-only
[[email protected] iflytek]# ls /mnt
DMInstall.bin DM_Install_en.pdf DM_Install_zh.pdf release_en.txt release_zh.txt
[[email protected] iflytek]# cp /mnt/DMInstall.bin .
[[email protected] iflytek]# umount /mnt
[[email protected] iflytek]# chown dmdba:dinstall DMInstall.bin
b.安装二进制文件,因本机无图形化界面,因此采用命令行模式安装
[[email protected] iflytek]$ ./DMInstall.bin -i
Please select the installer's language (E/e:English C/c:Chinese) [E/e]:
Extract install files.........
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 15064
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 2047
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
The max number of open files is too little, suggest to set 65536 or more to number of open files.
Welcome to DM DBMS Installer
Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:N
Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:Y
TimeZone:
[ 1]: GTM-12=West Date Line
[ 2]: GTM-11=Samoa
[ 3]: GTM-10=Hawaii
[ 4]: GTM-09=Alaska
[ 5]: GTM-08=Pacific(America and Canada)
[ 6]: GTM-07=Arizona
[ 7]: GTM-06=Central(America and Canada)
[ 8]: GTM-05=East(America and Canada)
[ 9]: GTM-04=Atlantic(America and Canada)
[10]: GTM-03=Brasilia
[11]: GTM-02=Middle Atlantic
[12]: GTM-01=Azores
[13]: GTM=Greenwich Mean Time
[14]: GTM+01=Sarajevo
[15]: GTM+02=Cairo
[16]: GTM+03=Moscow
[17]: GTM+04=AbuDhabi
[18]: GTM+05=Islamabad
[19]: GTM+06=Dakar
[20]: GTM+07=BangKok,Hanoi
[21]: GTM+08=China
[22]: GTM+09=Seoul
[23]: GTM+10=Guam
[24]: GTM+11=Solomon
[25]: GTM+12=Fiji
[26]: GTM+13=Nukualofa
[27]: GTM+14=Kiribati
Please Select the TimeZone [21]:21
Installation Type:
1 Typical
2 Server
3 Client
4 Custom
Please Input the number of the Installation Type [1 Typical]:1
Require Space: 963M
Please Input the install path [/home/dmdba/dmdbms]:/iflytek/dm
Available Space:14G
Please Confirm the install path(/iflytek/dm)? (Y/y:Yes N/n:No) [Y/y]:
Pre-Installation Summary
Installation Location: /iflytek/dm
Require Space: 963M
Available Space: 14G
Version Information:
Expire Date:
Installation Type: Typical
Confirm to Install? (Y/y:Yes N/n:No):Y
2019-11-05 11:27:01
[INFO] Installing DM DBMS...
2019-11-05 11:27:02
[INFO] Installing BASE Module...
2019-11-05 11:27:05
[INFO] Installing SERVER Module...
2019-11-05 11:27:06
[INFO] Installing CLIENT Module...
2019-11-05 11:27:07
[INFO] Installing DRIVERS Module...
2019-11-05 11:27:10
[INFO] Installing MANUAL Module...
2019-11-05 11:27:11
[INFO] Installing SERVICE Module...
2019-11-05 11:27:13
[INFO] Move ant log file to log directory.
2019-11-05 11:27:13
[INFO] Installed DM DBMS completely.
Please execute the commands by root:
/iflytek/dm/script/root/root_installer.sh
End
[[email protected] iflytek]# /iflytek/dm/script/root/root_installer.sh
Move /iflytek/dm/bin/dm_svc.conf to /etc
Modify the files' mode of DM Server
Create the DmAPService service
Created symlink from /etc/systemd/system/multi-user.target.wants/DmAPService.service to /usr/lib/systemd/system/DmAPService.service.
Finished to create the service (DmAPService)
Start the DmAPService service
6.初始化DM数据库实例
[[email protected] ~]$ dminit
initdb V7.6.0.197-Build(2019.09.12-112648)ENT
db version: 0x7000a
file dm.key not found, use default license!
License will expire on 2020-09-12
input system dir: /iflytek/dmdba
input db name: dameng
input port num:
input page size(4, 8, 16, 32): 8
input extent size(16, 32): 16
input sec priv mode(0, 1): 0
input time zone(-12:59,+14:00): +8:00
string case sensitive? ([Y]es, [N]o): Y
which charset to use? (0[GB18030], 1[UTF-8], 2[EUC-KR]): 0
length in char? ([Y]es, [N]o): Y
enable database encrypt? ([Y]es, [N]o): N
page check mode? (0/1/2): 0
input elog path:
auto_overwrite mode? (0/1/2): 0
log file path: /iflytek/dmdba/dameng/dameng01.log
log file path: /iflytek/dmdba/dameng/dameng02.log
write to dir [/iflytek/dmdba/dameng].
create dm database success. 2019-11-05 13:47:07
7.启动达梦数据库
./dmserver -noconsole /iflytek/dmdba/dameng/dm.ini &