使用 Tsuru 和 Docker 构建自己的 PaaS 系统
2014-05-16 00:00
246 查看
摘要: 该文档描述如何使用 Tsuru 和 Docker 构建自己的私有 PaaS 服务。
文档假设你已经在64位的 Ubuntu 12.04 LTS 上安装了 Tsuru。
这样它们就从 basebuilder 被安装到你指定的系统中,例如 Python:
文档假设你已经在64位的 Ubuntu 12.04 LTS 上安装了 Tsuru。
安装之前
开始安装之前,需要先安装 curl 和 python-software-properties 两个软件包,这两个软件包用来安装额外的资源库。sudo apt-get update sudo apt-get install curl python-software-properties -qqy
添加资源库
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 echo "deb http://get.docker.io/ubuntu docker main" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt-add-repository ppa:tsuru/lvm2 -y sudo apt-add-repository ppa:tsuru/ppa -y sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee /etc/apt/sources.list.d/mongodb.list sudo apt-get update
安装 MongoDB
sudo apt-get install mongodb-10gen -qqy
安装 beanstalkd
sudo apt-get install beanstalkd -qqy cat > /tmp/default-beanstalkd <<EOF > BEANSTALKD_LISTEN_ADDR=127.0.0.1 > BEANSTALKD_LISTEN_PORT=11300 > DAEMON_OPTS="-l \$BEANSTALKD_LISTEN_ADDR -p \$BEANSTALKD_LISTEN_PORT -b /var/lib/beanstalkd" > START=yes > EOF sudo mv /tmp/default-beanstalkd /etc/default/beanstalkd sudo service beanstalkd start
安装 redis
sudo apt-get install redis-server -qqy
安装 hipache
sudo apt-get install node-hipache -qqy sudo start hipache
安装 docker
sudo apt-get install lxc-docker -qqyecho export DOCKER_OPTS=\"-H 127.0.0.1:4243\" | sudo tee -a /etc/default/dockerecho export DOCKER_HOST=127.0.0.1:4243 >> ~/.bashrc sudo stop docker sudo start docker
安装 gandalf
sudo apt-get install gandalf-server -qqyhook_dir=/home/git/bare-template/hooks sudo mkdir -p $hook_dirsudo curl https://raw.githubusercontent.com/tsuru/tsuru/master/misc/git-hooks/post-receive -o ${hook_dir}/post-receive sudo&n 3ff0 bsp;chmod +x ${hook_dir}/post-receive sudo chown -R git:git /home/git/bare-template# make sure you write the public IP of the machine in the "host" parameter# in the /etc/gandalf.conf filesudo start gandalf-server sudo start git-daemon
安装 tsuru API server
sudo apt-get install tsuru-server -qqy sudo curl http://script.cloud.tsuru.io/conf/tsuru-docker-single.conf -o /etc/tsuru/tsuru.conf# make sure you replace all occurrences of {{{HOST_IP}}} with the machine's# public IP in the /etc/tsuru/tsuru.conf filesudo sed -i -e 's/=no/=yes/' /etc/default/tsuru-server sudo start tsuru-ssh-agent sudo start tsuru-server-api sudo start tsuru-server-collector
平台安装
curl https://raw.githubusercontent.com/tsuru/tsuru/master/misc/platforms-setup.js | mongo tsuru
这样它们就从 basebuilder 被安装到你指定的系统中,例如 Python:
docker build --no-cache -t tsuru/python https://raw.githubusercontent.com/flaviamissi/basebuilder/master/python/Dockerfile[/code] 将 Python 替换成其他平台(你可以检查 basebuilder 来获取支持的平台列表).使用 tsuru 客户端
恭喜你,现在你已经有一个可以运行的 tsuru 服务器了,你可以参考 tsuru client usage guide 来开始构建你的应用程序。添加服务
这里有一份完整的关于如何一步步的安装 MySQL 服务的文档:Install and configure a MySQL service.DNS 服务器
你也可以给 Tsuru 集成一个 DNS 服务器,可参考 Here you can find an example of using bind as a DNS forwarder, 与 Tsuru 进行集成。
原文地址: http://www.oschina.net/translate/build-your-own-paas-with-tsuru-and-docker
相关文章推荐
- docker筑基篇-03-使用docker-commit构建自己的镜像
- 使用jenkins、docker、consul、nginx搭建支持自动化构建部署以及弹性伸缩的集群系统详细教程
- docker筑基篇-04-使用Dockerfile构建自己的镜像
- 使用Dockerfile文件构建基于centOS系统的tomcat镜像
- How-to: 使用 highcharts + MySQL 构建自己的简易网站监控系统
- 使用dockerfile构建自己的镜像
- 使用.net core ABP和Angular模板构建博客管理系统(实现自己的业务逻辑)
- 使用Dockerfile构建自己的etcd镜像
- 搭建自己私有的PKM系统,各家PKM大比拼。。附:构建自己熟悉的基础Docker,破解联通光猫
- 使用Docker构建ELK Docker集群日志收集系统
- 使用Docker和saltstack构建运维paas管理平台
- 为自己的ASP网站系统构建一套标记语言
- 使用 Linux 系统调用的内核命令--探究 SCI 并添加自己的调用
- 【翻译】使用AIR构建的汽车诊断系统Car Diagnostic System built in Adobe AIR
- 使用 FUSE 开发自己的文件系统
- 如何使用Phantom系统构建和维护软件测试环境
- 使用.net Remoting技术构建应用系统架构系列(2)
- 为自己的ASP网站系统构建一套标记语言
- 在自己的MIS系统使用简单的加密功能加密基本数据
- 使用Postfix构建基于FreeBSD的邮件系统(简化版)