Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

User documentation: SDN-R Upgrade Procedure

This will be a CommandLineTool for:

  • (re)initialize/upgrade SDN-R DB
  • backup and restore SDN-R DB data
  • create unit test init-file

Its sources are located in the data-provider subproject of ccsdk/features  sdnr/wt projects but it won't be deployed as a bundle for opendaylight, so that it is possible to run it independently from any sdnc. 

Database Init Container

This Tool will be executed inside the sdnc container with a seperate flag (env-var) 'SDNRINIT', so that the tool will be executed once and the container will be stopped afterwards. The parameters will also pushed within environment variables

  • SDNRDBURL 
  • SDNRDBUSERNAME
  • SDNRDBPASSWORD

User password coding is "ASCII". If one of SDNRDBUSERNAME or SDNRDBPASSWORD is empty the no-authentication is configured. 

Security enabled/disabled by SDNRDBURL, by "https" or "http". Default is "http://sdnrdb:9200". All client certs are accepted.

Example

  • SDNRDBURL="http://sdnrdb:9200" 
  • SDNRDBUSERNAME="fdjafls"
  • SDNRDBUSERPASSWORD="57!232#"

Structure

In Elasticsearch(ES) there are no database and datatables. Instead there are indices and doctypes. Since version 5.0 of ES only one doctype per index is allowed, so that we can say our index equals the table in a normal relational database like mariadb.

Examples

get help

Code Block
java -jar $ODL_HOME/system/org/onap/ccsdk/features/sdnr/wt/sdnr-wt-data-provider-setup/0.7.1-SNAPSHOT/sdnr-dmt.jar
:
usage: SDNR DataMigrationTool
 -c,--cmd <arg>             command to execute
 -db,--dburl <arg>          database url
 -dbp,--db-password <arg>   database basic auth password
 -dbu,--db-username <arg>   database basic auth username
 -f,--force-recreate        delete if sth exists
 -if,--input-file <arg>     file to read from
 -k,--trust-insecure        trust insecure ssl certs
 -n,--silent                prevent console output
 -of,--output-file <arg>    file to write into
 -p,--prefix <arg>          prefix for db indices
 -r,--replicas <arg>        amount of replicas
 -s,--shards <arg>          amount of shards
 -v,--version <arg>         version
 -w,--wait <arg>            wait delay for yellow status
 -x,--verbose               verbose mode

Commands:
      init	initialize databse indices and aliases
    delete	clear database indices and aliases
pluginfile	create maven plugin file
    import	import data into database
    export	export data from database
      list	list release versions

init database  (for startODL.sh)

Code Block
java -jar $ODL_HOME/system/org/onap/ccsdk/features/sdnr/wt/sdnr-wt-data-provider-setup/0.7.1-SNAPSHOT/sdnr-dmt.jar -c init -db $SDNRDBURL -dbu $SDNRDBUSERNAME -dbp $SDNRDBPASSWORD

clear database

Code Block
java -jar $ODL_HOME/system/org/onap/ccsdk/features/sdnr/wt/sdnr-wt-data-provider-setup/0.7.1-SNAPSHOT/sdnr-dmt.jar -c delete -db $SDNRDBURL -dbu $SDNRDBUSERNAME -dbp $SDNRDBPASSWORD

import data

Code Block
java -jar $ODL_HOME/system/org/onap/ccsdk/features/sdnr/wt/sdnr-wt-data-provider-setup/0.7.1-SNAPSHOT/sdnr-dmt.jar -c import -db $SDNRDBURL -dbu $SDNRDBUSERNAME -dbp $SDNRDBPASSWORD -if filename

export data 

Code Block
java -jar $ODL_HOME/system/org/onap/ccsdk/features/sdnr/wt/sdnr-wt-data-provider-setup/0.7.1-SNAPSHOT/sdnr-dmt.jar -c export -db $SDNRDBURL -dbu $SDNRDBUSERNAME -dbp $SDNRDBPASSWORD -of filename

create unit test plugin file for elasticsearch-maven-plugin

Code Block
java -jar $ODL_HOME/system/org/onap/ccsdk/features/sdnr/wt/sdnr-wt-data-provider-setup/0.7.1-SNAPSHOT/sdnr-dmt.jar -c pluginfile -of filename