一刷后、操作系統(tǒng)準(zhǔn)備
這里推薦安裝圖形界面的Linux
關(guān)閉防火墻娱仔、selinux、NetworkManager并禁止開機(jī)自啟動(dòng)
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
setenforce 0 --臨時(shí)關(guān)閉sleinux
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config --永久關(guān)閉selinux
二稳衬、創(chuàng)建相關(guān)用戶和組
groupadd dinstall
mkdir -p /home/dmdba
useradd -g dinstall -m -d /home/dmdba/dm -s /bin/bash dmdba
三羹铅、修改環(huán)境變量
su - dmdba
vim /home/dmdba/dm/.bashrc
添加如下命令
export PATH=$PATH:/sbin:/usr/sbin
export PS1='[\u@\h \w]\$'
source /home/dmdba/dm/.bashrc
分別在root(~.bashrc)和dmdba用戶的家目錄下的.bashrc添加如下參數(shù)
ulimit -c unlimited
ulimit -n 65536
(dmdba)source /home/dmdba/dm/.bashrc
(root)source .bashrc
四蚀狰、使用root用戶掛載光盤使用dmdba用戶進(jìn)行安裝
su - root
mount -o loop dm7_setup_rh7_64_ent_7.6.0.197_20190917.iso /opt
######指定緩存路徑(可選,若不指定則默認(rèn)使用/tmp作為臨時(shí)緩存路徑)#################
#mkdir -p /opt/tmp #
#chown -R dmdba:dinstall /opt/tmp #
#chmod -R 777 /opt/tmp #
######指定緩存路徑(可選睦裳,若不指定則默認(rèn)使用/tmp作為臨時(shí)緩存路徑)#################
######指定緩存路徑后需要添加環(huán)境變量###############
#export DM_INSTALL_TMPDIR=/opt/tmp/ #
################################################
su - dmdba
./DMInstall.bin -i(命令行) -q(靜默安裝) (不加參數(shù)圖形化安裝)
Extract install files.........
Welcome to DM Install Program
Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:Y
Please Input the Path of the Key File [dm.key]:/home/dmdba/dm.key
Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:Y
Please Select the TimeZone [21]:21
Please Input the number of the Installation Type [1 Typical]:1
Please Input the install path [/home/dmdba/dm]:/home/dmdba/dm/dmdbms
Please Confirm the install path? (Y/y:Yes N/n:No) [Y/y]:Y
Confirm to Install? (Y/y:Yes N/n:No) [Y/y]:Y
安裝后根據(jù)提示使用root用戶執(zhí)行腳本來啟動(dòng)DMAP服務(wù)(該服務(wù)用于數(shù)據(jù)傳輸)
五、對(duì)數(shù)據(jù)庫進(jìn)行初始化
su - root
mkdir -p /dbdata(初始化指定數(shù)據(jù)文件存放位置)
chown –R dmdba:dinstall /dbdata
su - dmdba
cd /home/dmdba/dm/dmdbms/bin
./dminit INI_FILE=/dbdata/dmdata/DAMENG/dm.ini PATH=/dbdata/ extent_size=16 page_size=32 case_sensitive=y --相關(guān)參數(shù)可以根據(jù)自己的口味進(jìn)行定制
六撼唾、啟動(dòng)數(shù)據(jù)庫
./dmserver /dbdata/DAMENG/dm.ini
##########加入systemctl啟動(dòng)(在script下)##########
./dm_service_installer.sh -t dmserver -p test -i /home/dmdba/DAMENG/dm.ini
調(diào)用dmserverd后臺(tái)啟動(dòng)
#cd /home/dmdba/dm/dmdbms/bin/service_template
#vim DmService
修改INI_PATH=%INI_PATH%為
INI_PATH=/home/dmdba/dm/dmdbms/bin/dm.ini
去bin目錄下./執(zhí)行 start
###############設(shè)置環(huán)境變量廉邑,使dmdba用戶在任意目錄下都能執(zhí)行disql########
vim .bashrc
export PATH=$PATH:/home/dmdba/dm/dmdbms/bin