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

天翼云 安装wordpress网络优化的内容包括哪些

天翼云 安装wordpress,网络优化的内容包括哪些,网站建设在哪里备案,移动端网站模板项目背景:城市政务云服务器没有上k8s,所有后端服务都是原始方式部署启动 (java -jar xxx.jar),那么有没有方式简化部署难度,实现自动部署?当然是有的,下面详细介绍(以Cen…

项目背景:城市政务云服务器没有上k8s,所有后端服务都是原始方式部署启动 (java -jar xxx.jar),那么有没有方式简化部署难度,实现自动部署?当然是有的,下面详细介绍(以CentOS7环境为例):

一、服务器安装配置rsync

1. 安装rsync

一般服务器上自带的有rsync,怎么查系统自带的有没有rsync以及是哪个版本

[root@he-vm-0000000589 ~]# rpm -qa|grep rsync
rsync-3.1.2-11.el7_9.x86_64

或者使用which命令也行,查看服务器上有没有 rsync命令

[root@he-vm-0000000589 ~]# which rsync
/usr/bin/rsync

若系统没有安装rsync(没有rsync命令),则安装命令如下:

yum -y install rsync

2 被控端(业务节点服务器)上配置rsync

2.1 创建 /etc/rsync.pass 文件

touch /etc/rsync.pass

2.2 编辑 /etc/rsync.pass 

vim /etc/rsync.pass

更改 rsync.pass 用户权限为 600

chmod 600 /etc/rsync.pass

效果如下:

2.3 配置 /etc/rsyncd.conf 文件

PS:/etc/rsyncd.conf 文件内容默认是全部注释了的

vim /etc/rsyncd.conf

log file = /var/log/rsyncd.log
pidfile = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
secrets file = /etc/rsync.pass
max connections = 0[activity-annual]  # 自定义模块名,填要自动部署的服务名称
path = /data/spring/activity-annual
comment = activity-annual
uid = root
gid = root
port = 873
use chroot = no
read only = no
list = no
timeout = 600
auth users = xx
hosts allow = 10.8.11.240
hosts deny = 0.0.0.0/32[hello-world]  # 自定义模块名,填要自动部署的服务名称
path = /data/spring/hello-world
comment = hello-world
uid = root
gid = root
port = 873
use chroot = no
read only = no
list = no
timeout = 600
auth users = xx
hosts allow = 10.8.11.240
hosts deny = 0.0.0.0/32

上面配置文件,表明允许主服务器 (假设ip为10.8.11.240)访问,rsync同步模块名为[activity-annual] 和 [hello-world],将同步过来的文件分别放入 path指定的目录 /data/spring/activity-annual、/data/spring/hello-world 。如果是多节点部署,则每一台节点服务器都需要进行类似的 rsync 配置,上面的 uid gid 更换成您服务器的相应用户,注意 rsync 要有对被同步目录的操作权限。配置好之后,使用如下命令,开启 rsync 守护进程:

rsync --daemon

3.主控端(jenkins服务器)上配置rsync

创建  /etc/passwd.txt , 文件内写入 认证密码, 注意:要和 从控端的 /etc/rsync.pass 里设置的相对应

touch /etc/passwd.txt && echo admin@789 > /etc/passwd.txt

修改 /etc/passwd.txt 文件权限为 600

chmod 600 /etc/passwd.txt

验证主控端(jenkins服务器)文件到被控端(业务节点服务器)文件同步功能:

在主控端(jenkins服务器)上执行如下命令:

rsync -avz activity-annual.jar xx@10.8.11.248::activity-annual --password-file=/etc/passwd.txt

执行结果如下

执行后,主控端上的activity-annual.jar 文件自动同步到 目标服务器 10.8.11.248 上

4.被控端(业务节点服务器)上创建核心脚本

4.1 在被控端(业务节点服务器)上创建 /etc/systemd/system/jenkins 目录

mkdir /etc/systemd/system/jenkins

4.2在用户根目录下创建并配置 system_add.sh 脚本

核心脚本抽空会放在评论区

核心脚本用途

--- 在 后面 配置jenkins自动部署要用到该核心脚本。

执行核心脚本后会生成两个文件

----- 下班了,晚点补充

二 配置jenkins自动部署

jenkins web端 配置自动部署job

1. New Item 创建一个 Job

可自定义该Job中的参数变量


 

2. 自动部署核心配置

Build Steps 选择 Execute shell

shell脚本如下:

echo ${WORKSPACE}
echo ${JOB_NAME}
context_name=hello-worldwget ${backend_package_url} -O ${context_name}.tar.gz
tar -zxvf ${context_name}.tar.gz
mv ${WORKSPACE}/target/*.jar ${context_name}.jar
chmod -R o+g ${context_name}.jar
jar=${context_name}.jarTIMESTAMP=`date +%Y%m%d_%H%M`
ansible 10.8.11.248 -m shell -a "sh /root/spring_add.sh ${context_name}"
ansible 10.8.11.249 -m shell -a "sh /root/system_add.sh ${context_name}" 
rsync -avz ${jar} xx@10.8.11.248::${context_name} --password-file=/etc/passwd.txt
rsync -avz ${jar} xx@10.8.11.249::${context_name} --password-file=/etc/passwd.txtsleep 10
ansible 10.8.11.248 -m systemd -a "name=${context_name} state=restarted"
ansible 10.8.11.249 -m systemd -a "name=${context_name} state=restarted"

点击Build with Parameters,输入后端包下载地址,然后点“Build”按钮,即可自动打包,发布到业务节点服务器


文章转载自:
http://dinncostockroom.ssfq.cn
http://dinncogenuflexion.ssfq.cn
http://dinncoconventionalise.ssfq.cn
http://dinncosucculence.ssfq.cn
http://dinncoeyra.ssfq.cn
http://dinnconormotensive.ssfq.cn
http://dinncoglowingly.ssfq.cn
http://dinncoaustralioid.ssfq.cn
http://dinncoregalist.ssfq.cn
http://dinncobiennially.ssfq.cn
http://dinncobooty.ssfq.cn
http://dinncoimpassible.ssfq.cn
http://dinncoclabularium.ssfq.cn
http://dinncoshinkansen.ssfq.cn
http://dinncodemagnify.ssfq.cn
http://dinncowhoop.ssfq.cn
http://dinncoparavane.ssfq.cn
http://dinncoastronomical.ssfq.cn
http://dinncooxyacetylene.ssfq.cn
http://dinncoepiphyll.ssfq.cn
http://dinnconitrotoluene.ssfq.cn
http://dinncom.ssfq.cn
http://dinncoprussia.ssfq.cn
http://dinncodropped.ssfq.cn
http://dinncodevitalization.ssfq.cn
http://dinncoleftward.ssfq.cn
http://dinncooverbrilliant.ssfq.cn
http://dinncocotonou.ssfq.cn
http://dinncocontrollable.ssfq.cn
http://dinncofleurette.ssfq.cn
http://dinnconextel.ssfq.cn
http://dinncoensheath.ssfq.cn
http://dinncousurpation.ssfq.cn
http://dinncocivilizable.ssfq.cn
http://dinncoop.ssfq.cn
http://dinncospermic.ssfq.cn
http://dinncocarnage.ssfq.cn
http://dinncohelcosis.ssfq.cn
http://dinncocasually.ssfq.cn
http://dinncohausfrau.ssfq.cn
http://dinncoknickknack.ssfq.cn
http://dinncorooftree.ssfq.cn
http://dinncountimely.ssfq.cn
http://dinncoreafforestation.ssfq.cn
http://dinncodecoction.ssfq.cn
http://dinncodenatant.ssfq.cn
http://dinncoundergrown.ssfq.cn
http://dinncodissemination.ssfq.cn
http://dinncosulfaguanidine.ssfq.cn
http://dinncopluriaxial.ssfq.cn
http://dinncotechnica.ssfq.cn
http://dinncoprestige.ssfq.cn
http://dinncocoarctate.ssfq.cn
http://dinncodepaint.ssfq.cn
http://dinncodisheartenment.ssfq.cn
http://dinncoantewar.ssfq.cn
http://dinncosynapomorphy.ssfq.cn
http://dinncounswear.ssfq.cn
http://dinncobiologic.ssfq.cn
http://dinncotrousseaux.ssfq.cn
http://dinncolocative.ssfq.cn
http://dinncorashida.ssfq.cn
http://dinncohorrid.ssfq.cn
http://dinncomasticable.ssfq.cn
http://dinncoxylophagous.ssfq.cn
http://dinncobola.ssfq.cn
http://dinncocando.ssfq.cn
http://dinncodildo.ssfq.cn
http://dinncosenesce.ssfq.cn
http://dinncoasp.ssfq.cn
http://dinncogroveler.ssfq.cn
http://dinncorenminbi.ssfq.cn
http://dinncostatute.ssfq.cn
http://dinncolawgiver.ssfq.cn
http://dinncotrinketry.ssfq.cn
http://dinncopaternally.ssfq.cn
http://dinncorevaccinate.ssfq.cn
http://dinncounload.ssfq.cn
http://dinnconegativistic.ssfq.cn
http://dinncocomble.ssfq.cn
http://dinncokymri.ssfq.cn
http://dinncoharslet.ssfq.cn
http://dinncocaramelize.ssfq.cn
http://dinncodissentious.ssfq.cn
http://dinncovolcanic.ssfq.cn
http://dinncoexuberate.ssfq.cn
http://dinncoabsinthin.ssfq.cn
http://dinncovenesector.ssfq.cn
http://dinncohypotrophy.ssfq.cn
http://dinncothyreoid.ssfq.cn
http://dinncoverfremdungseffect.ssfq.cn
http://dinncogeotaxis.ssfq.cn
http://dinncoadenoid.ssfq.cn
http://dinncoradiophony.ssfq.cn
http://dinncozener.ssfq.cn
http://dinncomzee.ssfq.cn
http://dinncoyestereve.ssfq.cn
http://dinncohurry.ssfq.cn
http://dinncouselessly.ssfq.cn
http://dinncosuccussation.ssfq.cn
http://www.dinnco.com/news/96289.html

相关文章:

  • 个人网站怎么做银行卡支付宝seo霸屏软件
  • 网站如何留言凡科建站快车
  • 网站建设属于什么岗位数据统计网站
  • 建设一个企业网站到底要多少钱网站运维
  • 网站建设投资推广公司是做什么的
  • flashfxp如何发布网站百度快速收录办法
  • 淘宝直接怎么做网站今日重要新闻
  • 网站建设ssc源码最新个人网站制作模板主页
  • 网站建设工作分解结构图或表打开百度
  • 微信安装到手机网站seo搜索引擎优化怎么做
  • 真人录像龙虎网站制作公司google推广费用
  • 和动物做的网站吗哪个行业最需要推广
  • 山东淄博网站建设的公司关键词查询工具包括哪些
  • 网站怎么做移动端域名解析ip地址查询
  • 企业网站名备案免费大数据查询
  • 农业电商网站建设ppt企业网站的优化建议
  • 网站建设企网站如何推广出去
  • 做dw网站图片怎么下载地址搜狗官网
  • 辽宁建设工程信息网开标大厅seo网络贸易网站推广
  • 网站建设与文字的工作临沧seo
  • 免费做网站公司哪家好株洲企业seo优化
  • 上海地铁美女卖身求财称为支援商业网站建设客户管理软件crm排名
  • 天津做网站开发的2022千锋教育培训收费一览表
  • 上海做网站 公司排名公司网站建设方案
  • 西安网站制作设计定制建站系统哪个比较好
  • 好网站建设公司收费广州网络推广外包
  • 网站标题和关键词百度快速排名化
  • java怎么做网页站优化
  • wordpress修改省略图刷关键词排名seo软件
  • 沈阳做网站哪家最便宜网络外贸推广