728x90
๋ฐ์ํ
๐ก JDBC ๋๋ผ์ด๋ฒ๋ฅผ ์ฌ์ฉํ ์ ์๋์?
Kudu๋ SQL ์์ง์ด ์๋๋ผ ๋จ๋ ์ฌ์ฉ์ ๋ถ๊ฐํ๋ ํจ๊ป ์ฌ์ฉ๋๋ SQL ์์ง์ ๋ฐ๋ผ ์ฌ์ฉํ ์ ์๊ธฐ์ ์ ํ๋ฆฌ์ผ์ด์ ๊ฐ๋ฐ์ ์ํด์๋ Client API๋ฅผ ์ฌ์ฉํ๊ฑฐ๋ SQL ์์ง๊ณผ ํจ๊ป ์ฌ์ฉํ์ฌ์ผ ํ๋ค. ํด๋น ์์ ๋ Kudu ๋จ๋ ์ผ๋ก ์ฌ์ฉํ๋ Java API์ ๋ํ ์ค๋ช ์ด๋ค.
Quick Start
https://github.com/apache/kudu/tree/master/examples/java/java-example
๋ค๋ฅธ ์๋ฒ Docker Kudu ์ฌ์ฉ
๋ก์ปฌ ์๋ฒ Docker Kudu๋ localhost๋ก ๋ฐ๋ก ๋ถ์ผ๋ฉด ๋์ง๋ง ๋ค๋ฅธ ์๋ฒ Docker Kudu๋ Docker Hosts์ kudu-master ์ค์ ์ด ํ์ํ๋ค.
Kudu rpc_address ์ธ๊ฐ ๋ชจ๋ hosts ํ์ผ์ ์์ฑ
# ํ์ผ ์์น : C:\\Windows\\System32\\drivers\\etc\\hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
# Added by Docker Desktop
192.168.10.XXX host.docker.internal
192.168.10.XXX gateway.docker.internal
192.168.10.XXX kudu-master-1 # Kudu rpc_address
192.168.10.XXX kudu-master-2 # Kudu rpc_address
192.168.10.XXX kudu-master-3 # Kudu rpc_address
# To allow the same kube context to work on the host and the container:
XXX.X.X.X kubernetes.docker.internal
# End of section
Kudu Master Addrees ์์ฑ
private static final String DOCKER_URL = "192.168.10.204";
private static final String KUDU_MASTERS = System.getProperty("KUDU_MASTERS", DOCKER_URL+":7051,"+DOCKER_URL+":7151,"+DOCKER_URL+":7251");
//OR
List<String> masterAddresses = new ArrayList<>();
masterAddresses.add("192.168.10.204:7051");
masterAddresses.add("192.168.10.204:7151");
masterAddresses.add("192.168.10.204:7251");
pom.xml
# ํ์ผ ์์น : C:\Windows\System32\drivers\etc\hosts
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
# Added by Docker Desktop
192.168.10.XXX host.docker.internal
192.168.10.XXX gateway.docker.internal
192.168.10.XXX kudu-master-1 # Kudu rpc_address
192.168.10.XXX kudu-master-2 # Kudu rpc_address
192.168.10.XXX kudu-master-3 # Kudu rpc_address
# To allow the same kube context to work on the host and the container:
XXX.X.X.X kubernetes.docker.internal
# End of section
Error Log ํ๊ธ ๊นจ์ง
slf4j๋ผ์ด๋ธ๋ฌ๋ฆฌ ํธํ์ฑ ๋ฌธ์ ๋ก Java Version์ 1.8์์ 11๋ก ์ฌ๋ ธ๋๋ ํ๊ธ์ด ๊นจ์ง์ง ์์๋ค.
728x90
๋ฐ์ํ
'๋น ๋ฐ์ดํฐDB' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Apache Impala + Kudu Query (0) | 2024.02.01 |
---|---|
Kudu ๋ ๋ฆฝ์ ์ธ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฌ์ฉ (1) | 2024.02.01 |
Presto JDBC ์ฐ๊ฒฐ (1) | 2024.01.23 |
Single Store JDBC ์ฐ๊ฒฐ (0) | 2024.01.23 |
Hive Create Update Delete Select Table (0) | 2024.01.23 |