Browse Source

Fix redis installation in debian jessie

hotfix/v3.3.14
Prabuddha Chakraborty 9 years ago
parent
commit
2674d093bd
  1. 20
      ee/cli/plugins/stack.py

20
ee/cli/plugins/stack.py

@ -1817,24 +1817,20 @@ class EEStackController(CementBaseController):
if EEVariables.ee_ram < 512:
Log.debug(self, "Setting maxmemory variable to {0} in redis.conf"
.format(int(EEVariables.ee_ram*1024*1024*0.1)))
EEFileUtils.searchreplace(self, "/etc/redis/redis.conf",
"# maxmemory <bytes>",
"maxmemory {0}".format(int(EEVariables.ee_ram*1024*1024*0.1)))
EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory <bytes>/maxmemory {0}/' /etc/redis/redis.conf"
.format(int(EEVariables.ee_ram*1024*1024*0.1)))
Log.debug(self, "Setting maxmemory-policy variable to volatile-lru in redis.conf")
EEFileUtils.searchreplace(self, "/etc/redis/redis.conf",
"# maxmemory-policy volatile-lru",
"maxmemory-policy volatile-lru")
EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory-policy.*/maxmemory-policy volatile-lru/' "
"/etc/redis/redis.conf")
EEService.restart_service(self, 'redis-server')
else:
Log.debug(self, "Setting maxmemory variable to {0} in redis.conf"
.format(int(EEVariables.ee_ram*1024*1024*0.2)))
EEFileUtils.searchreplace(self, "/etc/redis/redis.conf",
"# maxmemory <bytes>",
"maxmemory {0}".format(int(EEVariables.ee_ram*1024*1024*0.2)))
EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory <bytes>/maxmemory {0}/' /etc/redis/redis.conf"
.format(int(EEVariables.ee_ram*1024*1024*0.2)))
Log.debug(self, "Setting maxmemory-policy variable to volatile-lru in redis.conf")
EEFileUtils.searchreplace(self, "/etc/redis/redis.conf",
"# maxmemory-policy volatile-lru",
"maxmemory-policy volatile-lru")
EEShellExec.cmd_exec(self, "sed -i 's/# maxmemory-policy.*/maxmemory-policy volatile-lru/' "
"/etc/redis/redis.conf")
EEService.restart_service(self, 'redis-server')
if disp_msg:
if len(self.msg):

Loading…
Cancel
Save