Redis multiple instance share the same data?

808 views
Skip to first unread message

krish

unread,
Jul 13, 2010, 2:14:44 PM7/13/10
to Redis DB
I have 4 different redis instance running on multiple port on the same
computer. I am using redis 2.0.0 downloaded on Jul 12, 2010.

I am surprised to see that my data is duplicated to all the instances
which I never expected..

Here is the configuration file


daemonize no

pidfile /home/krish/stacked_db/redis_session.pid

port 6010

bind 127.0.0.1

timeout 300

loglevel notice

logfile /home/krish/stacked_db/redis-session-server.log

databases 16

save 1 1
save 1 10
save 1 10000

rdbcompression yes

dbfilename redis_session.rdb

dir /home/krish/stacked_db


appendonly yes


appendfsync always
# appendfsync everysec
# appendfsync no

glueoutputbuf yes

#shareobjects no
#shareobjectspoolsize 1024


*************************************

All the database are stored in the same directory. I think, there
could be issues with appendonly log file which could have been read by
all the database. I will verify with different directory and I report
to you..

Mason Jones

unread,
Jul 13, 2010, 2:47:03 PM7/13/10
to redi...@googlegroups.com
Just to be clear, when you say "here is the configuration file" do you
mean that all of the instances are using the same configuration file?
Naturally, if you want them to be individual instances, you need to
have a separate configuration file for each, specifying different
dbfilename and appendonly file names.

> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>

krish

unread,
Jul 13, 2010, 2:52:42 PM7/13/10
to Redis DB
I may be ignorant where I could have not understood redis
configuration..

As of now, I can confirm that when multiple instances shares the same
directory for the database, the data is duplicated over many redis
instances.
Probably we need to mentioned the appendonly log file name so that we
can different name for appendonly log file.. Anyone knows how to this?

Or Am I missing something?

--
Krish
http://www.stacked.in
(an news aggregator for written for
myself by me. Its fully backed by Redis)

krish

unread,
Jul 13, 2010, 2:54:05 PM7/13/10
to Redis DB
I am using different configuration files for each redis instance..
only the dbname and port would vary..otherwise configuration is
similar



On Jul 13, 11:47 pm, Mason Jones <masono...@gmail.com> wrote:
> Just to be clear, when you say "here is the configuration file" do you
> mean that all of the instances are using the same configuration file?
> Naturally, if you want them to be individual instances, you need to
> have a separate configuration file for each, specifying different
> dbfilename and appendonly file names.
>

krish

unread,
Jul 13, 2010, 3:00:27 PM7/13/10
to Redis DB
Hi Mason,

Do you know how to mention the appendonly file name? All I could see
is appendonly yes which enable the appendonly file..

Regards,

Krish

On Jul 13, 11:47 pm, Mason Jones <masono...@gmail.com> wrote:
> Just to be clear, when you say "here is the configuration file" do you
> mean that all of the instances are using the same configuration file?
> Naturally, if you want them to be individual instances, you need to
> have a separate configuration file for each, specifying different
> dbfilename and appendonly file names.
>

Pieter Noordhuis

unread,
Jul 13, 2010, 9:46:21 PM7/13/10
to redi...@googlegroups.com
Although a common best practice is to give every Redis instance its
own directory (which I highly recommend), you can use "appendfilename"
(which is documented in the example redis.conf) to configure the AOF
name.

Cheers,
Pieter

Reply all
Reply to author
Forward
0 new messages