From fd1a77628e4e7f1b1219621ebbf9ca8eb927dd13 Mon Sep 17 00:00:00 2001 From: Daniel Eisenberg Date: Thu, 5 Oct 2023 15:16:58 +0300 Subject: [PATCH] add cache conf file --- nodes/agent_cache/package/CMakeLists.txt | 6 ------ nodes/agent_cache/package/cache.conf | 6 ++++++ nodes/agent_cache/package/install-cp-nano-agent-cache.sh | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100755 nodes/agent_cache/package/cache.conf diff --git a/nodes/agent_cache/package/CMakeLists.txt b/nodes/agent_cache/package/CMakeLists.txt index e2750f5..a4c1246 100755 --- a/nodes/agent_cache/package/CMakeLists.txt +++ b/nodes/agent_cache/package/CMakeLists.txt @@ -1,9 +1,3 @@ -execute_process ( - COMMAND sh -c "find / -name \"redis.conf\"" - OUTPUT_VARIABLE redis_conf_path - OUTPUT_STRIP_TRAILING_WHITESPACE -) - execute_process ( COMMAND sh -c "which redis-server" OUTPUT_VARIABLE redis_server_path diff --git a/nodes/agent_cache/package/cache.conf b/nodes/agent_cache/package/cache.conf new file mode 100755 index 0000000..9b6b271 --- /dev/null +++ b/nodes/agent_cache/package/cache.conf @@ -0,0 +1,6 @@ +bind 127.0.0.1 +port 6379 +appendonly no +save "" +maxmemory 500mb +maxmemory-policy allkeys-lru \ No newline at end of file diff --git a/nodes/agent_cache/package/install-cp-nano-agent-cache.sh b/nodes/agent_cache/package/install-cp-nano-agent-cache.sh index 6e8822d..8a13326 100755 --- a/nodes/agent_cache/package/install-cp-nano-agent-cache.sh +++ b/nodes/agent_cache/package/install-cp-nano-agent-cache.sh @@ -52,13 +52,14 @@ run_installation() cp_exec "cp -rf lib/* ${USR_LIB_PATH}/cpnano" cp_exec "cp -rf bin/redis-server ${CACHE_SERVICE_PATH}/" cp_exec "cp -rf bin/redis-cli ${CACHE_SERVICE_PATH}/" - cp_exec "cp -f redis.conf ${CONF_PATH}/redis.conf" cp_exec "cp -f cp-nano-agent-cache.cfg ${CACHE_SERVICE_PATH}/cp-nano-agent-cache.cfg" + cp_exec "cp -f cache.conf ${CONF_PATH}/redis.conf" cp_exec "mv ${CACHE_SERVICE_PATH}/redis-server ${CACHE_SERVICE_PATH}/cp-nano-agent-cache" cp_exec "mv ${CACHE_SERVICE_PATH}/redis-cli ${CACHE_SERVICE_PATH}/cp-nano-cache-cli" cp_exec "chmod +x ${CACHE_SERVICE_PATH}/cp-nano-agent-cache" cp_exec "chmod +x ${CACHE_SERVICE_PATH}/cp-nano-cache-cli" cp_exec "chmod 600 ${CACHE_SERVICE_PATH}/cp-nano-agent-cache.cfg" + cp_exec "chmod 600 ${CONF_PATH}/redis.conf" cp_exec "${WATCHDOG_PATH} --register ${CACHE_SERVICE_PATH}/cp-nano-agent-cache" cp_print "Installation completed successfully." $FORCE_STDOUT