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

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)

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

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

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 

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

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




  • No labels

1 Comment

  1. CCSDK-2351 - Getting issue details... STATUS  Please update based on the fix provided.