0

I have designed an app in django using django channels with redis servers for websocket communication, but I have to host it on a windows server. I can run the redis server locally on my windows machine and it works well for testing on my localhost. I want to know if I can do the same for a windows server. Can I and how do I run redis servers for that application. Is there any alternative to this? The other answers that I've found are out-dated, and are about running redis on the local machine.

I am adding some details of my code as to how I'm using my redis servers for real time websockets communication.

CHANNEL_LAYERS = {
    'default': {
        'BACKEND': 'channels_redis.core.RedisChannelLayer',
        'CONFIG': {
            "hosts": [('peaceful-dusk-14195.herokuapp.com', 6379), ('127.0.0.1', 6379)],
        },
    },
}

I have installed channels-redis module for django to use the configurations of redis servers, as taught in the tutorials of the django channels documentation.

Now this code works perfectly if I run the redis server on my local machine. But since redis is a linux based server, I am having problems with hosting it on windows server. I have used the server.c file from this code inside the src folder to run my redis server: Download Redis 6.0.9

I run the C program in my Windows Subsystem for Linux (wsl) and the redis server becomes active. This is done in my testing environment.

Now my question is, can I do the same for the windows server where I will be hosting the application. Will I have to reconfigure something in my server to run the redis servers, or can I simply run the windows server without any modifications?

Rohan
  • 13
  • 5
  • i would suggest looking into using docker to run reddis (for local dev) and for prod you should just be running it all on linux (including channels, the asyncIO python subsystem is not prod stable on windows) – Matthaus Woolard Dec 11 '20 at 21:46
  • 1
    as per https://redis.io/topics/introduction it's not officially supported by Windows. I've compiled the official sources and started the server on Windows Subsystem for Linux (WSL) on my dev machine. and ran perfectly as Localhost service on port 6379 (or whatever you chose) . However, I'm not sure if it's a good idea for production environments. – Assem Dec 13 '20 at 16:01
  • The company that I am developing the app for has windows server for all of their app deployments and so, I have to host the app of windows server as well. If not redis, then is there another option to run my channels part? WSL is what I used for testing my app on my dev machine. – Rohan Dec 14 '20 at 10:39

2 Answers2

0

The Redis docs state the following:

Redis is not officially supported on Windows. However, you can install Redis on Windows for development by following the instructions below.

View the instructions to run it as a development server.

Aage
  • 5,932
  • 2
  • 32
  • 57
-1

As far as I know you can use Redis for Windows alternatives, such as Memurai.

It is fully Redis compatible. You can replicate data between Memurai and Redis.

Dharman
  • 30,962
  • 25
  • 85
  • 135