rancher 连接 mysql_rancher 2.X 搭建小型web集群+mysql主从复制

本文介绍了如何使用Rancher 2.1.6搭建小型Web集群,并结合MySQL实现主从复制。首先,配置了包含PHP和Nginx的私有镜像,接着构建并推送了MySQL主从镜像到Harbor私有仓库。然后,通过Rancher部署Web应用和数据库,最后详细讲解了数据库的主从配置过程。
摘要由CSDN通过智能技术生成

阅读目录(Content)

一,环境配置

rancher 2.1.6

二,配置harbor私有仓库

见上文

三,配置私有镜像

01,总文件

32abb4eea79b

dockerfile 为主配置文件,html 为站点文件wordpress.,官网下载更加

32abb4eea79b

1FROM centos:7.4.1708 2MAINTAINER kingle 3ENV PHP_VARSION5.5.32 4ENV NGINX_VERSION1.14.0 5ADD . /usr/local/share/ 6RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 7RUN curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && \ 8curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 9RUN yum install -y pcre pcre-devel openssl openssl-devel gcc make gcc-c++10RUN cd /usr/local/share/ && tar zxf nginx-1.14.0.tar.gz && \11useradd www -s /bin/nologin -M12WORKDIR /usr/local/share/nginx-1.14.0/13RUN ./configure --user=www --group=www \14--prefix=/application/nginx \15--with-http_stub_status_module --with-http_ssl_module && \16make -j4&& make install17RUN yum install vim net-tools zlib-devel openssl-devel openssl libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel libmcrypt-devel mcrypt mhash -y18RUN cd /usr/local/share/ && tar zxf libmcrypt-2.5.8.tar.gz && tar zxf mcrypt-2.6.8.tar.gz && tar zxf mhash-0.9.9.9.tar.gz19RUN cd /usr/local/share/libmcrypt-2.5.8&& \20./configure && make && make install && \21ln -s /usr/local/bin/libmcrypt_config /usr/bin/libmcrypt_config && \22export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH23RUN cd /usr/local/share/mhash-0.9.9.9&& \24./configure && make && make install25RUN cd /usr/local/share/mcrypt-2.6.8&& \26./configure && make && make install27RUN cd /usr/local/share/ && tar zxf libiconv-1.14.tar.gz && \28tar zxf php-5.5.32.tar.gz && \29cd /usr/local/share/libiconv-1.14&& \30sed -i -e'/gets is a security/d'srclib/stdio.in.h && \31./configure --prefix=/usr/local/libiconv && make -j4&&

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值