The error 'failed to restart redis service unit redis service not found' occurs when the system attempts to restart a Redis instance but is unable to locate the Redis service. The root cause of this error is that the Redis service may not have been installed on the system or it may have been uninstalled accidentally. Additionally, if the Redis service was renamed or moved to another location, it could also result in this error.
To resolve this error, you need to ensure that the Redis service is installed on your system. You can do this by running the command 'sudo apt-get install redis-server' on Ubuntu or Debian-based systems. On CentOS or Fedora-based systems, you can run the command 'sudo yum install redis' instead.
If the Redis service is already installed on your system, you can check its status using the command 'systemctl status redis.service'. If the service is not running, you can start it using the command 'sudo systemctl start redis.service'. If the service is running but still causing issues, you can try restarting the service by running the command 'sudo systemctl restart redis.service'.
If none of these solutions work, it's possible that the Redis service has been renamed or moved to another location. In this case, you will need to update the location of the Redis service in the system configuration files. Once you have identified the correct path, you can update the path in the configuration file and restart the Redis service.