Документ описывает распространенные проблемы при развертывании кластера.
error: could not access directory \"/data/mxdata_20221104084534/master/mxseg-1\": Permission deniedЛог инициализации MXUI:
"error": "execute: do execute: run: initialize_database: 7 errors occurred: *
error execute \"/usr/local/matrixdb-4.5.0.community/bin/initdb\"\n\n STDOUT:
The files belonging to this database system will be owned by user \"mxadmin\".
This user must also own the server process.
The database cluster will be initialized with locale \"en_US.utf8\".\n The default text search configuration will be set to \"english\".
Data page checksums are enabled.
STDERR:
initdb: error: could not access directory \"/data/mxdata_20221104084534/master/mxseg-1\": Permission denied\n * error execute \"/usr/local/matrixdb-4.5.0.community/bin/initdb\"
STDOUT:
The files belonging to this database system will be owned by user \"mxadmin\".
This user must also own the server process.\n\n The database cluster will be initialized with locale \"en_US.utf8\".
The default text search configuration will be set to \"english\".
Data page checksums are enabled.
Анализ проблемы
Только владелец каталога данных имеет права rwx, а группа и другие пользователи не имеют прав доступа.
[root@mdw ~]# ll /
total 36
lrwxrwxrwx. 1 root root 7 Jun 1 19:38 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Oct 26 18:28 boot
drwxr-xr-x 20 root root 3200 Oct 26 14:45 dev
drwxr-xr-x. 80 root root 8192 Oct 28 13:53 etc
drwxr-xr-x. 5 root root 8192 Oct 26 18:17 export
drwxr-xr-x. 5 root root 105 Oct 26 18:28 home
drwx------. 5 root root 105 Oct 26 18:28 data
Решение
Просто измените права доступа к каталогу данных.
sudo chmod 755 /data
yum после установки пакета matrixdb cpio read errorАнализ проблемы
Среда пользователя — Windows, используется виртуальная машина vm15. После загрузки установочного пакета в Windows файл перетаскивается в виртуальную машину, что приводит к его обрезанию.
Решение
Используйте механизм общей директории виртуальной машины для передачи данных.
could not connect to server: No route to hostВо время инициализации возникла ошибка:
could not connect to server: No route to host
Is the server running on host "192.168.88.203" and accepting
TCP/IP connections on port 40000?
(seg0 192.168.88.203:40000)
Анализ проблемы
На машине 203 отключен iptables, но отсутствует disable. После перезагрузки машины брандмауэр снова включился.
Порт по умолчанию не освобождается, что приводит к невозможности связи машины во время инициализации. Проявляется как зависание инициализации и невозможность ее завершения.
Решение
Очистите правила брандмауэра на машине 203, остановите службу iptables и disable, чтобы предотвратить отключение сети после перезагрузки.
unknown distribution option:"long_description_content_type"Анализ проблемы
Версия setuptools относительно старая.
Решение
sudo python3 -m pip install --upgrade setuptools
Решение
Добавьте имя хоста, номер порта и конфигурацию пользователя в файл .ssh/config:
Host mdw
Hostname mdw
Port 29022
User mxadmin
Host sdw1
Hostname sdw1
Port 29022
User mxadmin
Анализ проблемы
В файле /etc/hosts присутствует дублирующая запись, например:
<IP address1> <hostname1>
<IP address1> <hostname1>
<IP address2> <hostname2>
<IP address2> <hostname2>
Решение
Delete extra entries in /etc/hosts:
<IP address1> <hostname1>
<IP address2> <hostname2>
После изменения инициализация проходит нормально.
failed to connect to host=mdw user=mxadmin database=postgres: dial error (dial tcp 192.168.247.132:5432: connect: connection refused)В графическом интерфейсе возникла следующая ошибка:
failed to connect to host=mdw user=mxadmin database=postgres: dial error (dial tcp 192.168.247.132:5432: connect: connection refused)
Анализ проблемы
Вероятно, вы уже развертывали YMatrix ранее через браузер. По какой-то причине предыдущая среда YMatrix была очищена. При повторной загрузке этого графического интерфейса путь /datastream по умолчанию добавляется к URL-адресу.
Например: http://192.168.247.132:8240/datastream
Решение
Замените ключевое слово datastream на installer.
Например: http://192.168.247.132:8240/installer
Используйте графический интерфейс повторно для выполнения следующей установки.
collect: do collect: unmarshal remote: json: cannot unmarshal string into Go struct field Disk.hardware.disk.ineligibleDesc of type mxi18n.MessageПри установке и развертывании кластера YMatrix с использованием графического интерфейса возникла ошибка при добавлении узлов:
Host addition failed collect: do collect: unmarshal remote: json: cannot unmarshal string into Go struct field Disk.hardware.disk.ineligibleDesc of type mxi18n.Message
Анализ проблемы
Версия YMatrix, установленная на каждом узле сервера, неодинакова.
Метод проверки
Последовательно проверьте версию YMatrix на каждом узле сервера.
Проверьте версию YMatrix на мастер-узле mdw.
[root@mdw matrixdb]# ll /usr/local/matrixdb
lrwxrwxrwx 1 root root 25 12 9 18:02 /usr/local/matrixdb -> matrixdb-4.7.5.enterprise
Проверьте версию YMatrix на узле данных sdw1.
[root@sdw1 ~]$ ll /usr/local/matrixdb
lrwxrwxrwx 1 root root 25 12 22 17:24 /usr/local/matrixdb -> matrixdb-4.6.2.enterprise
Проверьте версию YMatrix на узле данных sdw2.
[root@sdw2 ~]# ll /usr/local/matrixdb
lrwxrwxrwx 1 root root 25 12 9 18:02 /usr/local/matrixdb -> matrixdb-4.7.5.enterprise
Проверьте версию YMatrix на узле данных sdw3.
[root@sdw3 ~]# ll /usr/local/matrixdb
lrwxrwxrwx 1 root root 25 12 9 18:02 /usr/local/matrixdb -> matrixdb-4.7.5.enterprise
Результаты проверки
Версия базы данных на узле sdw1 — 4.6.2, а версия базы данных на остальных узлах — 4.7.5.
Решение
Обновите версию базы данных на узле sdw1 до той же версии, что и на остальных узлах. Команда следующая:
Остановите службу Supervisor.
[root@sdw1 ~]$ systemctl stop matrixdb.supervisor.service
Удалите старую версию программного обеспечения YMatrix.
[root@sdw1 ~]$ yum -y remove matrixdb
Установите новую версию программного обеспечения YMatrix.
[root@sdw1 ~]$ yum -y install /home/mxadmin/matrixdb-4.7.5.enterprise-1.el7.x86_64.rpm
Запустите службу Supervisor.
[root@sdw1 ~]$ systemctl start matrixdb.supervisor.service
Сообщение об ошибке
20221223:09:55:10:001626 mxstart:mdw:mxadmin-[CRITICAL]:-Error occurred: non-zero rc: 1
Command was: 'env GPSESSID=0000000000 GPERA=None $GPHOME/bin/pg_ctl -D /mxdata_20221221165810/master/mxseg-1 -l /mxdata_20221221165810/master/mxseg-1/log/startup.log -w -t 600 -o " -p 5432 -c gp_role=utility " start'
rc=1, stdout='waiting for server to start.... stopped waiting
', stderr='pg_ctl: could not start server
Examine the log output.
'
Анализ проблемы
Просмотрите файл журнала.
[mxadmin@mdw ~]$ cd /mxdata_20221221165810/master/mxseg-1/log
[mxadmin@mdw log]$ vi startup.log
"FATAL","42501","could not create lock file ""/tmp/.s.PGSQL.5432.lock"": Permission denied",,,,,,,,"CreateLockFile","miscinit.c",994,1 0xd44e33 postgres errstart (elog.c:498)
Проверьте права доступа к пути /tmp. Поскольку права доступа к пути /tmp должны быть 777, просто верните их обратно.
[mxadmin@mdw ~]$ ll / | grep tmp
drw-r-xr-x. 7 root root 8192 12 23 10:00 tmp
Решение
Под пользователем root измените права доступа к пути /tmp на 777.
[mxadmin@mdw ~]$ exit
[root@mdw ~]# chmod 777 /tmp
Перезапустите кластер.
[root@mdw ~]# su - mxadmin
[mxadmin@mdw ~]$ mxstart -a
Анализ проблемы Просмотрите файлы журнала графического развертывания
[mxadmin@mdw ~]$ cd /var/log/matrixdb/
[mxadmin@mdw matrixdb]$ vi mxui.log
[20221223:10:08:43][INFO] id=1; start: system_setup
[20221223:10:08:43][INFO] id=1; done
[20221223:10:08:43][INFO] id=2; start: create_user_and_directories
[20221223:10:08:43][INFO] id=2; done
[20221223:10:08:43][INFO] id=3; start: initialize_database
[20221223:10:08:44][INFO] id=3; running: 6%
[20221223:10:08:44][INFO] id=3; running: 6%
[20221223:10:08:44][INFO] id=3; running: 6%
[20221223:10:08:44][INFO] id=3; running: 6%
[20221223:10:08:44][INFO] id=3; running: 6%
[20221223:10:08:45][INFO] id=3; running: 6%
[20221223:10:08:45][INFO] id=3; running: 6%
[20221223:10:08:45][INFO] id=3; done
[20221223:10:08:45][INFO] id=4; start: launch_matrixdb
[20221223:10:08:45][ERROR] id=4; failed: launch_matrixdb: error execute "/usr/local/matrixdb-4.7.5.enterprise/bin/pg_ctl -w -l /mxdata_20221223100549/master/mxseg-1/log/startup.log -D /mxdata_20221223100549/master/mxseg-1 -o -i -p 5432 -c gp_role=utility -m start"
STDOUT:
waiting for server to start.... stopped waiting
STDERR:
pg_ctl: could not start server
Examine the log output.
[20221223:10:08:45][INFO] id=4; revert start: launch_matrixdb
[20221223:10:08:45][INFO] id=4; revert done
[20221223:10:08:45][INFO] id=3; revert start: initialize_database
[20221223:10:08:45][INFO] id=3; revert done
[20221223:10:08:45][INFO] id=2; revert start: create_user_and_directories
[20221223:10:08:45][INFO] id=2; revert done
[20221223:10:08:45][INFO] id=1; revert start: system_setup
[20221223:10:08:45][INFO] id=1; revert done
{
"error": "execute: do execute: run: launch_matrixdb: error execute \"/usr/local/matrixdb-4.7.5.enterprise/bin/pg_ctl -w -l /mxdata_20221223100549/master/mxseg-1/log/startup.log -D /mxdata_20221223100549/master/mxseg-1 -o -i -p 5432 -c gp_role=utility -m start\"\n\nSTDOUT:\n waiting for server to start.... stopped waiting\n\nSTDERR:\n pg_ctl: could not start server\nExamine the log output.\n"
}
execute: do execute: run: launch_matrixdb: error execute "/usr/local/matrixdb-4.7.5.enterprise/bin/pg_ctl -w -l /mxdata_20221223100549/master/mxseg-1/log/startup.log -D /mxdata_20221223100549/master/mxseg-1 -o -i -p 5432 -c gp_role=utility -m start"
STDOUT:
waiting for server to start.... stopped waiting
STDERR:
pg_ctl: could not start server
Examine the log output.
[GIN] 2022/12/23 - 10:08:45 | 200 | 148.13µs | 192.168.247.2 | GET "/api/installer/log"
На данный момент шаги графического развертывания достигли этапа launch_matrixdb.
Найдите соответствующую операцию в журнале и проанализируйте в контексте: обнаружено, что этап запуска экземпляра pg_ctl выполняется в данный момент. Это указывает на то, что экземпляр не смог запуститься, что привело к сбою всей операции инициализации и откату.
Существует несколько причин, которые могут привести к сбою запуска экземпляра. Необходимо проверить их по очереди в зависимости от реальной ситуации:
/tmp, невозможно создать файл блокировки.Решение
Поскольку причины первых трех проблем сложны и требуют детального анализа в конкретных сценариях, они здесь не описываются подробно.
Под пользователем root измените права доступа к пути /tmp на 777.
[root@mdw ~]# chmod 777 /tmp
Сообщение об ошибке
[root@sdw4 yum.repos.d]# yum -y install /home/mxadmin/matrixdb5-5.0.0.enterprise-1.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining /home/mxadmin/matrixdb5-5.0.0.enterprise-1.el7.x86_64.rpm: matrixdb5-5.0.0.enterprise-1.el7.x86_64
Package /home/mxadmin/matrixdb5-5.0.0.enterprise-1.el7.x86_64.rpm is marked for installation
Resolving Dependencies
--> Checking transaction
---> Package matrixdb5.x86_64 0:5.0.0.enterprise-1.el7 will be installed
--> Processing Dependency: sysstat for package: matrixdb5-5.0.0.enterprise-1.el7.x86_64
Loading mirror speeds from cached hostfile
--> Finished dependency resolution
Error: Package: matrixdb5-5.0.0.enterprise-1.el7.x86_64 (/matrixdb5-5.0.0.enterprise-1.el7.x86_64)
Requires: sysstat
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Анализ проблемы
Отсутствует пакет sysstat.
Решение
Настройте репозиторий yum, используйте yum -y install sysstat для установки инструмента sysstat, а затем установите пакет YMatrix.
Анализ проблемы
После завершения развертывания YMatrix процесс Supervisor запускается с исключением. При проверке /var/log/messages обнаруживается следующий журнал исключения:
Dec 22 19:08:59 sdw21 systemd: matrixdb.supervisor.service holdoff time over, scheduling restart.
Dec 22 19:08:59 sdw21 systemd: Stopped MatrixDB Supervisord Daemon.
Dec 22 19:08:59 sdw21 systemd: Started MatrixDB Supervisord Daemon.
Dec 22 19:08:59 sdw21 bash: time="2022-12-22T19:08:59+08:00" level=info msg="load configuration from file" file=/etc/matrixdb/supervisor.conf
Dec 22 19:08:59 sdw21 bash: time="2022-12-22T19:08:59+08:00" level=info msg="load config file over, content "
Dec 22 19:09:09 sdw21 bash: panic: timeout to start gRPC service
Dec 22 19:09:09 sdw21 bash: goroutine 1 [running]:
Dec 22 19:09:09 sdw21 bash: main.runServer()
Dec 22 19:09:09 sdw21 bash: /home/runner/work/matrixdb-ci/matrixdb-ci/cmd/supervisor/main.go:151 +0x4f0
Dec 22 19:09:09 sdw21 bash: main.main()
Dec 22 19:09:09 sdw21 bash: /home/runner/work/matrixdb-ci/matrixdb-ci/cmd/supervisor/main.go:216 +0x185
Dec 22 19:09:09 sdw21 systemd: matrixdb.supervisor.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 22 19:09:09 sdw21 systemd: Unit matrixdb.supervisor.service entered failed state.
Dec 22 19:09:09 sdw21 systemd: matrixdb.supervisor.service failed.
Dec 22 19:09:14 sdw21 systemd: matrixdb.supervisor.service holdoff time over, scheduling restart.
Dec 22 19:09:14 sdw21 systemd: Stopped MatrixDB Supervisord Daemon.
Dec 22 19:09:14 sdw21 systemd: Started MatrixDB Supervisord Daemon.
После расследования было установлено, что значение переменной в файле /etc/sysctl.conf слишком велико, что приводит к плохой работе Supervisor. Просто измените его на нормальное значение, как показано ниже.
Решение
/etc/sysctl.conf, чтобы предотвратить блокировку операций Supervisor################## value too large, supervisor startup fail
#net.core.rmem_default = 1800262144
#net.core.wmem_default = 1800262144
#net.core.rmem_max = 2000777216
#net.core.wmem_max = 2000777216
############
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
journalctl --no-pager для получения подробной информации, включая стек сбоя и т.д.Сообщение об ошибке
Collection of information failed collect: do collect: hardware: GetDisk: createTempUser: error execute useradd: exit status 1 please create "mxadmin" user manually to workaround this issue useradd: Unable to open /etc/passwd
Анализ проблемы
Согласно анализу сообщения об ошибке, проблема связана с правами доступа к файлу /etc/passwd, что привело к неудачному созданию системного пользователя mxadmin.
Решение
Вручную создайте тестового пользователя и просмотрите сообщение об ошибке
[root@sdw4 ~]# useradd test1
useradd:无法打开 /etc/passwd
Проверьте права доступа к /etc/passwd
[root@sdw4 ~]# ll /etc/passwd
-rw-r--r-- 1 root root 898 12月 24 01:48 /etc/passwd
Результат показывает, что права доступа к 644 являются нормальными, проблем нет
Проверьте, имеют ли файлы /etc/passwd специальные права
[root@sdw4 ~]# lsattr /etc/passwd
----i--------- /etc/passwd
Результат показывает, что файл /etc/passwd имеет специальное право "i" (Описание прав: ни один пользователь, включая root, не может изменять или удалять файл).
Повторите вышеуказанные шаги для проверки файла /etc/group
[root@sdw4 ~]# ll /etc/group
-rw-r--r-- 1 root root 460 12月 24 01:48 /etc/group
[root@sdw4 ~]# lsattr /etc/group
----i---------- /etc/group
Удалите специальные права двух файлов /etc/passwd и /etc/group
[root@sdw4 ~]# chattr -i /etc/passwd
[root@sdw4 ~]# chattr -i /etc/group
Попробуйте еще раз вручную создать тестового пользователя
[root@sdw4 ~]# useradd test1
В результате пользователь создается нормально.
Удалите тестового пользователя
[root@sdw4 ~]# userdel -r test1
Продолжите установку и развертывание YMatrix с использованием графического интерфейса
При инициализации с помощью MXUI на последнем шаге возникает следующая ошибка:
[20221101:14:59:02][ERROR] id=3; failed: initialize_database: error execute "/opt/ymatrix/matrixdb-5.0.0+enterprise/bin/initdb"
STDOUT:
The files belonging to this database system will be owned by user "mxadmin".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default text search configuration will be set to "english".
{
"error": "execute: do execute: run: initialize_database: error execute \"/opt/ymatrix/matrixdb-5.0.0+enterprise/bin/initdb\"\n\nSTDOUT:\n The files belonging to this database system will be owned by user \"mxadmin\".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locale \"en_US.utf8\".\nThe default text search configuration will be set to \"english\".\n\nData page checksums are enabled.\n\nfixing permissions on existing directory /data/mxdata_20221101121858/primary/mxseg0 ... ok\ncreating subdirectories ... ok\nselecting dynamic shared memory implementation ... posix\nselecting default max_connections ... \nSTDERR:\n initdb: error: initdb: error 256 from: \"/opt/ymatrix/matrixdb-5.0.0+enterprise/bin/postgres\" --boot -x0 -F -c max_connections=1500 -c shared_buffers=262144 -c dynamic_shared_memory_type=posix \u003c \"/dev/null\" \u003e \"/dev/null\" 2\u003e\u00261\ninitdb: removing contents of data directory \"/data/mxdata_20221101121858/primary/mxseg0\"\n"
Data page checksums are enabled.
fixing permissions on existing directory /data/mxdata_20221101121858/primary/mxseg0 ... ok
creating subdirectories ... ok
}
selecting dynamic shared memory implementation ... posix
selecting default max_connections ...
STDERR:
initdb: error: initdb: error 256 from: "/opt/ymatrix/matrixdb-5.0.0+enterprise/bin/postgres" --boot -x0 -F -c max_connections=1500 -c shared_buffers=262144 -c dynamic_shared_memory_type=posix < "/dev/null" > "/dev/null" 2>&1
initdb: removing contents of data directory "/data/mxdata_20221101121858/primary/mxseg0"
Анализ проблемы
Решение
/etc/hosts.free -g для проверки объема памяти.Да.
Графический клиент MXUI использует http://<IP>:8240 для предоставления сервисов внешнему миру. Если требуется обеспечить прямой доступ через доменное имя http://hostname, можно настроить обратный прокси с помощью Nginx.
Например: если необходимо установить mxui.ymatrix.cn в качестве внешнего адреса доступа, конфигурация Nginx будет следующей:
server
{
listen 80;
server_name mxui.ymatrix.cn; # 对外域名
# WebSocket forwarding rules
location /ws {
proxy_pass http://127.0.0.1:8240/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
# Web forwarding rules
location / {
proxy_pass http://127.0.0.1:8240;
}
}
Примечание!
MXUI использует WebSocket API для связи и требует отдельной настройки правил проксирования для корректной работы.
Interconnect error writing an outgoing packet: operation not allowedВывод системного журнала /var/log/message следующий:
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:15 sdw37 kernel: nf_conntrack: table full, dropping packet
Mar 10 06:26:20 sdw37 kernel: nf_conntrack: table full, dropping packet
Анализ проблемы
Системный параметр net.netfilter.nf_conntrack_max по умолчанию ограничивает максимальное количество отслеживаемых соединений 65536. Эта ошибка возникает при большом количестве соединений. Вы можете использовать следующую команду для просмотра текущего максимального количества соединений в системе:
cat /proc/sys/net/netfilter/nf_conntrack_max
Решение
Увеличьте параметр net.netfilter.nf_conntrack_max.
sysctl -w net.netfilter.nf_conntrack_max=655360
Да. Следуйте приведенным ниже шагам для развертывания.
Примечание!
Замените раздел развертывания базы данных через графический интерфейс в документе стандартного развертывания кластера следующими командами. Эти команды необходимо выполнять на Master под пользователем root.
Переключитесь на пользователя root.
$ sudo su
# echo "" | /opt/ymatrix/matrixdb5/bin/mxctl setup collect > /tmp/collect.1
Затем задайте количество экземпляров на каждом хосте.
# export MXDEBUG_PRIMARY_PER_HOST=1
Соберите информацию с каждого хоста. Необходимо собирать по одному, Master уже собран и повторно выполнять не нужно.
# cat /tmp/collect.1 | /opt/ymatrix/matrixdb5/bin/mxctl setup collect --host sxd1 > /tmp/collect.2
# cat /tmp/collect.2 | /opt/ymatrix/matrixdb5/bin/mxctl setup collect --host sxd2 > /tmp/collect.3
# cat /tmp/collect.3 | /opt/ymatrix/matrixdb5/bin/mxctl setup netcheck > /tmp/collect.3c
a. Назначьте sxd2 только как Standby (sxd2 выполняет только роль Standby и не хранит бизнес-данные).
# tac /tmp/collect.3c | sed '0,/"isSegment":\ true/{s/"isSegment":\ true/"isSegment":\ false/}' | tac > /tmp/collect.3d
# tac /tmp/collect.3d | sed '0,/"isStandby":\ false/{s/"isStandby":\ false/"isStandby":\ true/}' | tac > /tmp/collect.3e
b. Добавьте экземпляр резервного узла на sxd2 (sxd2 выполняет две роли: Segment + Standby).
# tac /tmp/collect.3c | sed '0,/"isStandby":\ false/{s/"isStandby":\ false/"isStandby":\ true/}' | tac > /tmp/collect.3e
В нашем примере выберем настройку sxd2 как Segment + Standby.
Настройка планирования дисков (опционально)
# cat /tmp/collect.3e |grep -i disklist
"diskList": []
"diskList": []
"diskList": []
Вы можете изменить diskList, отредактировав файл collect.3e, созданный в шаге 1.3 (например: "diskList": ["/data1", "/data2", "/data3"]).
В этом файле diskList по умолчанию является пустым массивом. Если вы оставите файл по умолчанию, данные будут автоматически сохранены на диске с наибольшим объемом свободного места.
Включение зеркалирования
Настройте узел зеркалирования в файле collect.3e.
# cat /tmp/collect.3e
Измените соответствующие параметры настройки зеркалирования.
{
"versionID": "iAioSDT2QJnXAXRzBfYsx6",
"genDateTime": "2023-04-12 07:26:49",
"strategy": {
"hostRole": {
"isMaster": true,
"isSegment": false,
"isStandby": false
},
"highAvailability": {
"useMirror": "auto", // auto 是默认值,可用 yes/no 强制启用。如果 Segment 主机有 2 个或更多,YMatrix 会自动启用 Mirror 机制,如果只有 1 个则不启用
"mirrorStrategy": "ring",
"haProvisioner": ""
}
Генерация финального плана развертывания
# cat /tmp/collect.3e | /opt/ymatrix/matrixdb5/bin/mxbox deployer plan | tee /tmp/p4
Развертывание кластера
# cat /tmp/p4 | /opt/ymatrix/matrixdb5/bin/mxbox deployer setup --debug
Сообщение об ошибке
collect: do collect: remote host 172.16.100.144: rpc error: code = Unavailable desc = connection error:desc = "ransport: Error while dialing dial tcp 172.16.100.144:4617: connect: connection refused"
Проявление проблемы
Установка и развертывание кластера постоянно выдают ошибку и не могут подключиться. Проверка сети показывает, что она не является абсолютной. Проверка supervisor показывает нестабильную периодичность.
[root@ljb-sdw2 software]# systemctl status matrixdb5.supervisor.service
● matrixdb5.supervisor.service - MatrixDB 5 Supervisord Daemon
Loaded: loaded (/usr/lib/systemd/system/matrixdb5.supervisor.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-06-05 17:46:20 CST; 2s ago
Main PID: 14587 (supervisord)
Tasks: 9
CGroup: /system.slice/matrixdb5.supervisor.service
└─14587 /opt/ymatrix/matrixdb5/bin/supervisord -c /etc/matrixdb5/supervisor.conf
Jun 05 17:46:20 ljb-sdw2 systemd[1]: Started MatrixDB 5 Supervisord Daemon.
Jun 05 17:46:20 ljb-sdw2 bash[14587]: time="2023-06-05T17:46:20+08:00" level=info msg="load configuration from file" file=/etc/matrixdb5/supervisor.conf
Jun 05 17:46:20 ljb-sdw2 bash[14587]: time="2023-06-05T17:46:20+08:00" level=info msg="load config file over, content "
[root@ljb-sdw2 software]# systemctl status matrixdb5.supervisor.service
● matrixdb5.supervisor.service - MatrixDB 5 Supervisord Daemon
Loaded: loaded (/usr/lib/systemd/system/matrixdb5.supervisor.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2023-06-05 17:46:23 CST; 4s ago
Process: 14587 ExecStart=/bin/bash -c PATH="$MXHOME/bin:$PATH" exec "$MXHOME"/bin/supervisord -c "$MX_SUPERVISOR_CONF" (code=exited, status=2)
Main PID: 14587 (code=exited, status=2)
Jun 05 17:46:23 ljb-sdw2 systemd[1]: Unit matrixdb5.supervisor.service entered failed state.
Jun 05 17:46:23 ljb-sdw2 systemd[1]: matrixdb5.supervisor.service failed.
Проверка файлов журнала кластера показала, что они не были созданы.
[root@ljb-sdw2 software]# cd /var/log/matrixdb5/
[root@ljb-sdw2 matrixdb5]# ls -l
total 0
Просмотрите реальный динамический журнал supervisor.
[root@ljb-sdw2 software]# journalctl -u matrixdb5.supervisor.service -f
-- Logs began at Sun 2023-05-07 21:33:02 CST. --
Jun 05 17:52:31 ljb-sdw2 bash[15171]: time="2023-06-05T17:52:31+08:00" level=info msg="load configuration from file" file=/etc/matrixdb5/supervisor.conf
Jun 05 17:52:31 ljb-sdw2 bash[15171]: time="2023-06-05T17:52:31+08:00" level=info msg="load config file over, content "
Jun 05 17:52:34 ljb-sdw2 bash[15171]: panic: timeout to start gRPC service
Jun 05 17:52:34 ljb-sdw2 bash[15171]: goroutine 1 [running]:
Jun 05 17:52:34 ljb-sdw2 bash[15171]: main.runServer()
Jun 05 17:52:34 ljb-sdw2 bash[15171]: /home/runner/work/matrixdb-ci/matrixdb-ci/cmd/supervisor/main.go:154 +0x4f0
Jun 05 17:52:34 ljb-sdw2 bash[15171]: main.main()
Jun 05 17:52:34 ljb-sdw2 bash[15171]: /home/runner/work/matrixdb-ci/matrixdb-ci/cmd/supervisor/main.go:219 +0x185
Jun 05 17:52:34 ljb-sdw2 systemd[1]: matrixdb5.supervisor.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 05 17:52:34 ljb-sdw2 systemd[1]: Unit matrixdb5.supervisor.service entered failed state.
Jun 05 17:52:34 ljb-sdw2 systemd[1]: matrixdb5.supervisor.service failed.
Jun 05 17:52:39 ljb-sdw2 systemd[1]: matrixdb5.supervisor.service holdoff time over, scheduling restart.
Jun 05 17:52:39 ljb-sdw2 systemd[1]: Stopped MatrixDB 5 Supervisord Daemon.
Jun 05 17:52:39 ljb-sdw2 systemd[1]: Started MatrixDB 5 Supervisord Daemon.
Jun 05 17:52:40 ljb-sdw2 bash[15186]: time="2023-06-05T17:52:40+08:00" level=info msg="load configuration from file" file=/etc/matrixdb5/supervisor.conf
Jun 05 17:52:40 ljb-sdw2 bash[15186]: time="2023-06-05T17:52:40+08:00" level=info msg="load config file over, content "
Jun 05 17:52:43 ljb-sdw2 bash[15186]: panic: timeout to start gRPC service
Jun 05 17:52:43 ljb-sdw2 bash[15186]: goroutine 1 [running]:
Jun 05 17:52:43 ljb-sdw2 bash[15186]: main.runServer()
Jun 05 17:52:43 ljb-sdw2 bash[15186]: /home/runner/work/matrixdb-ci/matrixdb-ci/cmd/supervisor/main.go:154 +0x4f0
Jun 05 17:52:43 ljb-sdw2 bash[15186]: main.main()
Jun 05 17:52:43 ljb-sdw2 bash[15186]: /home/runner/work/matrixdb-ci/matrixdb-ci/cmd/supervisor/main.go:219 +0x185
Jun 05 17:52:43 ljb-sdw2 systemd[1]: matrixdb5.supervisor.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 05 17:52:43 ljb-sdw2 systemd[1]: Unit matrixdb5.supervisor.service entered failed state.
Jun 05 17:52:43 ljb-sdw2 systemd[1]: matrixdb5.supervisor.service failed.
Решение
/etc/hosts и добавьте конфигурацию localhost# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
supervisor# sudo systemctl restart matrixdb5.supervisor.service
Решение
LOG: gp_role forced to 'utility' in single-user mode Y.sh: line 1: 11865 Illegal instructionСообщение об ошибке
"LogCheckpointEnd","xlog.c",8916, LOG: gp_role forced to 'utility' in single-user mode Y.sh: line 1:
11865 Illegal instruction (core dumped) "/opt/ymatrix/matrixdb-5.0.0+community/bin/postgres" --single -F -O -j -c
gp_role=utility -c search_path=pg_catalog -c exit_on_error=true template1 > /dev/null child process exited with exit code 132
initdb: data directory "/mxdata_20231018165815/master/mxseg-1" not removed at user's request * rpc error:
Анализ проблемы
Новая версия базы данных поддерживает использование SIMD-инструкций в векторных наборах. Во время установки проверяется набор инструкций ЦП. Если набор инструкций ЦП не поддерживается, появляется указанная выше ошибка.
Решение
cat /proc/cpuinfo|grep -E "mmx|sse|sse2|ssse3|sse4_1|sse4_2|avx|avx2"
# All ports need to be opened between the IPs within the cluster, and only the external ports can be exposed.
# Database firewall configuration, assuming in the example 10.129.38.230, 10.129.38.231, 10.129.38.232 Three servers built a database cluster
# All ports are open between all hosts in the cluster, including TCP and UDP protocols
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.230" port protocol="tcp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.231" port protocol="tcp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.232" port protocol="tcp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.230" port protocol="udp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.231" port protocol="udp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.232" port protocol="udp" port="0-65535" accept"
# Turn on ping
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.230" port protocol="icmp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.231" port protocol="icmp" port="0-65535" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.129.38.232" port protocol="icmp" port="0-65535" accept"
# Master and standby master nodes are restricted to the public 5432 service port 8240
firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --zone=public --add-port=8240/tcp --permanent
# Grafana
firewall-cmd --zone=public --add-port=3000/tcp --permanent
# View firewall rules
firewall-cmd --list-all
# Reload the firewall to make the configuration take effect
firewall-cmd --reload
systemctl restart firewalld.service