Recovering a messed up installation - Start fresh / recreate default database

(Harry B) #1


While experimenting with foundatiodb, I ended up having to blow away the installation ( I had to reformat the drive with certain settings changed ). Since I didn’t care for the tiny amount of test data I had, I stopped the instances and deleted the data and logs directory.

I took me several tries of dpkg -r and reinstall of all packages to finally get a working system back. What should I have done to “recreate the default db”. Is there any documentation regarding this?



(A.J. Beamon) #2

If you delete all of your data files and then try to connect to the database, it should give you an error that looks like this:

The coordinator(s) have no record of this database. Either the coordinator
addresses are incorrect, the coordination state on those machines is missing, or
no database has been created.  (reachable)

At this point, you can reconfigure the database using the configure new command in fdbcli with your desired redundancy mode and storage engine:

> configure new single memory

In general, though, you should exercise caution when using configure new. It’s not much of an issue when you’re intentionally deleting a cluster, but running configure new in a cluster that hasn’t been configured will cause the processes in the cluster to delete all data files in their data directories. If a process is reusing an existing data directory, be sure to backup any files that you want to keep. Do not use configure new to fix a previously working cluster that reports itself missing unless you are certain any necessary data files are safe.

Note that running configure new in a cluster that is already configured doesn’t do any harm and instead prints an error:

ERROR: Database already exists! To change configuration, don't say `new'

This isn’t really documented currently, but there is a pull request to add some of this text to our documentation: