Jump to content
  • 0
Sign in to follow this  
randall421

Help with Redis DB

Question

Ive been running my server for a little while now and it runs fine but I been having an issue with Redis lately. It seems to hold the information perfectly while its running but if I have to stop it for any reason or reset my box then the information doesn't get stored and my server will get sent back days sometimes weeks. I thought I would fix this by writing a batch file that creates backups of the database every hour so this way we'd only lose an hour but it turns out its not writing any of this information to the dump.rdb file so even the backup will go back days/weeks. 

 

I ran the database while setting it up and it comes up "10 changes in 300 seconds... successfully..." I don't remember word for word but it was running like it was supposed to. I've read the files 100 times and can't see what could possibly be causing this. I have it on an ssd drive currently, I'm going to try moving it to my C:\ drive and see if that makes a difference but I was hoping someone here might have some insight on what's happening.

 

If anyone can point me in the right direction I'd really appreciate it. I'll copy my redis config contents here so you can see how I have it set exactly.

 

redis.conf

-------------------

bind 127.0.0.1
maxmemory 2gb
save 900 1
save 300 10
save 60 1000
requirepass mypassword
-----------------
 
server.ini
----------------
[Redis]
IP = 127.0.0.1
Port = 6379
DB = 0
Password = mypassword
-----------------
 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

if you notice here 

save 900 1
save 300 10
save 60 1000

 

what this means is if the redis db is written 1 time it will save every 900seconds, if 10 times every 300  and if 1000 every 1 minute.

 

you may want to change the 900 to 300 and 300 to 150 and see if this helps at all. ive done this in the past and it hasnt effected performance.

Share this post


Link to post
Share on other sites
  • 0

The below section is what I use to make manual backups of the database. I also forget how i did it but I have an automated backup that runs as a service and backs up the redis every hour. I believe it has to do with running this particular file at a certain time frame. You can google how to setup a service and figure it out from there. Copy and paste the section below into notepad, edit what needs editing and save it as yourfilenamehere.cmd inside of your database folder.

:::::::::::::: CONFIG ::::::::::::::::::
 
:::: Set your Arma3 Server base installation directory below.
set arma3srvpath=Your full Arma 3 server path goes here, don't forget the / at the end.
 
:::: Set your Redis Password and IP below (found inside Redis.conf)
set Redispass=yourpassgoeshere
set RedisIP=127.0.0.1
 
::::::::::: ADVANCED CONFIG ::::::::::::
:: Don't touch anything below this point unless you know what your doing.
::::::::::::::::::::::::::::::::::::::::
:: Set Time and Date
SET _CUR_DATE=%DATE%
SET _CUR_TIME=%TIME%
::Setting date
FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET MONTH=%%b
FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET DAY=%%c
FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET YEAR=%%a
:: Setting Time
FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET HOUR=%%a
FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET MINUTE=%%b
SET FOLDER_NAME=%YEAR%-%MONTH%
SET BACKUP_FILE=Epoch-%YEAR%%MONTH%%DAY%_%HOUR%%MINUTE%.rdb
 
:: Forcesave Redis Database
redis-cli -h %RedisIP% -a %Redispass% save
 
::create folders
if exist "%arma3srvpath%\Database\DBbackups" goto createYDfolder
mkdir "%arma3srvpath%\Database\DBbackups"
:createYDfolder
if exist "%arma3srvpath%\Database\DBbackups\%FOLDER_NAME%" goto startbackup
mkdir "%arma3srvpath%\Database\DBbackups\%FOLDER_NAME%"
 
:startbackup
copy "%arma3srvpath%\Database\dump.rdb" "%arma3srvpath%\Database\DBbackups\%FOLDER_NAME%\%BACKUP_FILE%"
:: Done
 
exit

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...