Setting up Redis
16 min
you will have to setup redis if you want to use the chat service in neurons for itsm all the different setup scenarios are explained below if you have installed redis but not using the chat service, you might consider uninstalling it to uninstall refer to the section uninstall redis docid\ jesyepqejqg8ludcl knh different install and uninstall options and scenarios upgrading/installing redis for existing/new customer installing redis in linux container on windows docid\ jesyepqejqg8ludcl knhinstalling linux container on windows server with docker docid\ jesyepqejqg8ludcl knhinstalling redis 6 2 5 in docker docid\ jesyepqejqg8ludcl knhinstalling redis on linux machine docid\ jesyepqejqg8ludcl knhinstalling redis on linux machine (ubuntu) docid\ jesyepqejqg8ludcl knhestablish the remote redis connection docid\ jesyepqejqg8ludcl knhinstall redis on windows using wsl2 docid\ jesyepqejqg8ludcl knhuninstalling redis from windows server (existing customer) docid\ jesyepqejqg8ludcl knhremote redis connection using redis bat script docid\ jesyepqejqg8ludcl knhremote redis connection from windows ui docid\ jesyepqejqg8ludcl knhremote redis connection using redis server exe docid\ jesyepqejqg8ludcl knhuninstalling from linux container docid\ jesyepqejqg8ludcl knhuninstall from linux machine docid\ jesyepqejqg8ludcl knh option 1 – install redis in linux container on windows server prerequisite windows server version 2019 or above with hyperv enabled for more information on linux container requirements check out windows container requirements https //learn microsoft com/en us/virtualization/windowscontainers/deploy containers/system requirements for upgrading your windows servers, check out this windows server upgrade guide https //learn microsoft com/en us/windows server/get started/upgrade overview#which version of windows server should i upgrade to and look for target version you need to upgrade installation steps installing linux container with docker on windows server open powershell as administrator and run the following command install module name dockermsftprovider repository psgallery force this installs the docker microsoft packagemanagement provider sample output install the preview build of docker ee and run the following commands install module dockerprovider install package docker providername dockerprovider requiredversion preview use “yes” or “y” to agree to install or use “a” to agree to all when the installation is complete, reboot the system to run linux containers, enable linuxkit system and use the following command \[environment] \ setenvironmentvariable ("lcow supported", "1", "machine") use the following command to restart the system/docker service after the change restart service docker the linux container should now successfully run on your windows server for more information, refer how to run docker containers on windows server 2019 https //computingforgeeks com/how to run docker containers on windows server 2019 installing redis 6 2 5 in docker open powershell as administrator and run the following command docker run d p 6379 6379 name redis con redis 6 2 5 check if it has successfully installed by executing the command docker ps best practices run the command docker update restart always redis con to always restart redis container whenever the docker/machine is restarted if this is not enabled you have to enable redis container manually everytime the docker/machine is restarted enable authentication for redis refer, add authentication to redis setting up redis authentication add auth to redis server open powershell and run the command docker exec it redis con sh this will give you redis console run redis cli to set password to redis server run this command to set redis password redis cli config set requirepass \<your password> your password is successfully set now to test run the command redis cli auth \<your password>” it should return “ok set the password through scw for the application to authenticate through redis password in step 2 of scw configuration (service and asset manager settings) in the field redis auth password , enter the same password that is set in the redis cli , and save it once docker/redis server/machine is restarted , the auth will be set back to noauth, sensure to remember and update the password to redis server every time restarted option 2 – install redis on linux machine prerequisite ubuntu 16 04 or above steps to install execute the following commands sudo apt update sudo apt install redis server check if redis is set up using the following command sudo systemctl status redis if the result displays as active active (running) then redis is successfully setup edit the redis conf file to make redis port available to other servers (by default, the redis port is on 6379 ) “ sudo gedit /etc/redis/redis conf ” or “ sudo nano /etc/redis/redis conf ” check for the line “ bind 127 0 0 1 ” comment this line by prepending ‘ # ’ since you have removed binding, it is highly recommended to add authentication to redis server edit redi conf “sudo gedit /etc/redis/redis conf” search for requirepass foobared, replace foobared with your passowrd restart the redis server to apply changes “sudo systemctl restart redis service” then follow “remote redis connection” and “set password through scw for the application to authenticate through redis password ” option 3 – install redis on windows using wsl2 this procedure describes how to install redis on windows by using windows subsystem for linux (wsl) redis is installed inside a linux environment, which runs on windows through wsl this method is supported on windows 10, windows 11, and windows server 2019 or later to install redis on windows, enable wsl2 (windows subsystem for linux) wsl2 lets you run linux binaries natively on windows prerequisites windows 10, windows 11, or windows server 2019/2022 steps to enable wsl for windows 10, windows 11, or windows server 2022 open powershell or command prompt as an administrator run the following command wsl install restart the system when prompted the wsl install command installs the wsl feature and sets ubuntu as the default linux distribution for windows server 2019 (version 1709 and later) open powershell as an administrator run the following command enable windowsoptionalfeature online featurename microsoft windows subsystem linux restart your computer when prompted download a linux distribution from the microsoft wsl store " https //aka ms/wslstore " download the latest ubuntu from the following link "manual installation steps for older versions of wsl | microsoft learn" open powershell, install the downloaded distribution using the following command curl exe l o ubuntu 2004 appx https //aka ms/wslubuntu2004 replace app name appx with the actual file name of the downloaded package add appxpackage \ ubuntu 2004 appx this installs linux on your computer steps to install redis open the installed linux distribution (for example, ubuntu) from the start menu update the package list and install redis curl fssl https //packages redis io/gpg | sudo gpg dearmor o /usr/share/keyrings/redis archive keyring gpg echo "deb \[signed by=/usr/share/keyrings/redis archive keyring gpg] https //packages redis io/deb $(lsb release cs) main" | sudo tee /etc/apt/sources list d/redis list sudo apt get update sudo apt get install redis start the redis server sudo service redis server start verify that redis is running redis cli ping if redis is running correctly, the response will be pong establish the remote redis connection edit the env file in the path “ \<install path>\heat\appserver\chat\\ env ” edit the attribute redis host=localhost to redis host=\<remote server ip> save the file this will install redis successfully check if redis is up by using the command sudo systemctl status redis” – you should see the active (running status) uninstall redis for windows server (existing customer) this is a mandatory step for existing customers who have already installed redis and are upgrading to the new version uninstall the obsolete redis version from your machine by following the below server details and uninstall steps redis server details version 3 0 503 path \<install path>\heat\appserver\appserver main\redis project https //github com/microsoftarchive/redis https //github com/microsoftarchive/redis license https //github com/microsoftarchive/redis/blob/3 0/license txt https //github com/microsoftarchive/redis/blob/3 0/license txt option 1 – uninstall using redis bat script run the following in powershell with administrator privileges cd \<install path>\heat\appserver\appserver main\redis; \redis bat p $(pwd) c stop optional step cleanup redis installation files by using the below command \redis bat p $(pwd) c cleanup option 2 – uninstall from windows ui run the following in powershell with administrator privileges run services msc locate redis in the list and stop the service right click > properties , change startup type to disabled option 3 – uninstall using redis server exe stop the service run the following in powershell with administrator privileges \redis server exe service stop uninstall service run the following in powershell with administrator privileges \redis server exe service uninstall redis windows conf uninstall redis if you do not want to use the chat service, you may uninstall redis by the following the below steps option 1 – uninstall redis in container execute the following command docker rm /redis con option 2 – uninstall redis in linux machine for ubuntu distributions \# if you use apt get to install redis then use sudo apt get purge auto remove redis server \# if you compiled redis manually then follow the \# steps below to remove it completely from linux/ubuntu sudo service redis version stop \# now delete everything related to redis server from /usr/local/bin/ sudo rm /usr/local/bin/redis \# now delete redis configuration files directory and it’s content sudo rm r /etc/redis/ \# delete existing redis log files sudo rm /var/log/redis \# delete existing redis data directory and it’s content sudo rm r /var/lib/redis/ \# delete existing redis server init scripts sudo rm /etc/init d/redis \# remove existing redis pid files (only if exists) sudo rm /var/run/redis
