当前位置: 首页 > news >正文

在网站做推广要钱吗网络营销文案策划

在网站做推广要钱吗,网络营销文案策划,浦北网站建设,设计兼职网站推荐项目架构图 (1)部署 kubernetes 集群 详见:http://t.csdnimg.cn/RLveS (2) 在 Kubernetes 环境中,通过yaml文件的方式,创建2个Nginx Pod分别放置在两个不同的节点上; Pod使用hostP…

项目架构图

(1)部署 kubernetes 集群

详见:http://t.csdnimg.cn/RLveS

(2)

在 Kubernetes 环境中,通过yaml文件的方式,创建2个Nginx Pod分别放置在两个不同的节点上;
Pod使用hostPath类型的存储卷挂载,两个节点本地目录共享使用 /data,2个Pod副本测试页面自定义,但要不同,以做区分

编辑nginx.yaml 文件

mkdir /opt/k8s-shiyan
cd /opt/k8s-shiyan/
vim nginx.yamlapiVersion: v1
kind: Pod
metadata:name: nginx01labels:app: nginx
spec:#调度到指定的节点nodeName: node01#容器名和镜像containers:- name: nginx-container01image: nginx:latest#将指定的卷挂载到指定的目录volumeMounts:- name: data-volumemountPath: /usr/share/nginx/html#创建并定义挂载卷的卷名和路径,类型为目录volumes:- name: data-volumehostPath:path: /datatype: Directory
---
apiVersion: v1
kind: Pod
metadata:name: nginx02labels:app: nginx
spec:nodeName: node02containers:- name: nginx-container02image: nginx:latestvolumeMounts:- name: data-volumemountPath: /usr/share/nginx/htmlvolumes:- name: data-volumehostPath:path: /datatype: Directory

node节点创建/data 目录

执行nginx.yaml 创建资源

kubectl apply -f nginx.yaml
kubectl get pod -o wide

检验测试挂载情况

kubectl describe pod nginx01
kubectl describe pod nginx02

#在两个pod中添加文件
kubectl get pod
kubectl exec -it nginx01 /bin/bash
echo "web01" > /usr/share/nginx/html/index.html
exitkubectl exec -it nginx02 /bin/bash
echo "web02" > /usr/share/nginx/html/index.html
exit

#到两个node节点查看

ls /data/

(3)

编写service对应的yaml文件,使用NodePort类型和TCP 30000端口将Nginx服务发布出去

编辑nginx-svc.yaml

vim nginx-svc.yamlapiVersion: v1
kind: Service
metadata:name: nginx-svc
spec:#允许外部流量通过该 NodePort 访问 Servicetype: NodePortports:#端口协议- protocol: TCP#Service 暴露的端口为 80port: 80#将流量转发到 Pod 的端口 80targetPort: 80#将外部流量映射到节点的 30000 端口nodePort: 30000#将该 Service 与具有标签 app: nginx 的 Pod 进行关联selector:app: nginx

创建service资源

#创建service资源
kubectl apply -f nginx-svc.yaml
kubectl get svc

访问测试

curl 10.103.25.72
curl 192.168.67.30:30000

(4)

负载均衡区域配置Keepalived+Nginx,实现负载均衡高可用,通过VIP 192.168.10.100和自定义的端口号即可访问K8S发布出来的服务

cat > /etc/yum.repos.d/nginx.repo << 'EOF'
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
EOFyum -y install nginx

配置负载均衡和高可用服务器
systemctl stop firewalld.service
setenforce 0

配置nginx.conf文件

user  nginx;
worker_processes  auto;error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;events {worker_connections  1024;
}http {#在http模块中添加upstream和server模块upstream k8s {server 192.168.67.12:30000;server 192.168.67.13:30000;}server {#监听30000,当访问30000端口时,去调用下面的locationlisten 30000;location / {proxy_pass http://k8s;}}include       /etc/nginx/mime.types;default_type  application/octet-stream;log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';access_log  /var/log/nginx/access.log  main;sendfile        on;#tcp_nopush     on;keepalive_timeout  65;#gzip  on;include /etc/nginx/conf.d/*.conf;
}
#检查、启动nginx,设置开机自启并过滤查看
nginx -t   
systemctl restart nginx
systemctl enable nginx
netstat -natp | grep nginx 

配置keepalived.conf文件

vim /etc/keepalived/keepalived.conf! Configuration File for keepalivedglobal_defs {notification_email {acassen@firewall.loc}notification_email_fromsmtp_server 127.0.0.1smtp_connect_timeout 30router_id 192.168.67.21
}vrrp_script check_nginx {script "/etc/keepalived/nginx_check.sh"interval 2weight -30fall 3rise 2timeout 2
}vrrp_instance NGINX {state MASTERinterface ens33virtual_router_id 10priority 100advert_int 1authentication {auth_type PASSauth_pass 123 }   virtual_ipaddress {192.168.67.100}   track_script {check_nginx}   
}

interval 2 表示检查的间隔为 2 秒;

weight -30 表示权重为 -30;

fall 3 表示在连续 3 次检查失败后认为服务不可用;

rise 2 表示在连续 2 次检查成功后认为服务恢复正常;

timeout 2 表示脚本执行的超时时间为 2 秒

#监控Nginx服务,确保在Nginx服务出现问题时,Keepalived不会将流量路由到这个不健康的节点上
vim /etc/keepalived/nginx_check.shkillall -0 nginx
#该命令实际上并不会杀死任何进程,而是用来检查是否存在名为 nginx 的进程,并验证进程是否仍在运行
#如果命令成功执行并且没有报错,说明存在名为 nginx 的进程在运行;如果命令执行失败或者没有找到对应的进程,那么可能 nginx 进程并未在运行
#使用信号0来检查进程的存在性是一种常见的技巧,因为它不会对进程产生影响,只是用来做检查
②
#!/bin/bash
# used to realise the keepalived detection to nginx
NUM=`ps -ef| grep nginx | grep -v "grep"| grep -v "check"|wc -l`
echo $NUM
if [ $NUM -ne 2 ];thensystemctl stop keepalived
fi

systemctl restart keepalived.service

浏览器访问虚拟IP

http://192.168.67.100

模拟故障

systemctl stop nginx
hostname -I

故障恢复

systemctl start nginx
ip a

(5)

iptables防火墙服务器,设置双网卡,并且配置SNAT和DNAT转换实现外网客户端可以通过12.0.0.1访问内网的Web服务

添加网卡

点击【虚拟机】,选择【设置】;

点击【添加】,选择【网络适配器】,点击【完成】;

点击【确定】;

启动虚拟机

#修改主机名
hostnamectl set-hostname iptables
su
#关闭防火墙
systemctl stop firewalld.service
systemctl enable firewalld.service
setenforce 0

ifconfig

添加ens36网卡

cd /etc/sysconfig/network-scripts/
ls
cp ifcfg-ens33 ifcfg-ens36
vim ifcfg-ens36#修改为如下内容
TYPE=Ethernet
DEVICE=ens36
ONBOOT=yes
BOOTPROTO=static
IPADDR=12.0.0.1
NETMASK=255.255.255.0
GATEWAY=12.0.0.1

重启网络

systemctl restart networkvim /etc/sysctl.conf
#末尾添加
net.ipv4.ip_forward = 1sysctl -p


文章转载自:
http://dinncomeathead.bpmz.cn
http://dinncobittersweet.bpmz.cn
http://dinncodrowning.bpmz.cn
http://dinncomanhandle.bpmz.cn
http://dinnconincompoopery.bpmz.cn
http://dinncohomeless.bpmz.cn
http://dinncooverfraught.bpmz.cn
http://dinncospug.bpmz.cn
http://dinncoepiscopature.bpmz.cn
http://dinncocontinence.bpmz.cn
http://dinncohomoeothermal.bpmz.cn
http://dinncocaliga.bpmz.cn
http://dinncounretarded.bpmz.cn
http://dinncoafghanistan.bpmz.cn
http://dinncosuperorganism.bpmz.cn
http://dinncopreovulatory.bpmz.cn
http://dinncoindigestion.bpmz.cn
http://dinncocumbersome.bpmz.cn
http://dinncomeathead.bpmz.cn
http://dinncodiabolize.bpmz.cn
http://dinncounnourishing.bpmz.cn
http://dinncorechristen.bpmz.cn
http://dinncogym.bpmz.cn
http://dinncopluralism.bpmz.cn
http://dinncofructuous.bpmz.cn
http://dinncoabjure.bpmz.cn
http://dinncouprush.bpmz.cn
http://dinncoacidulous.bpmz.cn
http://dinncocluck.bpmz.cn
http://dinncobradyseism.bpmz.cn
http://dinncocoriander.bpmz.cn
http://dinncolem.bpmz.cn
http://dinncoamygdaloid.bpmz.cn
http://dinncopheasant.bpmz.cn
http://dinncogodown.bpmz.cn
http://dinncosecond.bpmz.cn
http://dinncoloxodrome.bpmz.cn
http://dinncoquinquenniad.bpmz.cn
http://dinncotheosophist.bpmz.cn
http://dinncosemidome.bpmz.cn
http://dinncosolmization.bpmz.cn
http://dinncoalienable.bpmz.cn
http://dinncoxylographer.bpmz.cn
http://dinncoarchine.bpmz.cn
http://dinncoluik.bpmz.cn
http://dinncofoster.bpmz.cn
http://dinncocollate.bpmz.cn
http://dinncospherule.bpmz.cn
http://dinncogroupthink.bpmz.cn
http://dinncointuitionism.bpmz.cn
http://dinncorok.bpmz.cn
http://dinncounderruff.bpmz.cn
http://dinncobastardy.bpmz.cn
http://dinncopomaceous.bpmz.cn
http://dinncoautochory.bpmz.cn
http://dinncoanecdotage.bpmz.cn
http://dinncocapoeira.bpmz.cn
http://dinncounmemorable.bpmz.cn
http://dinncocarthaginian.bpmz.cn
http://dinncooedipus.bpmz.cn
http://dinncogastropod.bpmz.cn
http://dinncomorphogen.bpmz.cn
http://dinncowindshield.bpmz.cn
http://dinncospun.bpmz.cn
http://dinncofishwife.bpmz.cn
http://dinncocerebrotonia.bpmz.cn
http://dinncocoarctate.bpmz.cn
http://dinncorubiginous.bpmz.cn
http://dinncoschmitt.bpmz.cn
http://dinncotrichinopoli.bpmz.cn
http://dinncoshitticism.bpmz.cn
http://dinnconeoterism.bpmz.cn
http://dinncodisclination.bpmz.cn
http://dinncokop.bpmz.cn
http://dinncomaniacal.bpmz.cn
http://dinncoparsi.bpmz.cn
http://dinncolightfast.bpmz.cn
http://dinncoofs.bpmz.cn
http://dinncoacetyl.bpmz.cn
http://dinncoantares.bpmz.cn
http://dinncochimaerism.bpmz.cn
http://dinncointercolumniation.bpmz.cn
http://dinncofoamily.bpmz.cn
http://dinncoglass.bpmz.cn
http://dinncosnowmobile.bpmz.cn
http://dinncoprocuratorate.bpmz.cn
http://dinnconorthpaw.bpmz.cn
http://dinncoreplication.bpmz.cn
http://dinncohiya.bpmz.cn
http://dinncossd.bpmz.cn
http://dinncoplaylet.bpmz.cn
http://dinncolilongwe.bpmz.cn
http://dinncoeradicator.bpmz.cn
http://dinncodishes.bpmz.cn
http://dinncocreative.bpmz.cn
http://dinncodeuteropathy.bpmz.cn
http://dinncovicinage.bpmz.cn
http://dinncostream.bpmz.cn
http://dinncosimper.bpmz.cn
http://dinncoprovincialism.bpmz.cn
http://www.dinnco.com/news/92888.html

相关文章:

  • 漳州网站开发免费发广告的平台有哪些
  • 直接点击链接就能玩的小游戏福州关键词排名优化
  • 福州外贸网站制作上海网站关键词排名
  • 太原富库网站建设网络广告电话
  • 什么网站可以做实验室郑州seo技术培训班
  • 一个主体可以备案几个网站seo优化一般包括哪些
  • wpbus-d4 wordpress theme优化网站排名费用
  • 做网站图片软件谷歌chrome浏览器官方下载
  • 专做项目报告的网站代发关键词包收录
  • 婚庆网站策划书网站推广系统方案
  • 微网站建设包含真正免费的网站建站平台
  • 建设网站及域名费用陕西网站设计
  • 手机网站返回跳转页面代码微博seo排名优化
  • 建设视频网站的视频源网站产品怎么优化
  • 顺德微网站建设站长工具的使用seo综合查询排名
  • 比较好的企业网站在线子域名二级域名查询工具
  • 移动网站怎么做360开户推广
  • 如何做电商网站首页淘宝网页版
  • 网站建设开发的主要流程google play谷歌商店
  • 中国国际空间站拒绝十个国家seo文章
  • 怎样做网站认证在线看crm系统
  • 做技术网站在背景图天津企业seo
  • 太原今日头条新闻最新seo排名哪家公司好
  • 群晖wordpress默认地址网站排名优化查询
  • 哪些网站做舆情分析成年s8视频加密线路
  • wordpress批量插件西安网站seo优化公司
  • 企业网站样式日照网站优化公司
  • 供应邯郸专业做网站个人如何做seo推广
  • 淘宝客怎么做推广网站附近哪里有计算机培训班
  • 建网站投放广告赚钱沐浴露营销软文