1 在githu上創(chuàng)建一個repository dly/gp_test
網(wǎng)址: https://github.com/lydu/gp_test
2 本地項目和遠(yuǎn)程的github關(guān)聯(lián),可以pull/push(目前使用的centos7創(chuàng)建本地項目)
yum install - y git
mkdir /opt/gp_test
cd /opt/gp_test
執(zhí)行下列命令:
echo "# gp_test" >> README.md
git init
git add README.md
git commit -m "first commit"
git config --global user.name "lydu"
git config --global user.email xxx@163.com
git commit --amend --reset-author
git remote add origin https://github.com/lydu/gp_test.git
git push -u origin master
unset SSH_ASKPASS
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Permission denied (publickey).
解決方案是github上添加一個公鑰
解決方案
3. 在本地創(chuàng)建應(yīng)用商店腳本
cd /opt/gp_test
mkdir templates
cd templates
mkdir gp_test
cd gp_test
vi config.yml
name: Weds_Greenplum
description: |
Greenplum images
version: 1.0.0
category: demo
maintainer: weds
license: demo:v1.0.0
projectURL: https://github.com/lydu/gp_test
vi README.md
WS
touch classroom.svg
mkdir 0
cd 0
vi docker-compose.yml
version: '2'
services:
gpmaster:
image: 10.0.0.96:5000/database/centos_gp:latest
hostname: master
labels:
io.rancher.scheduler.global: 'true'
io.rancher.scheduler.affinity:host_label: key1=102
networks:
- docker_gwbridge
ports:
- "11000:5432"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
privileged: true
tty: true
gpnode1:
image: 10.0.0.96:5000/database/centos_gp:latest
hostname: sdw1
labels:
io.rancher.scheduler.global: 'true'
io.rancher.scheduler.affinity:host_label: key1=104
networks:
- docker_gwbridge
ports:
- "11001:5432"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
privileged: true
tty: true
gpnode2:
image: 10.0.0.96:5000/database/centos_gp:latest
hostname: sdw2
labels:
io.rancher.scheduler.global: 'true'
io.rancher.scheduler.affinity:host_label: key1=110
networks:
- docker_gwbridge
ports:
- "11002:5432"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
privileged: true
tty: true
vi rancher-compose.yml
version: '2'
.catalog:
name: "greenplum_1"
version: "v0.0.1"
description: "public service for test."
uuid: public-0
minimum_rancher_version: v1.0.0
services:
gpmaster:
scale: 1
start_on_create: true
labels:
io.rancher.container.requested_ip: "10.42.200.202"
gpnode1:
scale: 1
start_on_create: true
labels:
io.rancher.container.requested_ip: "10.42.200.203"
gpnode2:
scale: 1
start_on_create: true
labels:
io.rancher.container.requested_ip: "10.42.200.204"
最后的結(jié)構(gòu)是這樣的
cd /opt/gp_test
.
└── templates
└── gp_test
├── 0
│ ├── docker-compose.yml
│ └── rancher-compose.yml
├── classroom.svg
├── config.yml
└── README.md
4 上傳到遠(yuǎn)程github
cd /opt/gp_test
git add ./templates
git commit -m "first commit"
git push -u origin master
5 配置rancher
在rancher的系統(tǒng)管理->系統(tǒng)設(shè)置 添加應(yīng)用学赛,
6 查看應(yīng)用商店葡秒,就可以看到自己創(chuàng)建的應(yīng)用商店了
這里的docker-compose.yml和rancher-compose.yml 是根據(jù)自己的rancher環(huán)境搭建的报破, 可以參考參數(shù)的使用。