Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OGG maintenance optimization script (22)-deployment preparation-script deployment preparation

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I'm sorry, but the script deployment is going to be discussed later.

The following must be fully configured for all the scripts mentioned above to take effect successfully.

1. Environment package installation

Because the script is implemented through shell and perl. The system must support bshell to meet the running environment

Some AIX servers need to install RPM packages because of lack of bshell

So you need to install the following two installation packages

Gettext-0.17-8.aix6.1.ppc.rpm

Bash-4.2-9.aix6.1.ppc.rpm

The upload script implements interactive access through expect, so some linux and aix servers

The package for expect must be installed.

two。 Adjust the environment of OGG operation and maintenance account

Some accounts in the Aix system call ksh by default instead of bsh. The / etc/passwd file must be adjusted to call bshell.

Example

/ etc/passwd

Ggs2:!:507:301::/oracle/test1/ggs2:/usr/bin/bashggs1:!:204:301::/oracle/test1/ggs1:/usr/bin/bash

Modify the end value to / user/bin/bash

3. Modify the system configuration file profile

Because some of the script instructions are called through alias aliases, you need to modify the .profile file or .bash _ profile file of the OGG system account.

Add the following instructions

Alias edit='/bin/bash$HOME/ggscript/ggedit'# calls the selection script ggeditalias view='cd$HOME/ggserver&& (echo info all Echo exit) |. / ggsci | grep-E "EXTRACT | MANAGER | REPLICAT" & & cd $HOME'# obtains all process status through view instruction alias add='/bin/bash$HOME/ggscript/ggadd/add.sh'# executes quick table addition script alias pcsinfo='/bin/bash $HOME/ggscript/ggupload/processinfo.sh'# through add instruction calls detailed process information query script alias repeat='/bin/bash$HOME/ggscript/ggrepeat/repeat.sh'# through pcsinfo instruction calls via repeat instruction The repeating table query script alias area='/bin/bash$HOME/ggscript/ggarea/area.sh'# acquires the area query script through the area instruction alias note='/bin/bash$HOME/ggscript/ggnote/note.sh'# invokes the quick comment script alias start='/bin/bash$HOME/ggscript/ggoperat/start.sh'# through the note instruction invokes the process to start the script alias stop='/bin/bash$HOME/ggscript/ggoperat/stop.sh'# through the stop instruction Call the process stop script alias info='/bin/bash$HOME/ggscript/ggoperat/info.sh'# to view the script by calling the process status through the info instruction

4. Process naming and deployment specification

All EXTRACT processes must start with E

All sending processes must be named starting with P

All write replicat processes must be named starting with R

It makes it easy for scripts to distinguish the types of processes by opening characters.

OGG programs for all machines must be deployed under the $HOME/ggserver path

The script must be placed under the $home/ggscript path

5. Specification for annotation of area information

Because all the process configuration files of OGG are stored in dirprm, the script I wrote is actually a direct operation on the prm file.

Based on my actual OGG data synchronization configuration, the tables that we have configured in the process

It is classified by prefectures, cities or provinces in order to facilitate maintenance and classification in the future.

Therefore, in order for scripts such as bulk add tables to accurately locate table names, all prm table names must be commented.

Annotation example

-- HeBei-Begin

TABLE FMTMP.MANTMP

TABLE FMTMP.ADDRTMP_ALL

TABLE FMTMP.TMP

.

.

TABLE FMTMP.TMPPORT

-- HeBei-Insert

-- HeBei-End

Before each regional class table, start with regional pinyin (beginning with capital)-Begin

End with the same regional pinyin-Insert and prefectural and municipal regional pinyin (beginning with capital)-End, respectively.

The script gets all the tables configured between Begin and End to match the duplicate values of the tables to be configured.

The additional table will be inserted between Insert and End (due to the restriction of sed version on AIX system)

6. Process information comments

Part of the query information script needs to accurately locate the information through process information comments.

It is known that in the three types of EXTRACT,PUMP,REPLICATE processes, the content is divided into two parts: parameter (PARAMETER) and table (TABLE).

To annotate the configuration, you need to add an info class to mark the relevant information about the process.

At the same time, the parameters and table contents are distinguished by annotations, which is convenient for other scripts to query and summarize information resources and modify them in batches in the future.

Comment configuration rules

EXTRACT process

EXTRACT XXXX

-- [INFO#]

-- source:-- Source HOSTNAME

-- sourceIP: source IP

-- [# INFO]

-- [PARAMETER#]

USERID ggs@.

.

-- [# PARAMETER]

-- [TABLE#]

TABLE XX.XXXXXX

TABLE XX.XXXXXX

-- [# TABLE]

Delivery process

EXTRACT XXXX

-- [INFO#]

-- source: source hostname

-- sourceIP: source IP

-- target: hostname of the destination side

-- targetIP: target side IP

-- defsfile: definition file under dirdef

-- definition profile under defprm:dirprm

-- [# INFO]

-- [PARAMETER#]

RMTHOST.

.

-- [# PARAMETER]

-- [TABLE#]

TABLE XX.XXXXXX

TABLE XX.XXXXXX

-- [# TABLE]

REPLIAT process

REPLICAT XXXXXX

-- [INFO#]

-- source: source hostname

-- sourceIP: source IP

-- target: hostname of the destination side

-- targetIP: target side IP

-- defsfile: definition file under dirdef

-- [# INFO]

-- [PARAMETER#]

USERID ggs@.

.

-- [# PARAMETER]

-- [TABLE#]

MAP XXXX.XXXXX, TARGET XXXXX.XXXXX

-- [# TABLE]

7. Define file information comments

If the definition file is automatically uploaded to the script, you need to obtain the IP of the destination side that sent the definition file, as well as the path account and other information, so that it can be automatically generated and sent normally.

This kind of information needs to be accurately configured in the definition configuration file in the dirprm.

Configuration example

-- [INFO#]

-- RELEASE:10.4 GG definition file version

-- TARGET:defzlzxsz corresponds to the hostname configured in the system information file, which needs to be unified and coordinated.

-- [# INFO]

All definition file configuration paths of DEFSFILE. / dirdef/xxxxx must be changed to. / dirdef/xxxxx, and no other parameters are added to the backend.

USERID... ..

-- [TABLE#]

TABLE XXXXX

TABLE XXXXX

-- [# TABLE]

8. Scheduled task configuration

Defining the automatic distribution of files and the upload of system process information need to be executed automatically through scheduled tasks.

23 * / bin/bash $HOME/ggscript/ggdef/resend.shdefzlzxdg.prm > $HOME/gglog/ggdef/resend.log

This paragraph is modified according to the specific definition configuration file name.

30 * / bin/bash$HOME/ggscript/ggupload/pcsinfoupload.sh > $HOME/gglog/ggupload/pcsinfoupload.log

9. Backup folder creation

Create a bak folder under $HOME/ggserver/dirprm and $HOME/ggserver/dirdef to hold the backup files automatically generated by the process modification class script for each operation

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report