阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

使用 Tsuru 和 Docker 构建自己的 PaaS 系统

122次阅读
没有评论

共计 2972 个字符,预计需要花费 8 分钟才能阅读完成。

该文档描述如何使用 Tsuru 和 Docker 构建自己的私有 PaaS 服务。

文档假设你已经在 64 位的 Ubuntu 12.04 LTS 上安装了 Tsuru。

开源项目 Docker,Red Hat 新的虚拟化选择 http://www.linuxidc.com/Linux/2013-10/91051.htm

dockerlite: 轻量级 Linux 虚拟化 http://www.linuxidc.com/Linux/2013-07/87093.htm

Docker 的搭建 Gitlab CI 全过程详解 http://www.linuxidc.com/Linux/2013-12/93537.htm

Docker 和一个正常的虚拟机有何区别? http://www.linuxidc.com/Linux/2013-12/93740.htm

Docker 将改变所有事情 http://www.linuxidc.com/Linux/2013-12/93998.htm

安装之前

开始安装之前,需要先安装 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 36A1D7869245C8950F966E92D8576A8BA88D21E9echo “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 7F0CEB10echo “deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen” | sudo tee /etc/apt/sources.list.d/mongodb.list

sudo apt-get update

安装 beanstalkd

sudo apt-get install beanstalkd -qqy
cat > /tmp/default-beanstalkd <<EOFBEANSTALKD_LISTEN_ADDR=127.0.0.1BEANSTALKD_LISTEN_PORT=11300DAEMON_OPTS=”-l \$BEANSTALKD_LISTEN_ADDR -p \$BEANSTALKD_LISTEN_PORT -b /var/lib/beanstalkd”START=yesEOFsudo 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 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

将 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 进行集成。

Docker 的详细介绍 :请点这里
Docker 的下载地址 :请点这里

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-20发表,共计2972字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中