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

应用运维文档1

统一nginx接入配置指南

Nginx配置规范

1:不带微服务编码上下文至后端,以metadata-ui为例
location段配置信息,location配置中维护微服务编码上下文信息

# app_code: metadata-ui   流水线名称: metadata-ui
location  ~ ^/metadata-ui/(?P.*) {set $app_code 'metadata-ui';proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Host $http_host;proxy_http_version 1.1;proxy_set_header Connection "";if ( $nginx-flag = "out-nginx"){set $nginx "public";}include crossDomain.conf;proxy_set_header x-network-type $yonyoubipnginx;proxy_set_header Host $target_ingress;proxy_pass http://$target_ingress/$URI$is_args$args;
}# map信息 【非共享配置,各领域须适配自己所属领域的配置,并追加到此map文件中】
map $app_code $target_ingress {
# app_code: metadata-ui   流水线名称: metadata-ui'metadata-ui'  'pre-metadata-ui.k8s.com';
}

2:带微服务编码上下文至后端,以doc-material为例
location段配置信息,location配置中维护微服务编码上下文信息

# app_code: doc-material   流水线名称: pc-server
location  ~ ^/doc-material {set $app_code 'doc-material';proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Host $http_host;proxy_http_version 1.1;proxy_set_header Connection "";if ( $nginx-flag = "out-nginx"){set $nginx "public";}include crossDomain.conf;proxy_set_header x-network-type $nginx;proxy_set_header Host $target_ingress;proxy_pass http://$target_ingress;
}
# map信息 
map $app_code $target_ingress {
# app_code: doc-material   流水线名称: pc-server'doc-material'  'doc-material.k8s.com';
}

添加nginx配置

1、create  master

GitLab 也宣布 使用"main"代替"master"作为新的默认分支名。所以后续新建项目即默认main分支了。

①在GitLab上新建项目test后,进入test项目,点击左侧Repository->Branches

可以看到里面只有一个受保护的默认分支main,此处无法删除。

然后新建分支master:点击右上角New branch,输入分支名字master,Create branch。

②再点击左侧Settings->Repository

点开Default branch,选择Default branch为master,Save Changes。

至此默认分支就是master了。

2、 
cd existing_repo
git init 
git remote add origin git@git.aliyun.com:devops/nginx.git
git add .
git commit -m "init"
git push -uf origin master

Linux系统挂载NAS文件系统
1、安装NFS客户端
如果您使用CentOS、Redhat、Aliyun Linux操作系统,请执行以下命令
sudo yum install nfs-utils
如果您使用Ubuntu或Debian操作系统,请执行以下命令
sudo apt-get update
sudo apt-get install nfs-common
2、增加同时发起的NFS请求的数量

if (lsmod | grep sunrpc); then
(modinfo sunrpc | grep tcp_max_slot_table_entries) && sysctl -w sunrpc.tcp_max_slot_table_entries=128
(modinfo sunrpc | grep tcp_slot_table_entries) && sysctl -w sunrpc.tcp_slot_table_entries=128
fi
(modinfo sunrpc | grep tcp_max_slot_table_entries) && echo "options sunrpc tcp_max_slot_table_entries=128" >> /etc/modprobe.d/alinas.conf
(modinfo sunrpc | grep tcp_slot_table_entries) && echo "options sunrpc tcp_slot_table_entries=128" >> /etc/modprobe.d/alinas.conf

3、创建目录
mkdir /middleware /docker /data/maven /systemlog /data/cloudproduct /var/yRelease
4、挂载NAS
sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/middleware /middleware
sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/docker /docker
sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/maven  /data/maven
sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/systemlog /systemlog
sudo mount -t nfs -o vers=3,noacl,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 01137036-1gqo.cn-beijing.extreme.nas.aliyuncs.com:/ /data/cloudproduct
sudo mount -t nfs -o vers=3,noacl,nolock,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 1d5014af0d-dbu83.cn-beijing.nas.aliyuncs.com:/ /var/yRelease

Linux内存管理神器:smem工具

http://www.lryc.cn/news/333846.html

相关文章:

  • 手机如何在线制作gif?轻松一键在线操作
  • ChatGPT 在做什么,为什么有效?
  • Linux实验2 初步使用shell
  • 甘特图/横道图制作技巧 - 任务组
  • Web题记
  • 学习java第三十六天
  • 0205矩阵分块法-矩阵及其运算-线性代数
  • 1、java语法入门(找工作版)
  • arm的状态寄存器
  • 2024 蓝桥打卡Day34
  • 华为海思校园招聘-芯片-数字 IC 方向 题目分享——第九套
  • 如何创建虚拟环境打包py文件
  • CSS 学习笔记 总结
  • 基于Swin Transformers的乳腺癌组织病理学图像多分类
  • MySQL主从的介绍与应用
  • pytest中文使用文档----12缓存:记录执行的状态
  • 【代码随想录】哈希表
  • 绘图工具 draw.io / diagrams.net 免费在线图表编辑器
  • 【Vue】 Vue项目中的跨域配置指南
  • 跨站脚本攻击XSS
  • C++中的vector与C语言中的数组的区别
  • drawio画图编辑图形颜色
  • uniapp中uni.navigateTo传递变量
  • Spring Boot 构建war 部署到tomcat下无法在Nacos中注册服务
  • (2024,Attention-Mamba,MoE 替换 MLP)Jamba:混合 Transformer-Mamba 语言模型
  • “Java泛型” 得所憩,落日美酒聊共挥
  • pdf、docx、markdown、txt提取文档内容,可以应用于rag文档解析
  • 【Linux系列】“dev-node1“ 运行的操作系统分析
  • SpriingBoot整合MongoDB多数据源
  • 深入浅出 -- 系统架构之负载均衡Nginx缓存机制