SSR Database Management Scripts
All SSR administration scripts are executed on management nodes. The scripts directly related to cluster and database management are included in this section.
Using the Monitor Script
Using the Monitor Script
The Monitor.sh script is useful for monitoring cluster operations, either to take a snapshot or to use for real-time monitoring.
Monitor.sh
Monitor.sh
The Monitor.sh script provides real-time monitoring of the SSR cluster. The Monitor.sh script periodically executes one or more scripts, such as ShowPools.sh, which looks for changes in the Steel-Belted Radius Carrier high availability database. If a change is found, the Monitor.sh script updates the statistics it displays when a change is detected.
To change the default time zone setting from UTC time, you must edit this script and the DBtime zone.txt field. For more information about editing the scripts, see Table 102.
Syntax
Options
Table 78: Monitor.sh Options
Option | Description |
---|---|
-sseconds | Specifies the number of seconds the Monitor.sh script should wait between execution of its commands. The number of seconds must follow the -s argument without a space. Default value is 1 second. |
-l | Specifies only a limited number of printouts; 0 defaults to no limit. |
scriptname | Specifies the name of the script you want Monitor.sh to execute. |
arguments | Specifies the arguments for the script that you want Monitor.sh to execute. |
-c | Clears the screen before each display page (by default, a blank line separates the displays). |
-h | Displays help for the Monitor.sh script. |
Example
The following example shows the output for the Monitor.sh script:
hadm$- Monitor.sh "Ndb_mgm -e show" ============== [1] Mon Apr 23 15:38:24 (TZ=+00:00) 2009 =============== Connected to Management Server at: 172.25.98.250:1186 Cluster Configuration ------------------------------------- [ndbd(NDB)] 6 node(s) id=10 @172.25.98.245 (Version: 5.0.30, Nodegroup: 0, Master) id=11 @172.25.98.246 (Version: 5.0.30, Nodegroup: 0) id=12 @172.25.98.247 (Version: 5.0.30, Nodegroup: 1) id=13 @172.25.98.248 (Version: 5.0.30, Nodegroup: 1) id=14 @172.25.98.244 (Version: 5.0.30, Nodegroup: 2) id=15 @172.25.98.251 (Version: 5.0.30, Nodegroup: 2) [ndb_mgmd(MGM)] 2 node(s) id=1 @172.25.98.249 (Version: 5.0.30) id=2 @172.25.98.250 (Version: 5.0.30) [mysqld(API)] 8 node(s) id=20 @172.25.98.249 (Version: 5.0.30) id=21 @172.25.98.250 (Version: 5.0.30) id=30 @172.25.98.243 (Version: 5.0.30) id=32 (not connected, accepting connect from 172.25.98.250) id=34 (not connected, accepting connect from 172.25.98.252) id=35 @172.25.98.231 (Version: 5.0.30) id=36 @172.25.98.232 (Version: 5.0.30) id=63 (not connected, accepting connect from any host)
Creating and Destroying the SSR Database
Creating and Destroying the SSR Database
One script creates the SSR database; a second destroys the existing database.
CreateDB.sh
CreateDB.sh
The CreateDB.sh script creates a new database from the schema in the CurrentSessions.sql file. For details, see the section on Customizing the SSR Database Current Sessions Table in the SBR Carrier Installation Guide. It rebuilds all related tables and stored procedures, and gives the new database the name specified in the DBName.txt file.
CreateDB.sh must be executed on all management nodes in the cluster.
Syntax
Options
Table 79: CreateDB.sh Options
Option | Description |
---|---|
-h | Displays help for the CreateDB.sh script. |
Example
The following example displays the contents of the DBName.txt file (to verify the name (“SteelBeltedRadius”) to be used to create the database) and creates a database named SteelBeltedRadius.
Usage Notes
The CreateDB.sh script determines whether a database exists when it starts; if a database is found, the CreateDB.sh script halts.
Auxiliary SQL Files Used by CreateDB.sh
Table 80 lists the auxiliary SQL files in /opt/JNPRhadm that contain information used by the CreateDB.sh script.
Table 80: Auxiliary SQL Files Used by CreateDB.sh
SQL Filename | Description | Table Schemas |
---|---|---|
Misc.sql | Contains schemas for miscellaneous internal tables |
|
IPAddrs.sql | Contains schemas for tables involved in IP address management |
|
CurrentSessions.sql | Contains schema for the Current Sessions Table |
|
UserConcurrency.sql | Contains schema for the User Concurrency Table |
|
StoredRoutines.sql | Contains various stored routines used by the administration scripts |
|
DestroyDB.sh
DestroyDB.sh
The DestroyDB.sh script deletes the existing database.
DestroyDB.sh needs to be run once, on one management node.
Syntax
Options
Table 81: DestroyDB.sh Options
Option | Description |
---|---|
-h | Displays help for the DestroyDB.sh script. |
Example
Creating a Demonstration Database
Creating a Demonstration Database
One script creates a demonstration database that is useful for testing, but is not intended to create a working production database.
DemoSetup.sh
DemoSetup.sh
The DemoSetup.sh script creates a new database and related tables, gives the new database the name specified in the DBName.txt file, and populates the database with a sample IP address pool configuration. You can use this program to test a cluster environment without using live production data.
Syntax
Options
Table 82: DemoSetup.sh Options
Option | Description |
---|---|
numpools | A number in the range 1–25 that specifies the number of IP address pools for the script to create. Default value is 5. |
maxranges | A number in the range 1–20 that specifies the number of address ranges within each IP address pool for the script to create. Default value is 4. |
minaddrs | A number in the range 1–100,000 that specifies the minimum number of IP addresses per range for the script to create. Default value is 1000. |
maxaddrs | A number in the range 1–100,000 that specifies the maximum number of IP addresses per range for the script to create. Default value is the value of minaddrs x 2. |
-h | Displays help for the DemoSetup script. |
Example
This example displays the contents of the DBName.txt file (to verify that SteelBeltedRadius is used to create the database) and creates a database called SteelBeltedRadius:
hadm$- DemoSetup.sh SBRs must be offline, do you want to proceed? <yes|no> yes
This will destroy the “SteelBeltedRadius” database (if it exists), OK? <yes|no> yes NUMPOOLS=5 MAXRANGES=4 MINADDRS=1000 MAXADDRS=2000 Destroying old database Database "SteelBeltedRadius" destroyed. Creating new database Creating database "SteelBeltedRadius" (using ENGINE ndbcluster). Creating misc tables. Creating IP Pool, Range and Address tables. Creating Current Sessions table. (Proxy AutoStop feature not configured.) (Session Timeout on Missed Account Stop feature not configured.) (Use Single Class Attribute feature not configured.) LDAP/SQL Bridge feature configured (though not yet enabled). Creating User Concurrency table. Creating stored routines. Adding pool: A-PLATINUM Adding range: A-PLATINUM 238.203.131.14 670 Adding range: A-PLATINUM 48.226.119.162 761 Adding pool: B-GOLD Adding range: B-GOLD 90.169.221.242 549 Adding range: B-GOLD 20.97.26.189 89 Adding range: B-GOLD 114.23.180.47 407 Adding range: B-GOLD 236.99.7.33 384 Adding pool: C-SILVER Adding range: C-SILVER 201.213.13.198 978 Adding range: C-SILVER 15.28.0.17 22 Adding range: C-SILVER 28.189.195.246 2 Adding range: C-SILVER 132.185.74.85 11 Adding pool: D-BRONZE Adding range: D-BRONZE 122.219.182.131 1247 Adding range: D-BRONZE 247.168.228.227 20 Adding pool: E-ZINC Adding range: E-ZINC 135.54.24.139 1794 IpPools: +---------------+-------+------------+ | Name | Ord | Count | +---------------+-------+------------+ | (z o m b i e) | 0 | 0 | | A-PLATINUM | 1 | 1,431 | | B-GOLD | 2 | 1,429 | | C-SILVER | 3 | 1,013 | | D-BRONZE | 4 | 1,267 | | E-ZINC | 5 | 1,794 | +---------------+-------+------------+ Total Pools : 5 + 1 zombie pseudo-pool. Total Ranges: 13 + 0 zombie pseudo-ranges. Total Addrs : 6,934 + 0 zombie pseudo-addrs. IpRanges: +---------------+-------------------+-------------------+-------+ | Pool | StartAddr | EndAddr | Count | +---------------+-------------------+-------------------+-------+ | (z o m b i e) | (v a r i o u s) | (v a r i o u s) | 0 | | A-PLATINUM | 48.226.119.162 | 48.226.122.154 | 761 | | A-PLATINUM | 238.203.131. 14 | 238.203.133.171 | 670 | | B-GOLD | 20. 97. 26.189 | 20. 97. 27. 21 | 89 | | B-GOLD | 90.169.221.242 | 90.169.224. 22 | 549 | | B-GOLD | 114. 23.180. 47 | 114. 23.181.197 | 407 | | B-GOLD | 236. 99. 7. 33 | 236. 99. 8.160 | 384 | | C-SILVER | 15. 28. 0. 17 | 15. 28. 0. 38 | 22 | | C-SILVER | 28.189.195.246 | 28.189.195.247 | 2 | | C-SILVER | 132.185. 74. 85 | 132.185. 74. 95 | 11 | | C-SILVER | 201.213. 13.198 | 201.213. 17.151 | 978 | | D-BRONZE | 122.219.182.131 | 122.219.187. 97 | 1,247 | | D-BRONZE | 247.168.228.227 | 247.168.228.246 | 20 | | E-ZINC | 135. 54. 24.139 | 135. 54. 31.140 | 1,794 | +---------------+-------------------+-------------------+-------+