使用docker compose构建presto集群时面临的问题docker compose还将hive元存储作为独立服务运行。群集无法连接到配置单元元存储。
它抛出一个错误:
coordinator | Caused by: org.apache.thrift.transport.TTransportException: localhost:9083: java.net.ConnectException: Connection refused (Connection refused)
coordinator | at io.prestosql.plugin.hive.metastore.thrift.Transport.rewriteException(Transport.java:96)
coordinator | at io.prestosql.plugin.hive.metastore.thrift.Transport.create(Transport.java:55)
coordinator | at io.prestosql.plugin.hive.metastore.thrift.DefaultThriftMetastoreClientFactory.createTransport(DefaultThriftMetastoreClientFactory.java:110)
coordinator | at io.prestosql.plugin.hive.metastore.thrift.DefaultThriftMetastoreClientFactory.create(DefaultThriftMetastoreClientFactory.java:97)
coordinator | at io.prestosql.plugin.hive.metastore.thrift.StaticMetastoreLocator.getClient(StaticMetastoreLocator.java:110)
coordinator | at io.prestosql.plugin.hive.metastore.thrift.StaticMetastoreLocator.createMetastoreClient(StaticMetastoreLocator.java:98)
docker-compose.yml用于创建一个具有独立配置单元元存储服务的工作集群。
version: '3'
services:
coordinator:
image: "presto-coordinator:345"
ports:
- "8080:8080"
container_name: "coordinator"
command: http://coordinator:8080 coordinator
worker0:
image: "presto-worker:345"
container_name: "worker0"
ports:
- "8081:8081"
command: http://coordinator:8080 worker0
mariadb:
image: mariadb:latest
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_DATABASE: metastore_db
hive-metastore:
image: "hive:3.0.0"
ports:
- "9083:9083"
depends_on:
- mariadb
presto集群中的hive.properties
connector.name=hive-hadoop2
hive.metastore.uri=thrift://localhost:9083
hive.metastore.username=hive
hive.allow-drop-table=true
metastore-site.xml
<configuration>
<property>
<name>metastore.thrift.uris</name>
<value>thrift://localhost:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
<property>
<name>metastore.thrift.port</name>
<value>9083</value>
</property>
<property>
<name>metastore.task.threads.always</name>
<value>org.apache.hadoop.hive.metastore.events.EventCleanerTask,org.apache.hadoop.hive.metastore.MaterializationsCacheCleanerTask</value>
</property>
<property>
<name>metastore.expression.proxy</name>
<value>org.apache.hadoop.hive.metastore.DefaultPartitionExpressionProxy</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://mariadb:3306/metastore_db</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>admin</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>admin</value>
</property>
<property>
<name>metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
</property>
端口9083暴露在配置单元元存储映像中,因此不确定拒绝连接的原因。有人能帮忙吗?
暂无答案!
目前还没有任何答案,快来回答吧!