签到成功

知道了

CNDBA社区CNDBA社区

达梦数据库 DM8 中 注册服务 说明

2019-10-29 19:38 2074 0 原创 DM 达梦
作者: Dave

达梦数据库 DM8 中 注册服务 说明

https://www.cndba.cn/dave/article/3753
https://www.cndba.cn/dave/article/3753

在之前的博客我们了解了DM7中的服务注册,如下:

DM7 达梦数据库 通过dminit 创建 并 注册 数据库实例
https://www.cndba.cn/dave/article/3580https://www.cndba.cn/dave/article/3753

在DM8中,注册服务命令的使用有所变化。

https://www.cndba.cn/dave/article/3753
https://www.cndba.cn/dave/article/3753

我们先看帮助:

[dmdba@dm8 root]$ pwd
/dm/dmdbms/script/root
[dmdba@dm8 root]$ ./dm_service_installer.sh -h
Must run the script by root!
[dmdba@dm8 root]$ exit
logout
[root@www.cndba.cn system]# cd /dm/dmdbms/script/root
[root@www.cndba.cn root]# ./dm_service_installer.sh -h
Usage: dm_service_installer.sh -t service_type [-p service_name_postfix] [-dm_ini dm_ini_file]
        [-watch_ini watch_ini_file ] [-wmon_ini wmon_ini_file] [-rww_ini rww_ini_file]
        [-watcher_ini watcher_ini_file ] [-monitor_ini monitor_ini_file] [-cssm_ini cssm_ini_file]
        [-dfs_ini dfs_ini_file] [-dcr_ini dcr_ini_file]
        [-dss_ini dss_ini_file] [-drs_ini drs_ini_file] [-dras_ini dras_ini_file] [-dcs_ini dcs_ini_file] [-server server_info]
        [-m open|mount] [-y dependent_service]
  or dm_service_installer.sh [-s service_file_path]
  or dm_service_installer.sh -h

   -t               Service Type, include: dmimon,dmap,dmserver,dmwatcher,dmmonitor,dmcss,dmcssm,dmasmsvr,dmdcs,dmdrs,dmdras,dmdss.
   -p               Service Name Postfix, is invalid for dmimon,dmap.
   -dm_ini          The path of the dm.ini file.
   -watch_ini       The path of the dmwatch.ini file.
   -wmon_ini        The path of the dmwmon.ini file.
   -rww_ini         The path of the dmrww.ini file.
   -watcher_ini     The path of the dmwatcher.ini file.
   -monitor_ini     The path of the dmmonitor.ini file.
   -dcr_ini         The path of the dmdcr.ini file.
   -cssm_ini        The path of the dmcssm.ini file.
   -dss_ini         The path of the dss.ini file.
   -drs_ini         The path of the drs.ini file.
   -dras_ini        The path of the dras.ini file.
   -dcs_ini         The path of the dcs.ini file.
   -dfs_ini         The path of the dfs.ini file.
   -server          server info
   -m               Set the start modeof the server, include:open or mount, is valid for dmserver only, select.
   -y               Set the dependent service, this parameter is valid for dmserver,dmasmsvr in systemd service environment.
   -s               The path of the service script file, if set this parameter and ignore other parameter but -y.
   -h               Help
[root@www.cndba.cn root]#

脚本中参数部分变化比较明显,不同的类型有独立的参数对应。 在注册时对应上就好。我们这里注册一个DM8的单实例:

https://www.cndba.cn/dave/article/3753
https://www.cndba.cn/dave/article/3753

注册:

[root@www.cndba.cn root]# ./dm_service_installer.sh -t dmserver -p dave -dm_ini /dm/dmdbms/data/dave/dm.ini 
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicedave.service to /usr/lib/systemd/system/DmServicedave.service.
Finished to create the service (DmServicedave)
[root@www.cndba.cn root]# 
[root@www.cndba.cn root]# systemctl start DmServicedave.service 
[root@www.cndba.cn log]# ps -ef|grep dm.ini
dmdba     7501     1  0 13:55 ?        00:00:00 /dm/dmdbms/bin/dmserver /dm/dmdbms/data/dave/dm.ini -noconsole
root      7587  5538  0 13:57 pts/4    00:00:00 grep --color=auto dm.ini
[root@www.cndba.cn log]#

卸载:https://www.cndba.cn/dave/article/3753https://www.cndba.cn/dave/article/3753

[root@www.cndba.cn root]# ./dm_service_uninstaller.sh -n DmServicedave
Whether to delete the service(DmServicedave) (Y/y:yes N/n:no): y
Failed to stop DmServicedave.service: Unit DmServicedave.service not loaded.
Failed to execute operation: Bad message
Finished to delete the service file(/usr/lib/systemd/system/DmServicedave.service)
Finished to delete the service(DmServicedave)

如果是其他服务,只需要通过-t和对应的 -xx_ini 来指定信息即可。https://www.cndba.cn/dave/article/3753

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
Dave

Dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 1902
    原创
  • 2
    翻译
  • 456
    转载
  • 131
    评论
  • 访问:3641784次
  • 积分:3137
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by ZhiXinTech · 皖ICP备19020168号·

        QQ交流群