mr-redis icon indicating copy to clipboard operation
mr-redis copied to clipboard

Support for redis.conf configuration file(s)

Open Dawodo opened this issue 8 years ago • 4 comments

Currently, the actual redis-server is run through the following command:

R.Cmd = exec.Command("./redis-server", "--port", fmt.Sprintf("%d", R.Port))

As far as I'm concerned, this will launch redis with the default settings (except for the specified port of course). It seems that this leads to redis running in "protected mode" which only allows access from the loopback device, rendering all instances secluded from the outside world.

Am I missing an integral step? A redis.conf seems essential for me to properly configure the instances.

Dawodo avatar Oct 03 '16 21:10 Dawodo

@Dawodo Could you try this change in your executor , re-compile and re-distribute it.

Or you could simply distribute older version of redis-server like 2.8 which will not enforce this.

    if isSlave {
        R.Cmd = exec.Command("./redis-server", "--protected-mode", "no", "--port", fmt.Sprintf("%d", R.Port), "--SlaveOf", IP, port)
    } else {
        R.Cmd = exec.Command("./redis-server", "--protected-mode", "no", "--port", fmt.Sprintf("%d", R.Port))
    }

dhilipkumars avatar Oct 04 '16 07:10 dhilipkumars

@dhilipkumars Yes, this should certainly work. However, I decided to modify the scheduler to simply serve a "redis.conf" artifact for each executor (identical to how the "redis-server" binary itself is distributed).

This has some limitations, too (e.g. changing the redis.conf requires restarting the framework), but it works well for me.

In case you like this approach, I can create a PR for it.

Dawodo avatar Oct 04 '16 09:10 Dawodo

Thanks thats a great idea. I would appreciate a PR. @Dawodo I'm currently implementing running redis docker containers directly avoids the need to distribute redis-binary. You should be able to specify docker image you want the executor to pull.

I'm checking if we could also send some 'CMD' along with configuration.

dhilipkumars avatar Oct 04 '16 09:10 dhilipkumars

Open for contribution

dhilipkumars avatar Jan 09 '17 04:01 dhilipkumars