From f678db23a00a21afb20ba4fde43b76ebdb073ca5 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Tue, 20 Aug 2024 13:52:07 +0300 Subject: [PATCH] vault backup: 2024-08-20 13:52:07 --- .obsidian/plugins/home-tab/data.json | 6 +-- .../plugins/recent-files-obsidian/data.json | 4 -- .../Pasted image 20240820133224.png | Bin _inbox/Кластер RabbitMQ.md | 42 +++++++++++++++++- 4 files changed, 42 insertions(+), 10 deletions(-) rename {meta/files => .trash}/Pasted image 20240820133224.png (100%) diff --git a/.obsidian/plugins/home-tab/data.json b/.obsidian/plugins/home-tab/data.json index a4210884..dbabfc0b 100644 --- a/.obsidian/plugins/home-tab/data.json +++ b/.obsidian/plugins/home-tab/data.json @@ -25,7 +25,7 @@ "recentFilesStore": [ { "filepath": "_inbox/Кластер RabbitMQ.md", - "timestamp": 1724149751131 + "timestamp": 1724151081888 }, { "filepath": "_inbox/00 RabbitMQ.md", @@ -38,10 +38,6 @@ { "filepath": "Home.md", "timestamp": 1724137322406 - }, - { - "filepath": "_inbox/Уроки от English Galaxy.md", - "timestamp": 1724137321122 } ], "bookmarkedFileStore": [], diff --git a/.obsidian/plugins/recent-files-obsidian/data.json b/.obsidian/plugins/recent-files-obsidian/data.json index 688a3921..d07fca09 100644 --- a/.obsidian/plugins/recent-files-obsidian/data.json +++ b/.obsidian/plugins/recent-files-obsidian/data.json @@ -195,10 +195,6 @@ { "basename": "Вопросы работодателю", "path": "notes/Собеседования/Вопросы работодателю.md" - }, - { - "basename": "Собеседование на работу с HR", - "path": "_inbox/Собеседование на работу с HR.md" } ], "omittedPaths": [], diff --git a/meta/files/Pasted image 20240820133224.png b/.trash/Pasted image 20240820133224.png similarity index 100% rename from meta/files/Pasted image 20240820133224.png rename to .trash/Pasted image 20240820133224.png diff --git a/_inbox/Кластер RabbitMQ.md b/_inbox/Кластер RabbitMQ.md index c98e6af7..1c73a1b8 100644 --- a/_inbox/Кластер RabbitMQ.md +++ b/_inbox/Кластер RabbitMQ.md @@ -7,7 +7,47 @@ zero-link: parents: linked: --- -![](Pasted%20image%2020240820133224.png) + +``` +docker run -itd -p 5672:5672 -p 15672:15672 --name rabbit rabbitmq:3-management +``` + +``` +docker exec -it rabbit bash +``` + +``` +docker network create cluster-network +``` + +``` +docker run -d --hostname node1.rabbit --net cluster-network --name rabbitNode1 --add-host node2.rabbit:172.24.0.3 -p "15673:15672" -e "RABBITMQ_USE_LONGNAME=true" -e RABBITMQ_ERLANG_COOKIE="cookie" rabbitmq:3-management +``` + +``` +docker run -d --hostname node2.rabbit --net cluster-network --name rabbitNode2 --add-host node1.rabbit:172.24.0.2 -p "15674:15672" -e "RABBITMQ_USE_LONGNAME=true" -e RABBITMQ_ERLANG_COOKIE="cookie" rabbitmq:3-management +``` +6. docker exec -it rabbitNode1 bash + +7. rabbitmqctl stop_app + +8. rabbitmqctl join_cluster rabbit@node2.rabbit + +9. rabbitmqctl start_app + +10. cd kafka-test + +11. docker-compose up -d + +12. docker exec -it kafka-test-kafka-1 bash + +13. kafka-topics --bootstrap-server localhost:9092 --topic test --create + +14. kafka-topics --bootstrap-server localhost:9092 --list + +15. kafka-console-consumer --bootstrap-server localhost:9092 --topic test + +16. kafka-console-producer --bootstrap-server localhost:9092 --topic test Синхронизировать через файл `/var/lib/rabbitmq/.erlang.cookie` ```