-
Notifications
You must be signed in to change notification settings - Fork 7
빌링 서비스 및 오픈소스 도구 Pass 연계 메뉴얼
Kill Bill 0.18.1 도커 시작하기:
docker run -ti -p 8080:8080 killbill/killbill:0.18.1
도커 컨테이너의 ip 주소를 알아내기 위해서는 docker-machine env <name>
또는 환경변수 $DOCKER_HOST
를 사용하도록 한다.
- base/latest: shared base image with Tomcat 7 and KPM inside Ubuntu 14.04
- killbill/latest: empty base Kill Bill image. The first time it is started, the latest version of Kill Bill is downloaded
- killbill/tagged: image with Kill Bill installed (published on Docker Hub)
- kaui/latest: empty base Kaui image. The first time it is started, the latest version of Kaui is downloaded
- kaui/tagged: image with Kaui installed (published on Docker Hub)
- killbill/build: official build environment for all published Kill Bill artifacts (useful for developers)
공용 환경 변수 일람:
-
KILLBILL_JVM_PERM_SIZE
(default512m
) -
KILLBILL_JVM_MAX_PERM_SIZE
(default1G
) -
KILLBILL_JVM_XMS
(default1G
) -
KILLBILL_JVM_XMX
(default2G
) -
KILLBILL_JVM_CMS_INITIATING_OCCUPANCY_FRACTION
(default70
) -
KPM_PROPS
(default--verify-sha1
) -
NEXUS_URL
(defaulthttps://oss.sonatype.org
) -
NEXUS_REPOSITORY
(defaultreleases
)
킬빌 컨피그레이션 환경 변수:
-
KILLBILL_CONFIG_DAO_URL
(defaultjdbc:h2:file:/var/lib/killbill/killbill;MODE=MYSQL;DB_CLOSE_DELAY=-1;MVCC=true;DB_CLOSE_ON_EXIT=FALSE
) -
KILLBILL_CONFIG_DAO_USER
(defaultkillbill
) -
KILLBILL_CONFIG_DAO_PASSWORD
(defaultkillbill
) -
KILLBILL_CONFIG_OSGI_DAO_URL
(default$KILLBILL_CONFIG_DAO_URL
) -
KILLBILL_CONFIG_OSGI_DAO_USER
(default$KILLBILL_CONFIG_DAO_USER
) -
KILLBILL_CONFIG_OSGI_DAO_PASSWORD
(default$KILLBILL_CONFIG_OSGI_DAO_PASSWORD
) -
KILLBILL_SERVER_BASE_URL
(defaulthttp://localhost:8080
) -
KILLBILL_SHIRO_RESOURCE_PATH
(defaultclasspath:shiro.ini
) -
KILLBILL_SERVER_TEST_MODE
(defaulttrue
) -
KILLBILL_METRICS_GRAPHITE
(defaultfalse
) -
KILLBILL_METRICS_GRAPHITE_HOST
(defaultlocalhost
) -
KILLBILL_METRICS_GRAPHITE_PORT
(default2003
) -
KILLBILL_QUEUE_CREATOR_NAME
(no default is specified, Kill Bill will use the hostname) -
KILLBILL_SHIRO_NB_HASH_ITERATIONS
(same default value from KillBill SecurityConfig (200000))
Kaui 환경 변수:
-
KAUI_KILLBILL_URL
(defaulthttp://127.0.0.1:8080
) -
KAUI_KILLBILL_API_KEY
(defaultbob
) -
KAUI_KILLBILL_API_SECRET
(defaultlazar
) -
KAUI_CONFIG_DAO_URL
(defaultjdbc:mysql://localhost:3306/kaui
) -
KAUI_CONFIG_DAO_USER
(defaultkaui
) -
KAUI_CONFIG_DAO_PASSWORD
(defaultkaui
) -
KAUI_CONFIG_DEMO
(defaultfalse
)
주의: bug in Sonatype where the sha1 is sometimes wrong. sha1 verification 를 해제하기 위해서, 도커 컨테이너 시작시 다음의 변수를 넣도록한다.: KPM_PROPS="--verify-sha1=false"
.
Configuration of the images is driven by the kpm.yml.erb KPM configuration file. Advanced users may need to extend it beyond the plugin properties exposed. To do so, you can create an overlay file as $KILLBILL_CONFIG/kpm.yml.erb.overlay
: both files will be merged at startup, with the overlay having precedence. Take a look at our testing image for an example.
아마존 RDS 대신 mysql 서버를 container 로 띄우고, RDS 라고 가정하도록 한다.
Kill Bill server version 0.16.7
과 mysql container 로 배포 테스트를 진행하도록 한다.
- Start the mysql container:
docker run -tid --name db -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=killbill mariadb
- Configure the database:
데이터베이스의 binlog_format
을 Row
로 설정하도록 한다.
echo "set global binlog_format = 'ROW'" | docker exec -i db mysql -h localhost -uroot -proot
DDLs 를 추가한다.:
-
Kill Bill DDL
curl -s http://docs.killbill.io/0.16/ddl.sql | docker exec -i db mysql -h localhost -uroot -proot -D killbill
-
Analytics DDL
curl -s https://raw.githubusercontent.com/killbill/killbill-analytics-plugin/master/src/main/resources/org/killbill/billing/plugin/analytics/ddl.sql | docker exec -i db mysql -h localhost -uroot -proot -D killbill
-
Stripe DDL
curl -s https://raw.githubusercontent.com/killbill/killbill-stripe-plugin/master/db/ddl.sql | docker exec -i db mysql -h localhost -uroot -proot -D killbill
-
analytics
andstripe
플러그인을 포함하여 킬빌 container 를 생성한다.:
docker run -tid \
--name killbill_0_16_0 \
-p 8080:8080 \
-p 12345:12345 \
--link db:dbserver \
-e KILLBILL_CONFIG_DAO_URL=jdbc:mysql://dbserver:3306/killbill \
-e KILLBILL_CONFIG_DAO_USER=root \
-e KILLBILL_CONFIG_DAO_PASSWORD=root \
-e KILLBILL_CONFIG_OSGI_DAO_URL=jdbc:mysql://dbserver:3306/killbill \
-e KILLBILL_CONFIG_OSGI_DAO_USER=root \
-e KILLBILL_CONFIG_OSGI_DAO_PASSWORD=root \
-e KILLBILL_PLUGIN_ANALYTICS=1 \
-e KILLBILL_PLUGIN_STRIPE=1 \
killbill/killbill:0.16.7
- Play time...
curl -v \
-X POST \
-u admin:password \
-H 'Content-Type: application/json' \
-H 'X-Killbill-CreatedBy: admin' \
-d '{"apiKey": "bob", "apiSecret": "lazar"}' \
"http://$(docker-machine ip default):8080/1.0/kb/tenants"
위 과정과 유사하게 Kaui 배포를 진행하도록 한다.:
- Configure the database:
- Create a new database for KAUI
echo "create database kaui;" | docker exec -i db mysql -h localhost -uroot -proot
- Add the DDL for KAUI
curl -s https://raw.githubusercontent.com/killbill/killbill-admin-ui/master/db/ddl.sql | docker exec -i db mysql -h localhost -uroot -proot -D kaui
- Add the initial
admin
user in theKAUI
database:
echo "insert into kaui_allowed_users (kb_username, description, created_at, updated_at) values ('admin', 'super admin', NOW(), NOW());" | docker exec -i db mysql -h localhost -uroot -proot -D kaui
- Start the KAUI container:
docker run -tid \
--name kaui_0_7_0 \
-p 8989:8080 \
--link db:dbserver \
--link killbill_0_16_0:killbill \
-e KAUI_KILLBILL_URL=http://killbill:8080 \
-e KAUI_KILLBILL_API_KEY= \
-e KAUI_KILLBILL_API_SECRET= \
-e KAUI_CONFIG_DAO_URL=jdbc:mysql://dbserver:3306/kaui \
-e KAUI_CONFIG_DAO_USER=root \
-e KAUI_CONFIG_DAO_PASSWORD=root \
killbill/kaui:0.7.0
- More Play time... with KAUI
KAUI 는 다음 url 로 접근가능하다. : http://IP:8989/
where IP=$(docker-machine ip default)
. 최초 로그인은 admin/password
이다.