๐ database6 [MQTT] message๋ฅผ ์๋ณด๋ด๋๋ฐ ๊ณ์ message๊ฐ ์์ด๋ issue ์ฌ์ค ์ด๊ฑด ๋ฌธ์ ๊น์ง๋ ์๋๊ณ , ์ข ๋ ์์ธํ๊ฒ ์๊ณ ์ถ์๋ค. ์ ๋ฒ ํฌ์คํ ์์๋ mqtt explorer ์ ์ฐ๊ฒฐ์ ํ๋ค. [MQTT] mqtt client์ connect ์๋๋ ๋ฌธ์ ec2 instance๋ฅผ ์์ฑํ๊ณ mosquitto๋ฅผ ์คํ์์ผฐ๋ค. ๊ทธ๋ฆฌ๊ณ mqtt connection tool๋ฅผ ์ฌ์ฉํ์ฌ ์ฐ๊ฒฐ์ ์๋ํ๋, ์ฐ๊ฒฐ์ด ๋ถ๊ฐ๋ฅํ๋ค Starting in local only mode. Connections will only possible from clients running on this machine. bonory.tistory.com ์ฐ๊ฒฐ์ ํ๊ณ ๋ณด๋, ๋ ์ฐ๊ฒฐ๋ง ํ๊ณ ์๋ฌด ๊ฒ๋ ์ํ๋๋ฐ ?! ์๊พธ ๋ช์ด ๊ฐ๊ฒฉ์ผ๋ก message๊ฐ ์์ด๋ ๊ฒ ์ฒ๋ผ ์ซ์๊ฐ ๊ณ์ ๋์ด๋ฌ๋ค. ๋ญ์ง ??????? ํ๋ฒ .. 2024. 3. 7. [MQTT] mqtt client์ connect ์๋๋ ๋ฌธ์ ec2 instance๋ฅผ ์์ฑํ๊ณ mosquitto๋ฅผ ์คํ์์ผฐ๋ค. ๊ทธ๋ฆฌ๊ณ mqtt connection tool๋ฅผ ์ฌ์ฉํ์ฌ ์ฐ๊ฒฐ์ ์๋ํ๋, ์ฐ๊ฒฐ์ด ๋ถ๊ฐ๋ฅํ๋ค Starting in local only mode. Connections will only possible from clients running on this machine. ๋ก์ปฌ ๋ชจ๋์์๋ง ๊ฐ๋ฅํ๋ฉฐ Create a configuration file which defines a listener to allow remote access. ์๊ฒฉ ์์ธ์ค๋ฅผ config๋ฅผ create ํ๋ผ๊ณ ํ๋ ๊ฒ ๊ฐ๋ค ์ฒซ๋ฒ์งธ, mosquitto config๋ฅผ ์์ ํ๋ค. linux๋ผ๋ฉด /etc/mosquitto/mosquitto.conf ์ ์์นํ๋ค. ์ด๋ ๊ฒ ์ค์ ๋์ด์๋๋ฐ.. 2024. 3. 6. [Redis] Redis์ ๋ํ ๊ฐ๋จํ ์ ๋ฆฌ โ Redis ? Remote Dictionary Server์ ์ฝ์ * Remote : Redis๊ฐ ๊ฐ๊ฐ์ ์๋ฒ ์์ ๋ก์ปฌํ๊ฒ ์กด์ฌํ์ง ์๊ณ , ๋ค์์ ์๋ฒ์์ ๊ณตํต์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋๋ก ์๊ฒฉ์ ์กด์ฌ * Dictionary : ํด์๋งต๊ณผ ๊ฐ์ด key-value ํํ๋ก ์์์ ์๊ฐ ๋ณต์ก๋๋ก ์ฌ์ฉ์ด ๊ฐ๋ฅ Redis๋ ํ์ค C๋ก ์์ฑ๋ ์คํ์์ค ์ธ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ ์ ์ฅ์์ด๋ค. * ์ธ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ ์ ์ฅ์ : ๋ฐฑ์ ์ ์ ์ธํ ๋ชจ๋ ๋ฐ์ดํฐ๋ฅผ ๋จ์ ์ ์ฅํ๋ค. ์ผ๋ฐ์ ์ผ๋ก ๋จ์ ๋์คํฌ์ ๋นํด ๋งค์ฐ ๋น ๋ฅด๊ธฐ ๋๋ฌธ์ Redis๋ ๊ธฐ๋ณธ์ ์ธ ๊ด๊ณํ ๋ฐ์ดํฐ ๋ฒ ์ด์ค์ ๋ค๋ฅธ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๊ณ ์๋ค. โ ํน์ง 1. In-Memory : ๋ชจ๋ ๋ฐ์ดํฐ๋ฅผ ๋จ์ ์ ์ฅ 2. Single Thread 3. Cluster Mode : ๋ค์ค ๋ ธ๋์ ๋ฐ์ดํฐ๋ฅผ.. 2023. 12. 4. [Flower] Monitoring Celery Tasks using Flower โ Flower ? Flower๋ Celery cluster๋ฅผ ๋ชจ๋ํฐ๋งํ๊ณ ๊ด๋ฆฌํ๊ธฐ ์ํ web ๊ธฐ๋ฐ tool์ด๋ค. 1๏ธโฃ ์์ celery์ task๋ฅผ ํ์ธํด์ผ ํ๋, ์๋ ๋งํฌ๋ฅผ ํตํด celery๋ฅผ ์คํํ๋ค. [Celery] Celery with Redis (python) : ๋น๋๊ธฐ ์์ queue โ Celery ? celery๋ ๋ถ์ฐ ๋ฉ์์ง ์ ๋ฌ์ ๊ธฐ๋ฐ์ ๋ ์คํ ์์ค ๋น๋๊ธฐ ํ ์คํฌ ํ, ์ก ํ์ด๋ค. ์ค์ผ์ค๋ง์ ์ง์ํ์ง๋ง ์ค์๊ฐ ์ด์์ ์ด์ ์ ๋๊ณ ์๋ค. 1๏ธโฃ ์์ redis๊ฐ ์คํ๋์ด ์์ด์ผ ํ๋ค. (์๋ bonory.tistory.com 2๏ธโฃ ์คํ celery๊ฐ ์ค์น๋์ด ์๊ณ , ์คํ ๊ฐ๋ฅํ ํ๊ฒฝ์ด๋ฉด ๋ณ๋์ ์ค์น์์ด ์๋์ ๋ช ๋ น์ด๋ก ๋ฐ๋ก ์ฌ์ฉ ๊ฐ๋ฅํ๋ค. python3 -m celery -A .. 2022. 6. 20. [Celery] Celery with Redis (python) : ๋น๋๊ธฐ ์์ queue โ Celery ? celery๋ ๋ถ์ฐ ๋ฉ์์ง ์ ๋ฌ์ ๊ธฐ๋ฐ์ ๋ ์คํ ์์ค ๋น๋๊ธฐ ํ ์คํฌ ํ, ์ก ํ์ด๋ค. ์ค์ผ์ค๋ง์ ์ง์ํ์ง๋ง ์ค์๊ฐ ์ด์์ ์ด์ ์ ๋๊ณ ์๋ค. 1๏ธโฃ ์์ redis๊ฐ ์คํ๋์ด ์์ด์ผ ํ๋ค. (์๋ ๋งํฌ ์ฐธ๊ณ ) [Redis] redis๋ฅผ ์์ํ๋ ๊ฐ๋จํ ๋ฐฉ๋ฒ 2๊ฐ์ง (docker/source download) โ Redis ? Remote Dictionary Server์ ์ฝ์๋ก์, "ํค-๊ฐ" ๊ตฌ์กฐ์ ๋น์ ํ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๊ณ ๊ด๋ฆฌํ๊ธฐ ์ํ ์คํ ์์ค ๊ธฐ๋ฐ์ ๋น๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ด๋ฆฌ ์์คํ ์ด๋ค. 1๏ธโฃ Docker ๋ฅผ ํ์ฉํ๋ ๋ฐฉ๋ฒ ์์ bonory.tistory.com 2๏ธโฃ ์ค์น pip3 install celery 3๏ธโฃ ์คํ tasks.py from celery import Cel.. 2022. 6. 6. [Redis] redis๋ฅผ ์์ํ๋ ๊ฐ๋จํ ๋ฐฉ๋ฒ 2๊ฐ์ง (docker/source download) โ Redis ? Remote Dictionary Server์ ์ฝ์๋ก์, "ํค-๊ฐ" ๊ตฌ์กฐ์ ๋น์ ํ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๊ณ ๊ด๋ฆฌํ๊ธฐ ์ํ ์คํ ์์ค ๊ธฐ๋ฐ์ ๋น๊ด๊ณํ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ด๋ฆฌ ์์คํ ์ด๋ค. 1๏ธโฃ Docker ๋ฅผ ํ์ฉํ๋ ๋ฐฉ๋ฒ ์์ํ๊ธฐ์ ์์ docker๊ฐ ์ค์น๋์ด ์์ด์ผ ํ๋ค. (์๋ ๋งํฌ๋ก ์ ์ํ์ฌ ์ค์น) Docker Documentation docs.docker.com ํฐ๋ฏธ๋(ํน์ iterm)์์ ์๋ ๋ช ๋ น์ด๋ฅผ ์คํํ๋ค. docker run -p 6379:6379 redis ์ฑ๊ณต์ ์ผ๋ก ์คํ์ด ๋์์ ๊ฒฝ์ฐ, ๋ค์๊ณผ ๊ฐ์ด ํ์ธํ ์ ์๋ค. Docker์์ redis Container๊ฐ ์์ฑ๋จ์ ํ์ธํ ์ ์๋ค. ์ ์์ ์ผ๋ก ์ฐ๊ฒฐ๋์๋์ง ํ์ธํ๊ธฐ ์ํด์ vscode์์ ํ์ธํด๋ณด์๋ค. def check_co.. 2022. 6. 6. ์ด์ 1 ๋ค์