Jump to content
  • 0

Help with Redis DB


randall421

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
-----------------
 
Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...