CPU, Memory, I/O 와 같은 시스템 정보는 orange.system이 수행합니다.
orange.system 확인
systemctl status orange.system
● orange.system.service - Orange system daemon
Loaded: loaded (/etc/systemd/system/orange.system.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-05-02 14:16:18 KST; 12min ago
Main PID: 909 (python3)
Tasks: 4 (limit: 37823)
Memory: 36.4M
CPU: 7.736s
CGroup: /system.slice/orange.system.service
└─909 /usr/bin/python3 /home/@server/system.py
May 02 14:29:04 theclient python3[909]: ret = app.redis.get(rkey)
May 02 14:29:04 theclient python3[909]: File "/home/orange/.local/lib/python3.10/site-packages/redis/commands/core.py", line 1830, in get
May 02 14:29:04 theclient python3[909]: return self.execute_command("GET", name)
May 02 14:29:04 theclient python3[909]: File "/home/orange/.local/lib/python3.10/site-packages/redis/client.py", line 542, in execute_command
May 02 14:29:04 theclient python3[909]: conn = self.connection or pool.get_connection(command_name, **options)
May 02 14:29:04 theclient python3[909]: File "/home/orange/.local/lib/python3.10/site-packages/redis/connection.py", line 1109, in get_connection
May 02 14:29:04 theclient python3[909]: connection.connect()
May 02 14:29:04 theclient python3[909]: File "/home/orange/.local/lib/python3.10/site-packages/redis/connection.py", line 282, in connect
May 02 14:29:04 theclient python3[909]: raise ConnectionError(self._error_message(e))
May 02 14:29:04 theclient python3[909]: redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused.
redis 서버 접속 불가이니 redis 서버 상태확인
root@theclient:/var/log/redis# systemctl status redis
× redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-05-02 14:16:20 KST; 23min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 1056 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd --daemonize no (code=exited, status=1/FAILURE)
Main PID: 1056 (code=exited, status=1/FAILURE)
CPU: 73ms
May 02 14:16:20 theclient systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 5.
May 02 14:16:20 theclient systemd[1]: Stopped Advanced key-value store.
May 02 14:16:20 theclient systemd[1]: redis-server.service: Start request repeated too quickly.
May 02 14:16:20 theclient systemd[1]: redis-server.service: Failed with result 'exit-code'.
May 02 14:16:20 theclient systemd[1]: Failed to start Advanced key-value store.
redis 서버 구동 직 후 종료된 원인을 파악하기 위해 redis log 확인
/var/log/redis
45978:M 29 Apr 2024 04:33:52.528 # Server initialized
45978:M 29 Apr 2024 04:33:52.528 # WARNING overcommit_memory is set to 0!
Background save may fail under low memory condition.
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or
run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
45978:M 29 Apr 2024 04:33:52.528 * Ready to accept connections
45978:signal-handler (1714612496) Received SIGTERM scheduling shutdown...
45978:M 02 May 2024 01:14:56.506 # User requested shutdown...
45978:M 02 May 2024 01:14:56.506 * Saving the final RDB snapshot before exiting.
45978:M 02 May 2024 01:14:56.507 * DB saved on disk
45978:M 02 May 2024 01:14:56.507 * Removing the pid file.
45978:M 02 May 2024 01:14:56.507 # Redis is now ready to exit, bye bye...
redis.conf의 수정된 무엇이 문제를 일으킨 것인데 변경된 부분이 무엇인지 확실하지 않아 잘 동작하는 서버의 redis.conf로 교체 후 정상 동작.
문제가 된 redis.conf는 /etc/redis/redis.conf.failed로 백업 받아 놓음.
redis 구동 확인
root@theclient:/etc/redis# systemctl status redis-server
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-05-02 15:03:00 KST; 4min 54s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 9566 (redis-server)
Status: "Ready to accept connections"
Tasks: 5 (limit: 37823)
Memory: 3.0M
CPU: 497ms
CGroup: /system.slice/redis-server.service
orange.system
root@theclient:/etc/redis# systemctl status orange.system
● orange.system.service - Orange system daemon
Loaded: loaded (/etc/systemd/system/orange.system.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-05-02 15:09:09 KST; 5s ago
Main PID: 11786 (python3)
Tasks: 4 (limit: 37823)
Memory: 32.5M
CPU: 366ms
CGroup: /system.slice/orange.system.service
└─11786 /usr/bin/python3 /home/@server/system.py
May 02 15:09:09 theclient systemd[1]: Started Orange system daemon.
CPU, Memory, I/O Chart 생성됨
*
그나저나 warning이 발생된 vm.overcommit_memory 가 뭘까요?
vm.overcommit에 대한 짧은 이야기 (brunch.co.kr)
읽어보니
그냥 시스템 기본 값 그대로 사용하겠습니다.
'Orange > 백서' 카테고리의 다른 글
[기업버전] The Client 매니저 (0) | 2023.09.05 |
---|---|
서버 하드웨어 산정 (0) | 2023.07.19 |
Agent ETW (0) | 2023.07.13 |
서버설치 2/2 매니저 서비스 설치 (0) | 2023.07.13 |
서버 설치 1/2 Linux 기본 설정 + Open source 5종세트 (1) | 2023.07.13 |