Commit 084024cb authored by root's avatar root

Added mariadb structure dump and setup instructions.

parent bbd12c54
-- MySQL dump 10.17 Distrib 10.3.22-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: prope
-- ------------------------------------------------------
-- Server version 10.3.22-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `Backup`
--
DROP TABLE IF EXISTS `Backup`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Backup` (
`shard_id` int(11) NOT NULL,
`start` bigint(20) NOT NULL,
`end` bigint(20) NOT NULL,
`success` tinyint(1) NOT NULL,
`restored` tinyint(1) NOT NULL,
`influx_version` varchar(32) CHARACTER SET latin1 COLLATE latin1_german1_ci NOT NULL,
`from_server` char(15) CHARACTER SET latin1 COLLATE latin1_german1_ci NOT NULL,
`metadata_corrected` tinyint(4) NOT NULL DEFAULT 0,
`footprints_created` tinyint(4) NOT NULL DEFAULT 0,
`tags_created` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`start`,`shard_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `Dashboards`
--
DROP TABLE IF EXISTS `Dashboards`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Dashboards` (
`NAME` varchar(128) NOT NULL,
`STATUS` varchar(128) NOT NULL,
PRIMARY KEY (`NAME`),
UNIQUE KEY `NAME` (`NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `Job_Data`
--
DROP TABLE IF EXISTS `Job_Data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Job_Data` (
`UID` bigint(20) NOT NULL AUTO_INCREMENT,
`JID` bigint(20) NOT NULL,
`USER` varchar(32) NOT NULL,
`PROJECT` varchar(64) DEFAULT NULL,
`STATUS` varchar(128) NOT NULL,
`NUM_NODES` int(11) NOT NULL,
`NODELIST` varchar(8192) NOT NULL,
`CPULIST` varchar(8192) NOT NULL,
`NUM_CORES` int(11) DEFAULT NULL,
`SUBMIT` bigint(20) DEFAULT NULL,
`START` bigint(20) NOT NULL DEFAULT 0,
`END` bigint(20) DEFAULT NULL,
`NAME` varchar(256) NOT NULL DEFAULT 'none',
`WALLTIME` int(11) NOT NULL,
`P_PARTITION` varchar(64) NOT NULL,
`EXCLUSIVE` tinyint(4) NOT NULL,
`PROPERTY_ID` tinyint(4) DEFAULT 0,
`ARRAY_ID` bigint(20) DEFAULT NULL,
`TAGS` bigint(20) DEFAULT NULL,
`FOOTPRINT` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`UID`),
UNIQUE KEY `UJID_INDEX` (`JID`,`START`) USING BTREE,
KEY `START_INDEX` (`START`) USING BTREE,
KEY `PROJECT_INDEX` (`PROJECT`) USING BTREE,
KEY `USER_INDEX` (`USER`) USING BTREE,
KEY `JOB_INDEX` (`NAME`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18580308 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `Job_Tag`
--
DROP TABLE IF EXISTS `Job_Tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Job_Tag` (
`Tag_ID` bigint(20) NOT NULL,
`Name` varchar(64) NOT NULL,
PRIMARY KEY (`Tag_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `events`
--
DROP TABLE IF EXISTS `events`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date DEFAULT NULL,
`comment` longtext DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `footprint_base`
--
DROP TABLE IF EXISTS `footprint_base`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `footprint_base` (
`uid` bigint(20) NOT NULL,
`ipc_mean_per_core` double DEFAULT NULL,
`cpu_used_mean_per_core` double DEFAULT NULL,
`flops_any_mean_per_core` double DEFAULT NULL,
`mem_bw_mean_per_socket` double DEFAULT NULL,
`cpu_power_mean_per_socket` double DEFAULT NULL,
`ib_bw_mean_per_node` double DEFAULT NULL,
`host_mem_used_max_per_node` double DEFAULT NULL,
PRIMARY KEY (`uid`),
CONSTRAINT `footprint_base_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `Job_Data` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `footprint_fileio`
--
DROP TABLE IF EXISTS `footprint_fileio`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `footprint_fileio` (
`uid` bigint(20) NOT NULL,
`lustre_scratch2_read_bytes` bigint(20) DEFAULT NULL,
`lustre_scratch2_write_bytes` bigint(20) DEFAULT NULL,
`lustre_highiops_read_bytes` bigint(20) DEFAULT NULL,
`lustre_highiops_write_bytes` bigint(20) DEFAULT NULL,
PRIMARY KEY (`uid`),
CONSTRAINT `footprint_fileio_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `Job_Data` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `footprint_gpu`
--
DROP TABLE IF EXISTS `footprint_gpu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `footprint_gpu` (
`uid` bigint(20) NOT NULL,
`used_mean_per_gpu` double DEFAULT NULL,
`mem_used_max_per_gpu` double DEFAULT NULL,
`power_mean_per_gpu` double DEFAULT NULL,
PRIMARY KEY (`uid`),
CONSTRAINT `footprint_gpu_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `Job_Data` (`UID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `properties`
--
DROP TABLE IF EXISTS `properties`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `properties` (
`P_ID` tinyint(4) NOT NULL,
`NAME` varchar(128) NOT NULL,
PRIMARY KEY (`P_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-06-03 14:44:34
#! /bin/bash
if [[ $# -eq 0 ]] ; then
echo 'Parameter missing...'
echo 'setup_maria_db.sh <user> <password> <db>'
exit 1
fi
newUser=$1
newDbPassword=$2
newDb=$3
host='%'
commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
echo "${commands}" | mysql
host=localhost
commands="CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
echo "${commands}" | mysql
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment