redis support / convert sqlite db

fgr
Member
 
Posts: 85
Joined: Mon Sep 17, 2012 08:22

redis support / convert sqlite db

by fgr » Tue May 27, 2014 12:03

Hi,

its nice we get more and more new backend db's supported with minetest. One question come up in my mind: "how do i convert an existing sqlite3 db to the redis db? Is there any hint how this could be performed somehow?

TIA
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: redis support / convert sqlite db

by sfan5 » Tue May 27, 2014 12:08

1) Set the connections settings in world.mt
2) run minetestserver --migrate redis --world /path/to/world/directory/
3) Done!

This is the same for converting to other backends except that you don't need connection settings for sqlite3 or leveldb.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

fgr
Member
 
Posts: 85
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Tue May 27, 2014 12:19

this argument will drop all sqlite3 contents to the new redis db?
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: redis support / convert sqlite db

by sfan5 » Tue May 27, 2014 12:22

fgr wrote:this argument will drop all sqlite3 contents to the new redis db?

It will copy all MapBlocks (16x16x16 cubes of nodes) into the redis database and also update the backend setting in world.mt. The sqlite3 database will still be present but can then be deleted.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

fgr
Member
 
Posts: 85
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Tue May 27, 2014 12:54

thanks, will give it a try ... for performance tests.
 

fgr
Member
 
Posts: 85
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Tue May 27, 2014 15:48

One question I have to the db contents on redis. How do you get persistence to work in case the server crashes? Will the hash entries be lost instead stored at the latest action within minetest?
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

Re: redis support / convert sqlite db

by cHyper » Tue May 27, 2014 15:49

What are the main advantages of the new DB system?
 

fgr
Member
 
Posts: 85
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Tue May 27, 2014 17:31

ignore my inputs prior:

the solution is to add all the information to the world.mt file like this:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
backend = sqlite3
redis_address = localhost
redis_port = 6379
redis_hash = minetest_pub


then use the command to start minestserver for migrate to redis

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
./minetestserver --migrate redis


take a coffee and wait til it ends. ;)

Update: the migration process gives a core dump...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
20:43:37: ACTION[main]: Migrated 1225500 blocks 53.8197% completed
Segmentation fault (core dumped)

debug:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000527ea9 in Database_Redis::saveBlock(MapBlock*) ()
(gdb) bt
#0  0x0000000000527ea9 in Database_Redis::saveBlock(MapBlock*) ()
#1  0x000000000045da43 in main ()
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 14 guests

cron