McIDAS-XCD Administrator's Guide
Version 2023.1

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]


gribadmin

Unix command for managing the MySQL/MariaDB database used by the GRIB server.


Formats

gribadmin makedb
gribadmin removedb
gribadmin disablelog
gribadmin fields
gribadmin num  model
gribadmin latest  model


Parameters

makedb

makes the database from scratch with the following attributes:

  • the database is named mcrtgrib
  • the read-only user is gribread and has no password
  • the read-write user is gribwrite with password gribwrite

removedb 

removes the database completely from MySQL/MariaDB

disablelog 

disables the writing of binary log files associated with the database; this overrides the default in MySQL/MariaDB 8.0 and later, which enable binary logging by default; we recommend disabling the logging because it is not useful and it fills large amounts of disk (possibly an entire file system) due to it logging millions of INSERT into file_list entries per day; this option must be run as root, see the Remarks for instructions

fields

prints the fields in the database and their data types

num

displays the number of records in the database; if model is not specified then the number of records for each model will be displayed; if total is specified then the total number of records in the database will be displayed

latest

displays the latest record in the database; if model is not specified then the latest record in the database will be displayed regardless of the model

model model/source name appearing in the GRIB files

Remarks

The Configuration Sections section of the gribadmin script appears in the box below. It contains variables that change its behavior. These variables must be reviewed before using the script. In particular, the mysql_path and gcc_lib_path variables may need to be changed.

#=========================================================
# Configuration Section:
#
# The variables in this section may need to be modified
# to conform to your system. 

# Database and user names for MySQL calls
database_name="mcrtgrib"
database_user="gribread"
 
   # Path to the MySQL executable
mysql_path=/usr/local/mysql/bin

# Path to gcc shared libraries
gcc_lib_path=/usr/local/lib

#=========================================================

The makedb and removedb options will prompt for a password. Enter the password for the MySQL/MariaDB root user, which was set by the person that installed MySQL/MariaDB.

The disablelog option disables the writing of binary log files associated with the database. This is needed because MySQL/MariaDB 8.0 and later enable binary logging by default, which fills large amounts of disk (possibly an entire file system) due to it logging millions of INSERT into file_list entries per day. To run the disablelog option, run the command below as root:

Type: /home/oper/mcidas/bin/gribadmin disablelog

When the command is finished, you should see a message like that below.

/etc/my.cnf.d/disable-log-bin.cnf successfully written!

Once its successful completion is verified, exit from root.

 


Examples

gribadmin fields

This entry prints the fields in the database and their data types.

gribadmin latest GFS

This entry displays the latest record among GFS GRIB files in the database.


[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]