首页 文章 精选 留言 我的

精选列表

搜索[本地部署],共10000篇文章
优秀的个人博客,低调大师

docker分离部署lnmp

以下所需的全部的文件、镜像、软件,如有需要请到我的百度云分享下载: 链接:http://pan.baidu.com/s/1kUVNdsj 密码:an9l 项目需求: 构建lnmp平台。 要求nginx、php、mysql分开布署。 Nginx通过fastcgi方式支持php动态页面 实验完整框架如下: 说明:使用单一进程容器,即一个容器只运行一种服务,而不是把所有服务放在一个容器的设计,让lnmp项目需要的Nginx、PHP、MySQL组件,分别运行在各自镜像创建出来的独立容器中。 实验步骤如下: 1、安装docker1.12并开始服务 1)安装docker1.12 2)开启docker服务并开机自启 3)关闭selinux(一定要关闭) 4)开启路由转发功能 5)下载centos6镜像 (我这里已经下载好,并做成了归档压缩包,只用解压即可) 2、创建实验所用文件夹以及文件 1)分别创建工作目录 2)再分别创建相应目录下的文件和子目录 3、分别编辑nginx、php、mysql的dockerfile文件以及各自的supervisord.conf文件 1)nginx ①编辑nginx的dockerfile文件 #images of nginx FROM centos:centos6 MAINTAINER from zhengpengfei@example.com #install supervisor RUN yum -y install python-setuptools RUN /usr/bin/easy_install supervisor #install nginx RUN yum -y install pcre-devel zlib-devel gcc make ADD ./software/nginx-1.6.2.tar.gz /usr/src RUN useradd -M -s /sbin/nologin nginx RUN cd /usr/src/nginx-1.6.2/ && ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --user=nginx --group=nginx && make && make install #Modify nginx configuration file COPY nginx.conf /usr/local/nginx/conf/ RUN ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin RUN mkdir /usr/local/nginx/html/web #Open nginx service COPY supervisord.conf /etc/supervisor/supervisord.conf EXPOSE 80 CMD ["/usr/bin/supervisord"] ②编写nginx的supervisord.conf配置文件 ③docker build -t命令制作nginx镜像 ④镜像制作完成 2)php ①编辑php的dockerfile文件 #images of php FROM centos:centos6 MAINTAINER from zhengpengfei@example.com #install supervisor RUN yum -y install python-setuptools RUN /usr/bin/easy_install supervisor #install php RUN yum -y install gd libxml2-devel libjpeg-devel libpng-devel mysql-devel gcc make RUN useradd -M -s /sbin/nologin php ADD ./software/php-5.3.28.tar.gz /usr/src RUN cd /usr/src/php-5.3.28/ RUN cp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so RUN cd /usr/src/php-5.3.28/ && ./configure --prefix=/usr/local/php --with-gd --with-zlib --with-mysql --with-mysqli --with-mysql-sock --with-config-file-path=/usr/local/php --enable-mbstring --enable-fpm --with-jpeg-dir=/usr/lib && make && make install #Modify PHP configuration file RUN cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf COPY php-fpm.conf /usr/local/php/etc/ RUN mkdir -p /var/www/html/web #Open php-fpm service ADD ./supervisord.conf /etc/supervisor/supervisord.conf EXPOSE 9000 CMD ["/usr/bin/supervisord"] ②编写php的supervisord.conf配置文件 ③docker build -t命令制作php镜像 ④镜像制作完成 3)mysql ①编辑mysql的dockerfile文件 #image of mysql FROM centos:centos6 MAINTAINER from zhengpengfei@example.com #install supervisor RUN yum -y install python-setuptools RUN /usr/bin/easy_install supervisor #install mysql RUN yum -y install ncurses-devel make gcc gcc-c++ ADD ./software/cmake-2.8.12.tar.gz /usr/src ADD ./software/mysql-5.5.38.tar.gz /usr/src RUN cd /usr/src/cmake-2.8.12 && ./configure && gmake && gmake install RUN cd /usr/src/mysql-5.5.38 && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all && make && make install #Optimal adjustment mysql WORKDIR /usr/src/mysql-5.5.38/ RUN cp -rf ./support-files/my-medium.cnf /etc/my.cnf RUN cp -rf ./support-files/mysql.server /etc/rc.d/init.d/mysqld RUN chmod +x /etc/rc.d/init.d/mysqld RUN echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile RUN source /etc/profile #Initialize mysql RUN groupadd mysql RUN useradd -M -s /sbin/nologin mysql -g mysql RUN chown -R mysql:mysql /usr/local/mysql RUN /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ #service mysql start ADD ./supervisord.conf /etc/supervisor/supervisord.conf EXPOSE 3306 CMD ["/usr/bin/supervisord"] ②编写mysql的supervisord.conf配置文件 ③docker build -t命令制作mysql镜像 ④镜像制作完成 4、编写docker-compose.yml文件 5、安装docker-compose 1)先安装pip 2)再安装compose 6、通过docker-compose启动项目 7、进入mysql容器修改数据库root密码以及创建数据库和创建授权用户 1)修改数据库用户root密码 2)创建数据库 3)创建授权用户 4)给root用户授予全部权限 8、做html、php页面和数据库访问测试 1)制作html、php测试页 2)测试nginx和php的访问处理 3)制作数据库的测试页面 4)测试数据库连接 至此说明nginx、php、mysql三者的协同工作已经没有问题了 8、安装一个电影网站,做最后的lnmp协同工作测试 1)解压缩SKYUC 2)设置权限 分别去nginx和php容器给予权限: php: nginx: 3)宿主机防火墙开启80例外 4)在一台客户机安装SKYUC 本文转自Mr大表哥 博客,原文链接:http://blog.51cto.com/zpf666/1905555 如需转载请自行联系原作者

优秀的个人博客,低调大师

hive 部署UDF函数

一.临时添加UDF函数 1.上传jar包至hive服务器 2.hive shell执行如下命令: 1 2 3 4 5 6 addjar/home/hive/hivejar/billing-on-hive-1.0.jar createtemporaryfunctionstripas'com.tsingzone.bigdata.billing.GetOperator'; 注: strip:自定义函数名 com.tsingzone.bigdata.billing.GetOperator:类名 仅对当前shell生效 3.使用方法: 1 select strip(dest_termi_id) from huadan201601limit10; 二.永久添加UDF函数 1.上传jar包至hdfs中 1 hdfsdfs-puthivejar/billing- on -hive-1.0.jar/ user /hive/hive_jar 2.创建函数 1 create function billing as 'com.tsingzone.bigdata.billing.GetOperator' usingjar 'hdfs:///user/hive/hive_jar/billing-on-hive-1.0.jar' 3.使用 1 hive-S-e "selectbilling(dest_termi_id)fromhuadan201601limit10;" 参考文档:http://blog.csdn.net/liam08/article/details/51311772 本文转自 穿越防火墙 51CTO博客,原文链接:http://blog.51cto.com/sjitwant/1932990

优秀的个人博客,低调大师

RDO部署openstack(2)

配置ML2和VXLAN 1. 安装和配置Neutron ML2 框架 (1) 安装在控制节点上(运行Neutron-server的节点) service neutron-server stop yum install openstack-neutron-ml2 python-pyudev -y ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini -f (2) 配置ML2参数 crudini --set /etc/neutron/neutron.conf DEFAULT core_plugin neutron.plugins.ml2.plugin.Ml2Plugin # 启用L3路由服务,这里还可以在后面增加LBaaS、VPNaaS、FWaaS插件,插件间用逗号分隔即可。 crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins neutron.services.l3_router.l3_router_plugin.L3RouterPlugin # 启动Mechanism插件,默认启用了OpenvSwitch,LinuxBridge和L2Population。 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers openvswitch,linuxbridge,l2population # 启动Type插件,目前默认支持local、flat、vlan、gre、vxlan。 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers local,flat,vlan,gre,vxlan # 租户网络类型,这边我们选择vxlan crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan # 数据库配置,可直接参考/etc/neutron/neutron.conf crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini database sql_connectionmysql://neutron:<password>@<host>/neutron_ml2 # 防火墙驱动 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver # 给每类Type插件,定义参数 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vlan network_vlan_ranges <same range syntax as openvswitch> crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks <list of physical_networks or *> crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_gre tunnel_id_ranges <list of ranges> # 这里我们为vxlan配置vni范围,在1:10000。 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges 1:10000 (3) 数据库初始化 mysql -e "drop database if exists neutron_ml2;" mysql -e "create database neutron_ml2 character set utf8;" mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';" neutron-db-manage --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head service neutron-server start (4) 在网络节点和计算节点上配置 /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini: [ovs] tunnel_id_ranges=1:10000 tenant_network_type=vxlan enable_tunneling=True tunnel_type = vxlan local_ip = 192.168.188.136 [agent] tunnel_types = vxlan l2_population = True service neutron-openvswitch-agent restart (5) 配置IPtables策略,开放vxlan端口 /etc/sysconfig/iptables: -A INPUT -p udp --dport 4789 -j ACCEPT 本文转自feisky博客园博客,原文链接:http://www.cnblogs.com/feisky/p/3844283.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

docker swarm集群部署

docker swarm 集群构建: swarm 在docker 1.12 版本后内置 #h官方文档tps://docs.docker.com/engine/swarm/#feature-highlights 系统环境: centos7.3 docker17.06 1、初始化manager节点: docker swarm init 为实现高可用,manager节点需要有奇数个,类似zookerper选举制度。 2、复制生成的命令,在node节点运行。 #docker swarm join-token manager To add a manager to this swarm, run the following command: docker swarm join --token SWMTKN-1-1hwdongcnsvzh92s1wnd33w9p08k1o18vobvkzu7z509xoduif-2ezofrbnkaamwuuby9d1w0wn5 10.39.3.25:2377 # docker swarm join-token worker To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-1hwdongcnsvzh92s1wnd33w9p08k1o18vobvkzu7z509xoduif-1j43vxwnsrc3cyz2y7ips3d3g 10.39.3.25:2377 示例: 如目前有 10.39.3.25--29 集群, 选其中3个25、26、27 做为manager节点,用于管理swarm集群和实现高可用。 # docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS dga3oelektv4tbofub2ii9d36 cephnode5 Ready Active j0hmbmvn9pwnpr1n9zm20j67k * cephnode3 Ready Active Reachable k7pb8msn85c6xzflbe4r57itd cephnode1 Ready Active Reachable mmlszdi5lcr0zt2nk44pcjvya cephnode4 Ready Active t9f91au60k3cgf406cqe1pn2t cephnode2 Ready Active Leader 2个manager是无法实现高可用的,主节点异常后,备用节点运行命令将报错如下: #docker node ls Error response from daemon: rpc error: code = 2 desc = The swarm does not have a leader. It's possible that too few managers are online. Make sure more than half of the managers are online.

优秀的个人博客,低调大师

RDO部署openstack(1)

1. 安装系统CentOS 6.5 2. 网络配置 Eth0 设置 # cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes HWADDR=00:E0:81:D8:42:F6 TYPE=Ethernet BOOTPROTO=static IPADDR=10.1.199.8 NETMASK=255.255.255.0 Eth1 设置 # cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 TYPE=Ethernet ONBOOT=yes DEVICETYPE=ovs OVS_BRIDGE=br-ex TYPE=OVSPort 重启网络,生效 /etc/init.d/network restart 3. 改用163源 cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS6-Base-163.repo yum list; yum makecache 4.根据 http://openstack.redhat.com/Quickstart安装 sudo yum install -y http://rdo.fedorapeople.org/rdo-release.rpm sudo yum install -y http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm (J版:yum install http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm) sudo yum install -y openstack-packstack Packstack takes the work out of manually setting up OpenStack. For a single node OpenStack deployment, run the following command. packstack --allinone If you have run packstack previously, there will be a file in your home directory named something like packstack-answers-20130722-153728.txt You will probably want to use that file again, using the --answer-file option, so that any passwords you've already set (eg, mysql) will be reused. The installer will ask you to enter the root password for each host node you are installing on the network, to enable remote configuration of the host so it can remotely configure each node using Puppet. Once the process is complete, you can log in to the OpenStack web interface "Horizon" by going tohttp://$YOURIP/dashboard. The username is "admin". The password can be found in the file keystonerc_admin in the /root/ directory of the control node. 高级功能 你可以通过生成配置文件,进行修改 packstack --gen-answer-file my_answers.txt 对my_answers.txt 进行设置,然后 packstack --answer-file my_answers.txt

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册