1 在githu上创建一个repository dly/gp_test
网址: https://github.com/lydu/gp_test
2 本地项目和远程的github关联,可以pull/push(目前使用的centos7创建本地项目)
yum install - y git
mkdir /opt/gp_test
cd /opt/gp_test
执行下列命令:
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. 在本地创建应用商店脚本
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"
最后的结构是这样的
cd /opt/gp_test
.
└── templates
└── gp_test
├── 0
│ ├── docker-compose.yml
│ └── rancher-compose.yml
├── classroom.svg
├── config.yml
└── README.md
4 上传到远程github
cd /opt/gp_test
git add ./templates
git commit -m "first commit"
git push -u origin master
捕获1.PNG
5 配置rancher
在rancher的系统管理->系统设置 添加应用,
捕获2.PNG
6 查看应用商店,就可以看到自己创建的应用商店了
这里的docker-compose.yml和rancher-compose.yml 是根据自己的rancher环境搭建的, 可以参考参数的使用。
网友评论