diff --git a/.idea/Ubuntu.iml b/.idea/Ubuntu.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/Ubuntu.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..6f29fee --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8a2e80f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..dbd1cdb --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,69 @@ + + + + + + + + + + { + "associatedIndex": 2 +} + + + + + + + + + + + + + + + 1739593846366 + + + + + + \ No newline at end of file diff --git a/HAProxy_install.md b/HAProxy_install.md index a605121..225ba40 100644 --- a/HAProxy_install.md +++ b/HAProxy_install.md @@ -101,7 +101,10 @@ stats auth igor:i123456 sudo journalctl -u haproxy --no-pager | tail -n 50 ```` Перезагружаем: -sudo systemctl restart haproxy +```sh + sudo systemctl restart haproxy +```` + И теперь должно открываться но адресу: http://data.ccalm.org:8989/ Обязательно проверить как установился SSL чекером: https://www.leaderssl.ru/tools/ssl_checker diff --git a/PostgreSQL_Exporter.md b/PostgreSQL_Exporter.md new file mode 100644 index 0000000..1d1668a --- /dev/null +++ b/PostgreSQL_Exporter.md @@ -0,0 +1,135 @@ +Устанавливаю согласно инструкции из: + +https://github.com/prometheus-community/postgres_exporter + +Подключаюсь к нужной машине +```sh +ssh igor@ccalm.org -p 2200 +``` + +## 1. Установка Docker и Docker Compose +Если Docker не установлен, установим его: +```sh + sudo apt update && sudo apt upgrade -y && + sudo apt install -y docker.io docker-compose && + sudo systemctl enable --now docker +``` + +## 2. Установка postgres-exporter в докере из заранее подготовленного образа + +```sh +sudo mkdir -p /opt/postgres-exporter && +sudo chown $USER:$USER /opt/postgres-exporter && +cd /opt/postgres-exporter +``` + +Создаю файл с настройками +```sh +cd /opt/postgres-exporter/ && +cat > docker-compose.yml < postgres_exporter.yml < +
+
+
+ +# Instructions to fix **unexpected** configuration errors + +If you can't find the RabbitMQ config file under `/etc/rabbitmq`, it may not exist by default. You need to **create it manually**. Here's how: + +## **1️⃣ Create the Configuration File** + +RabbitMQ uses either a **`.conf` file** (modern format) or a **`.config` file** (legacy format). The recommended format is `.conf`. + +Create the file if it doesn't exist: + +```bash +sudo nano /etc/rabbitmq/rabbitmq.conf +``` + +Then add the following cluster configuration: + +``` +cluster_formation.peer_discovery_backend = classic_config +cluster_formation.classic_config.nodes.1 = rabbit@rabbitmq-main +cluster_formation.classic_config.nodes.2 = rabbit@rabbitmq-replica +``` + +Save and exit (`CTRL+X`, then `Y`, then `Enter`). + +--- + +## **2️⃣ Set Correct Permissions** + +Ensure the RabbitMQ user can read it: + +```bash +sudo chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.conf +sudo chmod 644 /etc/rabbitmq/rabbitmq.conf +``` + +--- + +## **3️⃣ Restart RabbitMQ** + +After modifying the configuration, restart the RabbitMQ service: + +```bash +sudo systemctl restart rabbitmq-server +``` + +Check the status: + +```bash +sudo systemctl status rabbitmq-server +``` + +--- + +## **4️⃣ Verify the Cluster Configuration** + +After restarting, verify that clustering is working: + +```bash +rabbitmqctl cluster_status +``` + +If the nodes are listed correctly, your setup is working. + +--- + +## **5️⃣ If Using the Legacy `.config` Format** + +Some older installations use an **Erlang-based configuration file** (`rabbitmq.config`). If you prefer that, create: + +```bash +sudo nano /etc/rabbitmq/rabbitmq.config +``` + +Add this: + +```erlang +[ + {rabbit, [ + {cluster_formation, [ + {peer_discovery_backend, classic_config}, + {classic_config, [ + {nodes, ['rabbit@rabbitmq-main', 'rabbit@rabbitmq-replica']} + ]} + ]} + ]} +]. +``` + +Then restart RabbitMQ: + +```bash +sudo systemctl restart rabbitmq-server +``` + +--- + +### **🔍 Troubleshooting** + +❌ **RabbitMQ doesn't restart?** +Check logs for errors: + +```bash +sudo journalctl -u rabbitmq-server --no-pager | tail -50 +``` + +❌ **Cluster not forming?** +Try forcing a node to join manually: + +```bash +rabbitmqctl stop_app +rabbitmqctl join_cluster rabbit@rabbitmq-main +rabbitmqctl start_app +``` + +--- + +
+
+
+
+ +# Instructions to fix **unexpected** management UI authentication errors + +stackoverflow answer [link](https://stackoverflow.com/a/40845332/27251837) + +## Answer + +### ❌ **Cannot login with guest/guest credentials** + +I had the same Problem.. + +I installed RabbitMQ and Enabled Web Interface also but still couldn't sign in with any user i newly created, this is because you need to be administrator to access this. + +Do not create any config file and mess with it.. + +This is what i did then, + +1. Add a new/fresh user, say user test and password test: + +```bash +rabbitmqctl add_user test test +``` + +2. Give administrative access to the new user: + +```bash +rabbitmqctl set_user_tags test administrator +``` + +3. Set permission to newly created user: + +```bash +rabbitmqctl set_permissions -p / test ".*" ".*" ".*" +``` + +That's it, enjoy :)