romana / core

Romana core components - Micro services written in Go.
Apache License 2.0
47 stars 11 forks source link

Agent port from POC and attendant REST services changes #9

Closed debedb closed 8 years ago

debedb commented 8 years ago

Agent port from POC and attendant REST services changes.

jbrendel commented 8 years ago

Please do a search and replace for all occurrences of 'pani' or 'Pani' and do the replace with 'romana' or 'Romana'.

flashvoid commented 8 years ago

Hey Greg, this one is for you. Trying to create a schema, database credentials configured in root service

Database topology doesn't exist - creating schema

$ ./topology/topology -createSchema -rootUrl http://localhost:9600
.... all good ....
2015/11/30 01:49:44 In setConfig()
2015/11/30 01:49:44 in createSchema( false )
2015/11/30 01:49:44 in connect( root:secrete@tcp(localhost:3306)/topology )
panic: Error 1049: Unknown database 'topology'
.... panic ....

Trying to overwrite schema

$ ./topology/topology -overwriteSchema -rootUrl http://localhost:9600
... all good ...
2015/11/30 01:51:58 In setConfig()
2015/11/30 01:51:58 in createSchema( true )
2015/11/30 01:51:58 in connect( root:secrete@tcp(localhost:3306)/topology )
panic: Error 1049: Unknown database 'topology'
... panic ...

Creating database manually

$ mysql -e "create database topology"
$ ./topology/topology -createSchema -rootUrl http://localhost:9600
...
2015/11/30 01:52:58 In setConfig()
2015/11/30 01:52:58 in createSchema( false )
2015/11/30 01:52:58 in connect( root:secrete@tcp(localhost:3306)/topology )
panic: Error 1007: Can't create database 'topology'; database exists
...

So if database doesn't exist it's an error, if it exists already then it an error.