0

I have an Amazon EC2 instance where I have spun up a hadoop and hive cluster and have initialized postgres inside of a docker container. However, when I run the following code to initialize the hive metastore in postgres I get the following message about altering the pg_hba.conf file

Administrator:~/environment $ schematool -dbType postgres -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/apache-hive-3.1.3-bin/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-3.3.4/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:        jdbc:postgresql://localhost:6432/metastore
Metastore Connection Driver :    org.postgresql.Driver
Metastore connection User:       hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: org.postgresql.util.PSQLException : The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.
SQL Error code: 0
Use --verbose for detailed stacktrace.
*** schemaTool failed ***

I have been able to log directly onto the container in order to alter the file in accordance with suggestions from this Post. I located the file in this path within the container /var/lib/postgresql/data/pg_hba.conf I attempted to edit it with vim, but it seems like everything in the file is already set to accept local connections. Please advise how to resolve the issue so that I can run the schematool -dbType postgres -initSchema command

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

host all all all scram-sha-256
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
woodardj0303
  • 31
  • 1
  • 4
  • It might accept local connections, but that apparently is not what you are using. Your connection string says 'localhost', which is a type of host connection, not a local connection. (Although the port suggests you are using pgbouncer, at which point we need to know the pgbouncer config, not just the PostgreSQL config.) – jjanes Feb 23 '23 at 18:11
  • What you see is the default setting of the file. The error message directs me to alter the file so that it "includes the client's IP address or subnet, and that it is using an authentication scheme supported by the driver." The only Ip address I ahve been working with is the 127.0.0.1 though I have been using various ports in this project. Im also not sure if in this case Postgres or Hive is supposed to be the client, or maybe I misunderstood that portion of the message. Im running this directly inan ec2 instance on Ubuntu. I am also looking for pgbouncer for the time being – woodardj0303 Feb 23 '23 at 21:07
  • True, I was only looking at the 'local' line and the last line, not the previous ones that specified localhost (in its ipv4 and ipv6 spellings) as the host with trust. The hint included in the error message is just a hint. Whoever wrote it is not intimately familiar with your network or configuration, or with your pgbouncer (if you are using that--that is usually what 6432 means but you could use that port just on a lark if you wanted to)--a hint cannot provide consulting services. – jjanes Feb 24 '23 at 00:02
  • SCRAM was added to PostgreSQL in v10, which is now out of support. You should not be using drivers that old. You should hunt down the driver you are using, and figure out how to upgrade it. I don't know if it comes with hive, or hadoop, or what, in your setup. – jjanes Feb 24 '23 at 00:10
  • I got this version of Postgres by running "Docker pull postgres" do I need to uninstall it from the container and reinstall an updated version or just try to update the driver? – woodardj0303 Feb 24 '23 at 17:21
  • That docker pull installs the server, not the driver. The driver would, presumably, come with all the apache stuff as a dependency. – jjanes Feb 25 '23 at 14:19

0 Answers0