Меню

Ошибка authentication method 10 not supported

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Open

harrisgomez opened this issue

Mar 12, 2021

· 8 comments

Comments

@harrisgomez

Hi, I’m running the latest version of PSequel v1.5.3 on a macOS Big Sur 11.2.2 and after opening up the app to connect to an existing db, I recently started seeing this error message. I checked SO for a fix but to no avail. Anyone else getting the same problem?

Screen Shot 2021-03-12 at 6 15 18 PM

@shhavel

Have the same problem with PSequel v1.5.3 on Mac OS High Sierra 10.13.6, PostgreSQL 13.2. Thanks

@ismgonza

@fillyD

also same. seems to do with the authentication method. doesnt support scram-sha-256 password encryption

@Sunny-fr

Hey there,
Same too.
I managed to make it work changing the authentication to «password» instead of md5 or scram-sha-256.
https://www.postgresql.org/docs/10/auth-methods.html

I’m running BigSure 11.6 and using docker for postgres.

Here’s how I run it :

docker run --name <SOME_IMAGE_NAME> -e POSTGRES_PASSWORD=<SOME_PASSWORD> -e POSTGRES_USER=<SOME_USER> -e  POSTGRES_HOST_AUTH_METHOD=password -p 5432:5432 -d postgres:14.0-alpine

@ginkosen

@n-sviridenko

@mohamedlaminelalmi

On postgresql.conf file change:
This: password_encryption = scram-sha-256
To this: password_encryption = md5

On pg_hba.conf file change:
The method scram-sha-256 to md5 on all lines.

Recreate your user again (Delete it then create again).

@autumnify

Hey there, Same too. I managed to make it work changing the authentication to «password» instead of md5 or scram-sha-256. https://www.postgresql.org/docs/10/auth-methods.html

I’m running BigSure 11.6 and using docker for postgres.

Here’s how I run it :

docker run --name <SOME_IMAGE_NAME> -e POSTGRES_PASSWORD=<SOME_PASSWORD> -e POSTGRES_USER=<SOME_USER> -e  POSTGRES_HOST_AUTH_METHOD=password -p 5432:5432 -d postgres:14.0-alpine

You are awesome dude,, i finally managed to make it work. Thanks

This isn’t a Rust-specific question; the issue applies to any application connecting to a Postgres DB that doesn’t support the scram-sha-256 authentication method. In my case it was a problem with the Perl application connecting to Postgres.

These steps are based on a post.

You need to have installed the latest Postgres client.
The client bin directory (SRC) is «C:Program FilesPostgreSQL13bin» in this example. The target (TRG) directory is where my application binary is installed: «C:Strawberrycbin». My application failed during an attempt to connect the Postgres DB with error «… authentication method 10 not supported …».

set SRC=C:Program FilesPostgreSQL13bin
set TRG=C:Strawberrycbin

dir "%SRC%libpq.dll"         # to see the source DLL
dir "%TRG%libpq__.dll"       # to see the target DLL. Will be replaced from SRC

cp "%SRC%libpq.dll" %TRG%.

cd %TRG%
pexports libpq.dll > libpq.def 
dlltool --dllname libpq.dll --def libpq.def --output-lib ..liblibpq.a

move "%TRG%"libpq__.dll "%TRG%"libpq__.dll_BUP # rename ORIGINAL name to BUP
move "%TRG%"libpq.dll "%TRG%"libpq__.dll       # rename new DLL to ORIGINAL

At this point I was able successfully connect to Postgres from my Perl script.

The initial post shown above also suggested to copy other DLLs from source to the target:

libiconv-2.dll
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
libintl-8.dll

However, I was able to resolve my issue without copying these libraries.

Are you looking for an answer to the topic “postgresql authentication method 10 not supported“? We answer all your questions at the website barkmanoil.com in category: Newly updated financial and investment news for you. You will find the answer right below.

Keep Reading

Postgresql Authentication Method 10 Not Supported

Postgresql Authentication Method 10 Not Supported

How do I enable Postgres authentication?

To authenticate network connections from the PostgreSQL server’s machine (non-socket connections) using passwords, you need to match a host connection type instead of local . You can then limit the acceptable addresses to the local loopback devices and allow users to authenticate using md5 or scram-sha-256 .

What are the recommended authentication protocols for PostgreSQL?

The following subsections describe the authentication methods in more detail.

  • Trust Authentication. …
  • Password Authentication. …
  • GSSAPI Authentication. …
  • SSPI Authentication. …
  • Kerberos Authentication. …
  • Ident Authentication. …
  • Peer Authentication. …
  • LDAP Authentication.

Fix PostgreSQL Fatal Password Error

Fix PostgreSQL Fatal Password Error

Fix PostgreSQL Fatal Password Error

Images related to the topicFix PostgreSQL Fatal Password Error

Fix Postgresql Fatal Password Error

Fix Postgresql Fatal Password Error

What is scram sha256?

The method scram-sha-256 performs SCRAM-SHA-256 authentication, as described in RFC 7677. It is a challenge-response scheme that prevents password sniffing on untrusted connections and supports storing passwords on the server in a cryptographically hashed form that is thought to be secure.

What is md5 authentication in PostgreSQL?

The password-based authentication methods are md5 and password. These methods operate similarly except for the way that the password is sent across the connection, namely MD5-hashed and clear-text respectively. If you are at all concerned about password “sniffing” attacks then md5 is preferred.

Which is an authentication method?

5 Common Authentication Types

  1. Password-based authentication. Passwords are the most common methods of authentication. …
  2. Multi-factor authentication. …
  3. Certificate-based authentication. …
  4. Biometric authentication. …
  5. Token-based authentication.

What is method in Pg_hba conf?

pg_hba. conf is the PostgreSQL access policy configuration file, which is located in the /var/lib/pgsql/10/data/ directory (PostgreSQL10) by default. The configuration file has 5 parameters, namely: TYPE (host type), DATABASE (database name), USER (user name), ADDRESS (IP address and mask), METHOD (encryption method)

How do I change the authentication in PostgreSQL?

Change PostgreSQL Authentication Method from Ident to MD5

  1. Pre-Flight Check. …
  2. Step #1: Switch to the PostgreSQL User: postgres. …
  3. Step #2: Add/Change the Password for the PostgreSQL User: postgres. …
  4. Step #3: Edit the Authentication Method. …
  5. Step #4: Verify Your Access.

See some more details on the topic postgresql authentication method 10 not supported here:


PostgreSQL + Postbird ‘authentication method 10 not supported’

I am using PostgreSQL (version 13) and Postbird (version 0.8.4). Everything is going well except for the fact that I cannot export the database …

+ Read More

Authentication Method 10 Not Supported Postgressql – ADocLib

authentication method 10 not supported. means, that you are using If you can log in through psql , you can use show hba_file; to see the real file being used.

+ View More Here

Authentication method 10 not supported (QGIS) – GIS Stack …

I have a problem when I am trying to connect the database that I have in pgadmin with my QGIS project. I am trying to create a New PostGIS …

+ View Here

Connection Error – Authentication method 10 not supported

Connection Error – Authentication method 10 not supported #221 … with PSequel v1.5.3 on Mac OS High Sierra 10.13.6, PostgreSQL 13.2.

+ View Here

What is Kerberos authentication in PostgreSQL?

Kerberos is one of the leading network security authentication protocols, recommended by EDB in the Postgres Vision 2021 Conference, and preferred and implemented in many large organizations. Kerberos is a ticket-based authentication system that authenticates between trusted hosts using strong encryption algorithms.

What is Postgres peer authentication?

The peer authentication method works by obtaining the client’s operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.

How does SCRAM authentication work?

Using cryptographic hashing techniques, a client can prove to a server that the user knows a secret derived from the user’s password without sending the password itself. The server can prove to the client that it knows a secret derived from the user’s password also without having to send the actual password.

What is authentication method SCRAM?

Salted Challenge Response Authentication Mechanism (SCRAM) is the default authentication mechanism for MongoDB. When a user authenticates themselves, MongoDB uses SCRAM to verify the supplied user credentials against the user’s name , password and authentication database .

What is SCRAM SHA?

Salted Challenge Response Authentication Mechanism (SCRAM), or SASL/SCRAM, is a family of SASL mechanisms that addresses the security concerns with traditional mechanisms that perform username/password authentication like PLAIN. Apache Kafka® supports SCRAM-SHA-256 and SCRAM-SHA-512 .


Тип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql

Тип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql

Тип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql

Images related to the topicТип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql

Тип Аутентификации 10  Файл Pg_Hba.Conf / The Authentication Type 10 Is Not Supported. Postgres Sql

Тип Аутентификации 10 Файл Pg_Hba.Conf / The Authentication Type 10 Is Not Supported. Postgres Sql

How do I connect to a postgres database?

Connecting to a Database

In order to connect to a database you need to know the name of your target database, the host name and port number of the server, and what user name you want to connect as. psql can be told about those parameters via command line options, namely -d , -h , -p , and -U respectively.

How do I connect to a PostgreSQL database?

So if your current user is a valid PostgreSQL user on your local database, you can connect by typing:

  1. psql.
  2. sudo –login –user=postgres. psql.
  3. sudo –login –user=postgres psql.

What is default password for postgres?

For most systems, the default Postgres user is postgres and a password is not required for authentication. Thus, to add a password, we must first login and connect as the postgres user.

What are the 3 methods of authentication?

Authentication factors can be classified into three groups: something you know: a password or personal identification number (PIN); something you have: a token, such as bank card; something you are: biometrics, such as fingerprints and voice recognition.

Which authentication method is best?

Biometric Authentication Methods

Biometric authentication relies on the unique biological traits of a user in order to verify their identity. This makes biometrics one of the most secure authentication methods as of today.

What are the 4 general forms of authentication?

Four-factor authentication (4FA) is the use of four types of identity-confirming credentials, typically categorized as knowledge, possession, inherence and location factors.

How do I get Postgres to accept remote connections?

13.4 Connecting to a Remote PostgreSQL Database

  1. Change the listening address in the postgresql. conf file. By default, PostgreSQL allows to listen for the localhost connection. …
  2. Add a client authentication entry to the pg_hba. conf file. …
  3. Test the remote connection. Restart the remote PostgreSQL server.

Why is Pg_hba conf used in PostgreSQL?

When PostgreSQL receives a connection request it will check the pg_hba. conf file to verify that the machine from which the application is requesting a connection has rights to connect to the specified database.

How do I whitelist an IP address in Postgres?

Using SQL Server Management Studio

  1. In Object Explorer, right-click a server and select Properties.
  2. Click the Connections node.
  3. Under Remote server connections, select or clear the Allow remote connections to this server check box.

How do I get Postgres to accept remote connections?

13.4 Connecting to a Remote PostgreSQL Database

  1. Change the listening address in the postgresql. conf file. By default, PostgreSQL allows to listen for the localhost connection. …
  2. Add a client authentication entry to the pg_hba. conf file. …
  3. Test the remote connection. Restart the remote PostgreSQL server.

What is LDAP authentication in PostgreSQL?

This authentication method operates similarly to password except that it uses LDAP as the password verification method. LDAP is used only to validate the user name/password pairs. Therefore the user must already exist in the database before LDAP can be used for authentication.


Part 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.

Part 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.

Part 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.

Images related to the topicPart 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.

Part 9 - Postgresql : What Is Pg_Hba.Conf File In Postgresql.

Part 9 – Postgresql : What Is Pg_Hba.Conf File In Postgresql.

How do I connect to a Postgres database?

Connecting to a Database

In order to connect to a database you need to know the name of your target database, the host name and port number of the server, and what user name you want to connect as. psql can be told about those parameters via command line options, namely -d , -h , -p , and -U respectively.

What is authorization in Postgres?

Each connection to a PostgreSQL database is associated with a specific role that determines its initial level of access. Authorization policies determine what powers each role has within the database cluster, including what commands it can execute, what resources it can access, and what features it can use.

Related searches to postgresql authentication method 10 not supported

  • please enter the password for the user postgres to connect the server postgresql 14
  • Authentication method 10 not supported
  • the authentication type 10 is not supported
  • scram authentication requires libpq version 10 or above
  • postgres authentication method 10 not supported
  • postgresql13 authentication method 10 not supported
  • pg_connect() unable to connect to postgresql server authentication method 10 not supported
  • navicat postgresql authentication method 10 not supported
  • postgresql error authentication method 10 not supported
  • 1c postgresql authentication method 10 not supported
  • error don t know how to auth: 10
  • postgresql 14 authentication method 10 not supported
  • authentication method 10 not supported docker
  • Scram-sha-256 postgres
  • the authentication type 10 is not supported.
  • Postgresql hpa
  • unable to connect to postgresql server authentication method 10 not supported php
  • authentication method 10 not supported postgres
  • authentication method 10 not supported
  • postgresql hpa
  • error don t know how to auth 10
  • scram sha 256 postgres

Information related to the topic postgresql authentication method 10 not supported

Here are the search results of the thread postgresql authentication method 10 not supported from Bing. You can read more if you want.


You have just come across an article on the topic postgresql authentication method 10 not supported. If you found this article useful, please share it. Thank you very much.


Количество просмотров:
121

К настоящему моменту силами фирмы 1С было сделано многое, что бы их программное обеспечение работало не только в платной ОС Windows + платный же MsSQL + если было необходимо работать через интернет, то RDP на Windows, разумеется платно, но и могло работать используя бесплатное ПО — linux + PostgreSQL ну и теперь для работы через интернет для новых конфигураций можно использовать Web сервер, скажем тот же apache.

Компания 1С безусловно молодцы. Они решили многие проблемы при минимальных затратах. Правда при этом не всегда хватает информации как всё это дело «запустить».

Здесь я попытаюсь рассмотреть различные варианты решения данного вопроса. А почему различные — потому что от версии к версии эти решения, хоть и незначительно, но отличаются.

Итак, момент первый — с чего мы начнем? Что установить в первую очередь — PostgreSQL или сам сервер 1С? Конечно же это не принципиально, но для себя я решил, что первым делом буду устанавливать PosgreSQL.

На сегодняшний день существует две основные ветки PostgreSQL для 1С. Это непосредственно дистрибутивы от 1С, а так же PostgreSQLPro. Сам я все таки отдаю предпочтение дистрибутивам от 1С, каких то определенных или значимых причин для этого нет, для меня просто удобнее, когда все необходимое находится «у меня в руках», т.е. интернет при установке практически не нужен, это ускоряет процесс установки, некоторые так же утверждают, что в такой связке 1С работает быстрее, но сам я этого не проверял. Тем не менее рассмотрю оба варианта:

Установка PostgreSQL из дистрибутива 1С

Для корректной работы PostgreSQL необходимо установить русскую локаль:

sudo locale-gen ru_RU.UTF-8
sudo localectl set-locale LANG=ru_RU.UTF-8 LC_TIME=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8

Устанавливаем библиотеку libicu55

wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb
sudo dpkg -i libicu55_55.1-7_amd64.deb

Нужно добавить репозитории в файл /etc/apt/sources.list.d/pgdg.list

echo 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' >> /etc/apt/sources.list.d/pgdg.list

Разумеется последняя команда дается от суперпользователя.

Теперь начнем установку необходимых пакетов

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common -y
sudo apt-get install libllvm9 -y
sudo dpkg -i libreadline7_7.0-3_amd64.deb
sudo apt-get install -f -y

Далее нужен будет сам установочный пакет с сайта ИТС 1С, например postgresql_14.4_1.1C_amd64_deb.tar.bz2ddon_deb.tar.bz2, как его получить я здесь не рассматриваю.

Полученный файл распаковываем

tar -xvf *amd64_deb*

Появится папка в зависимости от скаченного файла, в нашем случае postgresql-14.4-1.1C_amd64_deb, переходим в неё и устанавливаем пакеты в определенном порядке:

cd postgresql-14.4-1.1C_amd64_deb
sudo dpkg -i libpq*.deb
sudo dpkg -i postgresql-client*.deb
sudo dpkg -i postgresql-1*.deb
sudo apt-get install -f -y
#Возвращаемся
cd ..
#Удаляем уже ненужный каталог
sudo rm -R postgresql-14.4-1.1C_amd64_deb
#Зафиксируем пакеты, что бы не обновлялись
sudo apt-mark hold libpq5 postgresql-14 postgresql-client-14

#Смотрим на запущенные сервисы
systemctl --type=service | grep postgres
#Пример вывода:
#postgresql.service loaded active exited PostgreSQL RDBMS
#postgresql@14-main.service loaded active running PostgreSQL Cluster 14-main

#Зададим пароль для пользователя postgres
sudo -u postgres /usr/bin/psql -U postgres -c "alter user postgres with password 'passwordpostgres';"
sudo -u postgres /usr/bin/psql -U postgres -c "CREATE USER sa SUPERUSER PASSWORD 'passwordpostgres';"

#Имеет смысл перенести хранение временной статистики базы данных с жесткого диска в
#оперативную память (tmpfs ). Это снизит расход ресурса ssd и немного увеличит
#производительность. Данное действие не костыль и не грязный хак. Подобную рекомендацию
#можно увидеть в документации для postgres от команды postgresql pro.
sudo mkdir /var/lib/postgresql/stats_temp
sudo chown postgres:postgres /var/lib/postgresql/stats_temp

#Добавляем tmpfs диск в /etc/fstab.
sudo sed -i '$ a  tmpfs /var/lib/postgresql/stats_temp tmpfs size=512M,uid=postgres,gid=postgres 0 0n' /etc/fstab
#Пробуем подмонтировать этот диск.
sudo mount /var/lib/postgresql/stats_temp
#Проверяем, что получилось:
sudo df -h | grep stats_temp
#tmpfs 256M 0 512M 0% /var/lib/pgpro/stats_temp
#Всё в порядке, tmpfs диск подключен. Теперь надо изменить параметр в конфигурационном
#файле postgresql, который отвечает за настройку каталога для хранения временной
#статистики. Открываем файл /etc/postgresql/14/main/postgresql.conf и вносим изменение:

sudo sed -i "s#stats_temp_directory = '/var/run/postgresql/14-main.pg_stat_tmp'#stats_temp_directory = '/var/lib/postgresql/stats_temp'#" /etc/postgresql/14/main/postgresql.conf

#Ну а теперь даем возможность подключаться PosrgreSQL с любого ip адреса, что собственно не обязательно, но удобно
sudo sed -i "$ a host all all 0.0.0.0/0 passwordn" /etc/postgresql/14/main/pg_hba.conf
sudo sed -i "$ a listen_addresses = '*'n" /etc/postgresql/14/main/postgresql.conf
#Перезапускаем службу postgrespro-1c-14 для того, чтобы применить изменение.
sudo systemctl restart postgresql

Красным выделено то, что меняется в зависимости от версии устанавливаемого PostgreSQL. А здесь можно закачать готовый скрипт, он будет более правильный, чем текст на страничке.

Установка PostgreSQLPro

Установка PostgreSQLPro отличается не сильно, но все таки отличается. Основное отличие в том, что сам PostgreSQL будет закачиваться в процессе установки.

И так поехали:

Для корректной работы PostgreSQL необходимо установить русскую локаль:

sudo locale-gen ru_RU.UTF-8
sudo localectl set-locale LANG=ru_RU.UTF-8 LC_TIME=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8

Закачиваем скрипт для установки PostgreSQLPro

sudo apt install -y gnupg2
sudo apt install curl -y
curl -o pgpro-repo-add.sh https://repo.postgrespro.ru/pg1c-14/keys/pgpro-repo-add.sh

А теперь пошла сама установка:

sudo sh pgpro-repo-add.sh
sudo apt-get install postgrespro-1c-14 -y

Теперь замораживаем пакеты, что бы они не обновлялись

sudo apt-mark hold postgresql-common postgresql-client-common
sudo apt-mark hold libpq5 postgrespro-1c-14 postgrespro-1c-14-client postgrespro-1c-14-contrib postgrespro-1c-14-libs postgrespro-1c-14-server

Смотрим, что получилось

systemctl --type=service | grep postgres
#Пример вывода:
#postgrespro-1c-14.service
#Останавливаем PostgreSQL
sudo systemctl stop postgrespro-1c-14
#Удаляем файлы ранее созданного при установке кластера
#Вместо 1c-14 может быть другое название каталога, в зависимости от версии.
rm -r /var/lib/pgpro/1c-14/data/*
#Инициализируем новый кластер для 1С с нужной локалью (не обязательно, если по умолчанию локаль в системе "ru_RU.UTF-8").
sudo /opt/pgpro/1c-14/bin/pg-setup initdb --tune=1c --locale=ru_RU.UTF-8
#Запускаем PostgreSQL
sudo systemctl start postgrespro-1c-14
#Зададим пароль для пользователя postgres
sudo -u postgres /usr/bin/psql -U postgres -c "alter user postgres with password 'passwordpostgres';"
sudo -u postgres /usr/bin/psql -U postgres -c "CREATE USER sa SUPERUSER PASSWORD 'passwordpostgres';"

Дальше все как и при установке PostgreSQL от 1С:

#Имеет смысл перенести хранение временной статистики базы данных с жесткого диска в
#оперативную память (tmpfs ). Это снизит расход ресурса ssd и немного увеличит
#производительность. Данное действие не костыль и не грязный хак. Подобную рекомендацию
#можно увидеть в документации для postgres от команды postgresql pro.
sudo mkdir /var/lib/pgpro/stats_temp
sudo chown postgres:postgres /var/lib/pgpro/stats_temp
#Добавляем tmpfs диск в /etc/fstab.
sudo sed -i '$ a  tmpfs /var/lib/pgpro/stats_temp tmpfs size=512M,uid=postgres,gid=postgres 0 0n' /etc/fstab
#Пробуем подмонтировать этот диск.
sudo mount /var/lib/pgpro/stats_temp
#Проверяем, что получилось:
sudo df -h | grep stats_temp
#tmpfs 256M 0 512M 0% /var/lib/pgpro/stats_temp
#Всё в порядке, tmpfs диск подключен. Теперь надо изменить параметр в конфигурационном
#файле postgresql, который отвечает за настройку каталога для хранения временной
#статистики. Открываем файл /var/lib/pgpro/1c-14/data/postgresql.conf и вносим изменение:
sudo sed -i "$ a  stats_temp_directory = '/var/lib/pgpro/stats_temp'n" /var/lib/pgpro/1c-14/data/postgresql.conf
stats_temp_directory = '/var/lib/pgpro/stats_temp'
sudo sed -i "$ a host all all 0.0.0.0/0 passwordn" /var/lib/pgpro/1c-14/data/pg_hba.conf
sudo sed -i "$ a listen_addresses = '*'n" /var/lib/pgpro/1c-14/data/postgresql.conf
#Перезапускаем службу postgrespro-1c-14 для того, чтобы применить изменение.
sudo systemctl restart postgrespro-1c-14

Красным выделено то, что меняется при установке другой версии PostgreSQLPro.

Готовый скрипт лежит здесь.

Ну вот, PostgreSQL установлен, но удобства ради рассмотрим возможность переноса каталога с базами данных в другое место, что бы можно было сами базы хранить, ну скажем, на выделенном диске, так удобнее, как мне кажется.

Перенос места хранения для PostgreSQL от 1C

Информацию о том, в каком месте находятся базы прописана в файле postgresql.conf, который в зависимости от версии расположен по пути (здесь я рассматриваю 14 версию) /etc/postgresql/14/main/postgresql.conf

В нем указан параметр data_directory , вот его то и нужно будет изменить.

Ниже будет расположен скрипт, который то и проведет все необходимые действия:

#!/bin/bash
oldpath=$(grep "data_directory =" /etc/postgresql/14/main/postgresql.conf)
oldpath=${oldpath:18}
oldpath=${oldpath::-34}
echo 'На данный момент базы данных располагаются по пути:'
echo $oldpath
echo 'Введите путь куда нужно перенести базы данных:'
read B
sudo systemctl stop postgresql
sudo rsync -av $oldpath/ $B/
sudo mv $oldpath $oldpath.bak
#chown -R postgres:postgres $B
#chmod -R 700 $B
sudo sed -i "s#$oldpath#$B#" /etc/postgresql/14/main/postgresql.conf
sudo systemctl start postgresql

Запускать скрипт нужно будет от суперпользователя. Сам скрипт можно получить здесь.

Перенос места хранения для PostgreSQLPro

Здесь скрипт получился более универсальный, потому что версию можно получить из названия сервиса, так что скрипт подойдет для любой версии PostgreSQLPro, ничего менять не придется.

Информация о месте хранения баз находится в файле /etc/init.d/postgrespro-$ver, где переменная $ver содержит версию PostgreSQLPro, и задана она переменной PGDATA, вот её то и надо изменить:

#!/bin/bash
ver='0'
for name in $(systemctl --type=service | grep postgres); do
if [ "$ver" = '0' ];
then
ver=${name:12}
ver=${ver::-8}
echo $ver
fi
done
oldpath=$(grep PGDATA= /etc/init.d/postgrespro-$ver)
oldpath=${oldpath:7}
echo 'На данный момент базы данных располагаются по пути:'
echo $oldpath
echo 'Введите путь куда нужно перенести базы данных:'
read B
sudo systemctl stop postgrespro-$ver
sudo rsync -av $oldpath/ $B/
sudo mv $oldpath $oldpath.bak
#chown -R postgres:postgres $B
#chmod -R 700 $B
sudo sed -i 's#PGDATA='$oldpath'#PGDATA='$B'#g' /etc/init.d/postgrespro-$ver
sudo sed -i 's#PGDATA='$oldpath'#PGDATA='$B'#g' /etc/default/postgrespro-$ver
sudo systemctl start postgrespro-$ver

Запускать скрипт нужно будет от суперпользователя. Сам скрипт можно получить здесь.

Еще один важный момент: для новых PostgreSQL, при создании новой базы часто появляется ошибка — «authentication method 10 not supported», решается путем настройки PostgreSQL:

Данная ошибка связана с тем, что по умолчанию, в сборке PostgreSQL 1С, параметр “password_encryption” в файле postgresql.conf установлен в “scram-sha-256”, и в файле доступа pg_hba.conf аналогично. Так же хочу отметить, что для платформы, например, 8.3.21.1393 это не является проблемой, она работает и в режиме scram-sha-256.

Решение:

  1. В конфигурационном файле кластера postgresql.conf изменить параметр
    password_encryption = md5 # scram-sha-256 or md5
  2. В конфигурационном файле кластера pg_hba.conf изменить METHOD на md5
    Например:
    host all all 10.0.0.0/13 md5
    host replication all 10.0.0.0/13 md5
  3. Перезапустить PostgreSQL systemctl restart postgresql
  4. Обязательно обновить пароль в кластере
su - postgres
#Для PostgreSQL от 1С
/usr/lib/postgresql/14/bin/psql -E
#Для PostgreSQLPro
/usr/pgsql-14/bin/psql -E
alter user postgres with password 'new_password';

Разумеется, что нужно учитывать версию PostgreSQL в командах выше.

Ну вот, с PostgreSQL почти разобрались. Осталось решить как нам с ним взаимодействовать. Конечно можно и через терминал, но это не всегда удобно. Что бы там не говорили, но я все таки люблю наблюдать за процессом в картинках, а не в буквах и цифрах, хотя, если честно, то в данном случае это практически и не нужно. Тем неменее установим phpPgAdmin, но перед этим установим apache, причем сразу все подготовим, что бы он был оптимизирован для работы 1С через Web сервер. Итак

Установка apache

#!/bin/bash
sudo apt-get install apache2 -y
#После установки следует уточнить какой MPM-модуль использует ваш сервер:
sudo apachectl -V | grep -i mpm
#Если это будет prefork или event, то их следует отключить:
sudo a2dismod mpm_prefork
#или
sudo a2dismod mpm_event
#А затем включить модуль worker:
sudo a2enmod mpm_worker
#Затем откройте /etc/apache2/mods-available/mpm_worker.conf и внесите следующие изменения:
#StartServers 1
#MinSpareThreads 1
#MaxSpareThreads 1
sudo sed -i '/StartServers/s/2/1/g' /etc/apache2/mods-available/mpm_worker.conf
sudo sed -i '/MinSpareThreads/s/25/1/g' /etc/apache2/mods-available/mpm_worker.conf
sudo sed -i '/MaxSpareThreads/s/75/1/g' /etc/apache2/mods-available/mpm_worker.conf
#После чего перезапустите веб-сервер:
sudo service apache2 restart

Запускать скрипт нужно будет от суперпользователя. Сам скрипт можно получить здесь.

Вот теперь все готово для установки phpPgAdmin.

phpPgAdmin

Есть несколько способов его установить, но я решил пойти путем установки не через репозиторий, а через установку используя deb пакет, почему? Потому что в репозитории не всегда есть последняя версия phpPgAdmin, которая позволяет работать со «свежей» версией PostgreSQL, что у меня и получилось при выходе последнего релиза PostgreSQL 14. По этому и пришлось закачивать отдельно deb пакет. Вот ссылка на его загрузку.

#!/bin/bash
Установка
sudo dpkg -i phppgadmin_7.13.0+dfsg-2_all.deb
sudo apt-get install -f -y
sudo sed -i '/extra_login_security/s/true/false/g' /etc/phppgadmin/config.inc.php
sudo systemctl restart apache2
sudo systemctl restart postgresql

После этого можно будет запускать phpPgAdmin по адресу https://localhost/phppgadmin/

Запускать скрипт нужно будет от суперпользователя. Сам скрипт можно получить здесь.

Вот все скрипты для PostgreSQL от 1C одним архивом. А вот все скрипты для PostgreSQLPro одним архивом.

С PostgreSQL закончили. Теперь приступим к

Установка сервера 1С.

Здесь тоже есть свои подводные камни. Я разделю установку на три варианта, в зависимости от устанавливаемой платформы.

Вариант первый

До 17-платформы включительно

В этом варианте 1с устанавливалась по конкретному пути /opt/1C/v8.3/x86_64. И двух версий 1с установить бы не получилось использую стандартную установку, потому что одна версия полностью заменяла бы другую. Установку я буду рассматривать на примере платформы 8.3.17.1851 (именно такая используется в системе фреш на момент написания статьи). И так для 64-битной платформы (32-битную рассматривать не буду, уже не актуально) нужно будет с сайта ИТС 1С загрузить два архива client_8_3_17_1851.deb64.tar.gz и deb64_8_3_17_1851.tar.gz (это сервер и клиент), после чего приступаем к установке:

#!/bin/sh
sudo service srv1cv83 stop
#Распаковываем архив с 1C
tar -xvf client*
tar -xvf deb64*
dpkg -i *.deb
apt-get install -f -y
sudo rm -R ./license-tools
sudo rm *.deb
sudo chown -R usr1cv8:grp1cv8 /opt/1C
sudo service srv1cv83 start
sudo cp -f ras.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable ras
sudo systemctl start ras
sudo service srv1cv83 start
#Слежение за сервисом srv1cv83
#sudo service srv1cv83 start
#sudo service srv1cv83 stop
#service srv1cv83 status
#Слежение за сервисом ras
#sudo service ras start
#sudo service ras stop
#service ras status

Файл ras.service находится в том же каталоге, что и сам скрипт установки, а вот его содержиое:

[Unit]
Description=RAS
After=syslog.target
After=network.target
[Service]
Type=forking
WorkingDirectory=/opt/1C/v8.3/x86_64
User=usr1cv8
Group=grp1cv8
OOMScoreAdjust=-100
ExecStart=/sbin/start-stop-daemon -Sbvx /opt/1C/v8.3/x86_64/ras -- cluster
ExecRelod=/sbin/start-stop-daemon -Kvx /opt/1C/v8.3/x86_64/ras && /sbin/start-stop-daemon -Sbvx /opt/1C/v8.3/x86_64/ras -- cluster
ExecStop=/sbin/start-stop-daemon -Kvx /opt/1C/v8.3/x86_64/ras
TimeoutSec=300
Restart=always
[Install]
WantedBy=multi-user.target

Здесь находятся скрипт и файл ras.service для установки.

Вариант второй

18-ая и 19-ая платформы

Здесь уже есть изменения, связанные с возможностью устанавливать несколько платформ, т.е. теперь изменились пути расположения платформ, теперь они выглядят /opt/1cv8/x86_64/$vers/, где переменная $vers хранит версию платформы. Ну и теперь по умолчанию сервер 1с не стартует, теперь это нужно ручками сначала настроить. Описывать буду на примере платформы 8.3.18.1894.

И так для 64-битной платформы (32-битную рассматривать не буду, уже не актуально) нужно будет с сайта ИТС 1С загрузить два архива client_8_3_18_1894.deb64.tar.gz и deb64_8_3_18_1894.tar.gz (это сервер и клиент), после чего приступаем к установке:

#!/bin/bash
sudo service srv1cv83 stop
sudo service ras stop
for name in $(find . -iname client*):
do
echo $name
if [[ $name =~ "client" ]]
then
vers="1"
vers=${name:9}
vers=${vers::-14}
vers=${vers//_/.}
echo $vers
fi
done
#Распаковываем архив с 1C
tar -xvf client*
tar -xvf deb64*
dpkg -i *.deb
apt-get install -f -y
sudo rm -R ./license-tools
sudo rm *.deb
sudo chown -R usr1cv8:grp1cv8 /opt/1cv8
ln -s /opt/1cv8/x86_64/$vers/srv1cv83 /etc/init.d/srv1cv83
chmod +x /opt/1cv8/x86_64/$vers/srv1cv83
ln -s /opt/1cv8/x86_64/$vers/srv1cv83.conf etc/default/srv1cv83
sudo systemctl daemon-reload
sudo systemctl enable srv1cv83
sudo service srv1cv83 start
#Слежение за сервисом srv1cv83
#sudo service srv1cv83 start
#sudo service srv1cv83 stop
#service srv1cv83 status
sudo rm ras.service
cp ./ras1c.service ./ras.service
sudo sed -i 's|opt/1cv8/x86_64/ras|opt/1cv8/x86_64/'$vers'/ras|g' ./ras.service
sudo cp -f ras.service /etc/systemd/system/
chmod +x /etc/systemd/system/ras.service
sudo systemctl daemon-reload
sudo systemctl enable ras
sudo systemctl start ras
#Слежение за сервисом ras
#sudo service ras start
#sudo service ras stop
#service ras status

Файл ras1.service находится в том же каталоге, что и сам скрипт установки, а вот его содержиое:

[Unit]
Description=1C:Enterprise Remote Administration Service
After=network.target remote-fs.target nss-lookup.target
Requires=srv1cv83.service
[Service]
Type=simple
ExecStart=/opt/1cv8/x86_64/ras cluster --port=1545
KillSignal=SIGINT
PrivateTmp=true
Restart=on-failure
RestartSec=5
User=usr1cv8
Group=grp1cv8
[Install]
WantedBy=multi-user.target

Здесь находятся скрипт и файл ras1.service для установки.

Ну и последний третий вариант на сегодняшний день

От 20 и выше (по крайней мере до 21 точно)

Здесь изменился процесс установки, во первых теперь установочная часть в виде одного архива, а во вторых она теперь интерактивкая и графическая, повторяет интерфейс установки в системе Windows. Так же теперь немного поменялся вариант запуска сервера как сервиса.

Итак, рассмотрим на примере платформы 8.3.21.1484. Для начала закачаем с сайта ИТС 1С файл server64_8_3_21_1484.tar.gz, ну а дальше по сценарию:

#!/bin/bash
sudo service srv1cv83 stop
sudo service ras stop
#Распаковываем архив с 1C
tar -xvf server*
tar -xvf deb64*
for name in $(find . -iname setup*);
do
echo $name
if [[ $name =~ "setup" ]]
then
vers="1"
vers=${name:13}
vers=${vers::-11}
echo $vers
fi
done
sudo rm ras.service
cp ./ras1c.service ./ras.service
sudo sed -i 's|opt/1cv8/x86_64/ras|opt/1cv8/x86_64/'$vers'/ras|g' ./ras.service
./setup*.run
#dpkg -i *.deb
#apt-get install -f -y
#sudo rm -R ./license-tools
sudo rm *.pdf
sudo rm *.txt
sudo rm *.run
chown -R usr1cv8:grp1cv8 /opt/1cv8
apt install -y ttf-mscorefonts-installer
apt install -y fontconfig
fc-cache –fv
cp /opt/1cv8/x86_64/$vers/srv1cv8-$vers@.service /lib/systemd/system/srv1cv83.service
chown root:root /lib/systemd/system/srv1cv83.service
sudo systemctl daemon-reload
sudo systemctl enable srv1cv83
sudo service srv1cv83 start
#Слежение за сервисом srv1cv83
#sudo service srv1cv83 start
#sudo service srv1cv83 stop
#service srv1cv83 status
sudo cp -f ras.service /etc/systemd/system/
chmod +x /etc/systemd/system/ras.service
sudo systemctl daemon-reload
sudo systemctl enable ras
sudo systemctl start ras
#Слежение за сервисом ras
#sudo service ras start
#sudo service ras stop
#service ras status

Файл ras1.service находится в том же каталоге, что и сам скрипт установки, а вот его содержиое:

[Unit]
Description=1C:Enterprise Remote Administration Service
After=network.target remote-fs.target nss-lookup.target
Requires=srv1cv83.service
[Service]
Type=simple
ExecStart=/opt/1cv8/x86_64/ras cluster --port=1545
KillSignal=SIGINT
PrivateTmp=true
Restart=on-failure
RestartSec=5
User=usr1cv8
Group=grp1cv8
[Install]
WantedBy=multi-user.target

Здесь находятся скрипт и файл ras1.service для установки.

Ну вот собственно говоря и все. Про установку ключей я здесь вести речь не стану, это более менее стандартизированно, особо не менялось.

Так же не буду говорить как «раскидать» базу 1С по Web-у. Это уже делается непосредственно в конфигураторе 1С, все что для этого было нужно уже установлено.

Так же хочу отметить, что верно так же и то, что сервер 1С под linux позволяет работать без ключа до 12 соединений. Проверено на собственном опыте для 21-ой платформы. Конечно, в относительно крупной фирме этого использовать особо не удастся, там где скажем более 3-4 бухгалтеров и скажем от 3 и более баз 1С, но в небольшой организации, там где до 3 бухгалтеров и до 2-3 баз этим можно воспользоваться. Конечно мелкая организация наврятли позволит себе такой отдельный сервер, но покрайней мере этим могут воспользоваться программисты 1С, что бы отработать с объемной базой например. В общем факт остается фактом — существует возможность использовать сервер 1С в linux до 12 соединений без ключа, и за это огромная благодарность фирме 1С.

Единственное еще на последок здесь находится архив со скриптами по созданию новой базы 1С, по удалению существующей базы, срипт который завершает все открытые сеансы на сервере 1С, а так же скрипт по созданию резервных копий баз 1С.

И напоследок еще один бонус: на Linux не печатаеся штрих-код

Помогает исправить ситуацию под Ubuntu 19.04, 19.10 и 20.04 Клиент-серверная база

sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка ash на приставке цифрового телевидения globo
  • Ошибка audio system was not initialized correctly error code 0