Document Type | Technical Information
Category l Interface/Integration
Applicable Product Version | Tibero 6 (FS07)
Document Number | TIITI035
Overview
This document guides you through creating database startup/shutdown services using system unit files and systemctl commands when integrating Pacemakers on Redhat 8.X.
Method
Test Environment
OS: Red Hat Enterprise Linux release 8.2 (Ootpa) Kernel: Linux finlin 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Tibero Version: Tibero 6 (DB 6.0 FS07_CS_2005) |
Startup / Shutdown Scripts
#!/bin/bash su - test -c "tbdown clean" su - test -c "tbboot" exit 0 |
#!/bin/bash su - test -c "tbdown immediate" exit ## Change to tbdown abort during redundancy testing |
After creating the start/stop shells, it is necessary to change the owner's execution permissions.
$ chmod o+x /tmp/tibero/start.sh $ chmod o+x /tmp/tibero/stop.sh
1. Writing the Systemd Unit Script
# Execute as root Creation path: /lib/systemd/system/dbtib.service $ vi /lib/systemd/system/dbtib.service [Unit] Description=The Tibero Database Service After=syslog.target network.target [Service] # systemd ignores PAM limits, so set any necessary limits in the service. # Not really a bug, but a feature. # https://bugzilla.redhat.com/show_bug.cgi?id=754285 LimitMEMLOCK=infinity LimitNOFILE=65535 #Type=simple Type=forking # When using forking type, systemctl status shows the forked process # idle: similar to simple, the actual execution of the service binary is delayed # until all jobs are finished, which avoids mixing the status output with shell output of services. RemainAfterExit=yes Restart=no ## Tibero Stop ExecStop=/bin/bash -c '/tmp/tibero/stop.sh' ## Tibero Start ExecStart=/bin/bash -c '/tmp/tibero/start.sh' [Install] WantedBy=multi-user.target
2. systemctl Operations (execute as root user)
2.1 Reload Service
$ sysctlctl daemon-reload
2.2 Check Service
$ systemctl status dbtib.service
2.3 Start Service
$ systemctl start dbtib.service
[simple type]
[forking type]
2.4 Stop Service
$ systemctl stop dbtib.service
2.5 Enable Service
$ systemctl enable dbtib.service
Notes
systemd
An init system that bootstraps user space and ultimately manages all processes instead of Unix System V or BSD init systems on some Linux distributions.
- The "d" added after the name systemd stands for daemon in Unix.
- It is released as free and open-source software licensed under GNU LGPL version 2.1 or later.
- One of systemd's primary goals is to unify basic Linux configurations and service operations across all distributions.
systemctl
A tool to control Linux's systemd and service manager.
- Provides overall management functions such as service status diagnosis, configuration changes, startup, and shutdown.
Regarding Pacemaker Integration
- From Redhat 8.x onwards, it is recommended to register and manage systemd unit files in systemd when integrating Pacemaker.
- Tibero requires provision either in the old init file format or as a Systemd unit file.
- Currently, RHEL7/8 trends towards managing fstab and file systems with Systemd as well. (OCF method)
- If Systemd unit files are not possible, the init file must contain all start/stop/status information in a single file. (LSB method)