Db2 Warehouse 클라이언트 컨테이너를 Mac에서 디버깅하여 사용해 보십시오.
11824 단어 dashDBdocker-for-macdb2warehouse
전제 사항
IBM Db2 Warehouse 클라이언트 컨테이너의 디자인(Windows 및 Mac)
1. Docker Desktop for Mac 설치(보충)
Docker Desktop for Mac의 설치, @kurkuru씨의 여기 기사.는 매우 알기 쉽다.계좌 만드는 법도 실었다.
보충으로 다운로드한 Docker입니다.dmg를 두 번 클릭하면 아래에서 흔히 볼 수 있는 화면이 나타나 Applications에 끌어다 놓습니다.
docker version
Asukas-MacBook-Pro:~ asukasaito$ docker version
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:18:17 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.1
API version: 1.40 (minimum version 1.12)
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:17:52 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683
Asukas-MacBook-Pro:~ asukasaito$
2. Db2 Warehouse Center 설계2-1. Docker hub에 로그인하여 "IBM Db2 Warehouse client container"를 검색하고 "Proceed to Checkout"단추를 클릭합니다.
2-2. 확인란을 선택하고 Get Content 버튼을 클릭합니다.
2-3. docker pull 명령을 표시하고 복사합니다.
왼쪽에 프로그램 설계가 기재되어 있다.
2-4. 터미널에서 다음 명령을 실행합니다.
docker login
메일 주소가 아닌 ID를 입력하는 Username에 대한 질문을 받았습니다.Asukas-MacBook-Pro:~ asukasaito$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: nyasuka
Password:
Login Succeeded
Asukas-MacBook-Pro:~ asukasaito$
2-5. 방금 복사한 명령,pull 용기를 실행합니다.docker pull store/ibmcorp/db2wh_ce:v3.9.0-db2wh_client-linux
Asukas-MacBook-Pro:~ asukasaito$ docker pull store/ibmcorp/db2wh_ce:v3.9.0-db2wh_client-linux
v3.9.0-db2wh_client-linux: Pulling from store/ibmcorp/db2wh_ce
ac9208207ada: Pull complete
661770f66751: Pull complete
2b761f736211: Pull complete
30c29bd1de27: Pull complete
:
中略
:
6b1802478176: Pull complete
3195632521ef: Pull complete
Digest: sha256:ae3b4388b601b0d4b55d9f0af72acdbfafb2d3ffe002158b1347350a170a8a43
Status: Downloaded newer image for store/ibmcorp/db2wh_ce:v3.9.0-db2wh_client-linux
docker.io/store/ibmcorp/db2wh_ce:v3.9.0-db2wh_client-linux
Asukas-MacBook-Pro:~ asukasaito$
2-6. 나는 Docker를 친다.docker run -itd --net=host -v db2wh_vol:/mnt/clientdir --name=client -e REMOTE_DB=XXX.XXX.XXX.XXX:50000 store/ibmcorp/db2wh_ce:v3.9.0-db2wh_client-linux
-e REMOTE_런에서 DB를 지정하지 않아도 됩니다.그런 경우는 나중에 추가해.-e REMOTE_DB= 접속 대상의 호스트 이름 또는 IP: 포트 번호
Asukas-MacBook-Pro:~ asukasaito$ docker run -itd --net=host -v db2wh_vol:/mnt/clientdir --name=client -e REMOTE_DB=XXX.XXX.XXX.XXX:50000 store/ibmcorp/db2wh_ce:v3.9.0-db2wh_client-linux
b349f8122a48f6c444d0827fb2f3e5219a3c79410b3061d481f906149a151501
Asukas-MacBook-Pro:~ asukasaito$
2-7. 일지를 확인하다.docker logs --follow client
Asukas-MacBook-Pro:~ asukasaito$ docker logs --follow client
Starting up IBM Db2 Warehouse client container...
Creating Db2 client instance home and setup user environment
Creating client container directory structure and setup access controls
Creating the database client instance ...
Running connectivity test against remote database server: XXX.XXX.XXX.XXX port 50000 ...
Cataloging the remote database from XXX.XXX.XXX.XXX ...
The remote database cataloged successfully as: BLUDB
Retrieving alias information...
ALIAS | DATABASE | PORT | SSL | HOSTNAME
----------+----------+-------+-----+--------------
BLUDB | BLUDB | 50000 | NO | XXX.XXX.XXX.XXX
#######################################################################
### IBM Db2 Warehouse client container was deployed successfully ###
#######################################################################
* If you used docker logs to monitor progress,
detach from the console by pressing Ctrl+C.
* To get a command line from a prompt on the host,
issue the following command:
docker exec -it <client container name> cli
#######################################################################
[IBM Db2 Warehouse client container was deployed successfully]가 표시되면 control+c 를 입력하여 로그 표시를 종료합니다.2-8. 클라이언트 컨테이너에 연결합니다.
docker exec -it client cli
Asukas-MacBook-Pro:~ asukasaito$ docker exec -it client cli
***********************************************************************
* *
* Welcome to IBM Db2 Warehouse client container interactive CLI *
* *
***********************************************************************
Last login: Fri Aug 9 05:47:53 UTC 2019 on pts/0
[Db2wh - Client CLI ~]\>
2-9. run에 추가된 연결 정보를 데이터베이스에 연결합니다.db2 connect to BLUDB user bluadmin using パスワード
[Db2wh - Client CLI ~]\> db2 connect to BLUDB user bluadmin using パスワード
Database Connection Information
Database server = DB2/LINUXX8664 11.1.9.0
SQL authorization ID = BLUADMIN
Local database alias = BLUDB
[Db2wh - Client CLI ~]\>
(선택 가능) 2-10입니다.SQL을 발행해 보십시오.[Db2wh - Client CLI ~]\> db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 11.1.4.4
You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => SELECT COUNT(*) FROM PREFECTURES;
1
---------------------------------
47.
1 record(s) selected.
db2 =>
3. 접속 정보 증가런시 추가된 연결 정보와 다른 정보를 추가하려면 다음과 같은 방법을 사용합니다.
db_catalog --add XXX.XXX.XXX.XXX:50000
다음 명령 실행을 확인합니다.db_catalog -l
[Db2wh - Client CLI ~]\> db_catalog --add XXX.XXX.XXX.XXX:50000
Running connectivity test against remote database server: XXX.XXX.XXX.XXX port 50000 ...
Cataloging the remote database from XXX.XXX.XXX.XXX ...
The remote database cataloged successfully as: BLUDB_29
[Db2wh - Client CLI ~]\> db_catalog -l
Retrieving alias information...
ALIAS | DATABASE | PORT | SSL | HOSTNAME
----------+----------+-------+-----+--------------
BLUDB_29 | BLUDB | 50000 | NO | XXX.XXX.XXX.XXX
BLUDB | BLUDB | 50000 | NO | XXX.XXX.XXX.XXX
[Db2wh - Client CLI ~]\>
지금까지 Db2 Warehouse 클라이언트 컨테이너를 Mac에 디버깅하여 사용해 보았습니다.Reference
이 문제에 관하여(Db2 Warehouse 클라이언트 컨테이너를 Mac에서 디버깅하여 사용해 보십시오.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/Asuka_Saito/items/7d1fc1357a0af547305e텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)