2024年Linux最全云计算day13-Git 版本控制体系、jenkins安装(笔记),2024
为了做好运维面试路上的助攻手,特整理了上百道 【运维技能栈面试题集锦】 ,让你面试不慌心不跳,高薪offer怀里抱!这次整理的面试题,小到shell、MySQL,大到K8s等云原生技能栈,不仅适合运维新人入行面试需要,还适用于想提升进阶跳槽加薪的运维朋友。
https://img-blog.csdnimg.cn/img_convert/3dd6fcae218b80515830f02f9c92eb56.png
本份面试集锦涵盖了
[*]174 道运维工程师面试题
[*]128道k8s面试题
[*]108道shell脚本面试题
[*]200道Linux面试题
[*]51道docker面试题
[*]35道Jenkis面试题
[*]78道MongoDB面试题
[*]17道ansible面试题
[*]60道dubbo面试题
[*]53道kafka面试
[*]18道mysql面试题
[*]40道nginx面试题
[*]77道redis面试题
[*]28道zookeeper
总计 1000+ 道面试题, 内容 又全含金量又高
[*]174道运维工程师面试题
1、什么是运维?
2、在工作中,运维人员经常需要跟运营人员打交道,请问运营人员是做什么工作的?
3、现在给你三百台服务器,你怎么对他们举行管理?
4、简述raid0 raid1raid5二种工作模式的工作原理及特点
5、LVS、Nginx、HAproxy有什么区别?工作中你怎么选择?
6、Squid、Varinsh和Nginx有什么区别,工作中你怎么选择?
7、Tomcat和Resin有什么区别,工作中你怎么选择?
8、什么是中间件?什么是jdk?
9、讲述一下Tomcat8005、8009、8080三个端口的含义?
10、什么叫CDN?
11、什么叫网站灰度发布?
12、简述DNS举行域名剖析的过程?
13、RabbitMQ是什么东西?
14、讲一下Keepalived的工作原理?
15、讲述一下LVS三种模式的工作过程?
16、mysql的innodb怎样定位锁问题,mysql怎样减少主从复制延迟?
17、怎样重置mysql root密码?
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技能提升。
需要这份体系化的资料的朋友,可以点击这里获取!
一个人可以走的很快,但一群人才气走的更远!不论你是正从事IT行业的老鸟或是对IT行业感爱好的新人,都欢迎参加我们的的圈子(技能交换、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习发展!
标签就是给commit起一个别名,轻易记忆
#添加标签
git log --oneline
git tag v1.2 ----> 给当前版本打标签
git tag -a v1.0 -m '注释,优化了修复了什么' <commit的ID>
#删除标签
git tag -d v1.2
# git log --oneline
b8e21cc add test.txt
9d5ab15 add test.txt
382f080 add test.txt
ff6047d add file6 file7
b693580 add file6 file7
58bea1a add three file
fe9e8c2 add two file
# git tag
# git tag v1.2
# git tag
v1.2
# git show v1.2
commit b8e21cc519dfd918ee880831e37585afcdf73410
Author: oldqiang <296917342@qq.com>
Date: Mon Sep 23 12:03:35 2019 +0800
add test.txt
diff --git a/demo/test.txt b/demo/test.txt
index 69f66d3..d99f9f0 100644
--- a/demo/test.txt
+++ b/demo/test.txt
@@ -1,3 +1,3 @@
11111
-aaaaa
+22222
33333
# git tag -a v1.0 -m 'v1.0 add 后裔' fe9e8c2
# git tag
v1.0
v1.2
# git show v1.0
tag v1.0
Tagger: oldqiang <296917342@qq.com>
Date: Mon Sep 23 12:18:45 2019 +0800
v1.0 add 后裔
commit fe9e8c25cfb61eb63da6681dc09d054cd5739243
Author: oldqiang <296917342@qq.com>
Date: Mon Sep 23 10:44:54 2019 +0800
add two file
diff --git a/file1 b/file1
new file mode 100644
index 0000000..5721413
--- /dev/null
+++ b/file1
@@ -0,0 +1 @@
+423
扩展
Git 打补丁-- patch 和 diff 的使用
diff
patch 打补丁,创建补丁,卸载补丁
git克隆 码云网站复制项目链接
[外链图片转存失败(img-ZksPvapA-1569213856173)(https://upload-images.jianshu.io/upload_images/16952149-dc299a71ec5aeca1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)]
9. git长途仓库gitee
https://img-blog.csdnimg.cn/20190923151112881.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70https://img-blog.csdnimg.cn/20190923155808814.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
ssh-keygen -t rsa
cat /root/.ssh/id_rsa.pub
cd /root/demo/
ll
git remote add origin git@gitee.com:linuxcx/linux.git
git push -u origin master
10. gitlab安装
#上传gitlab-ce-11.9.11-ce.0.el7.x86\_64.rpm到当前目录
echo "192.168.37.202 mirrors.aliyun.com" >>/etc/hosts
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum localinstall gitlab-ce-11.9.11-ce.0.el7.x86_64.rpm -y
vim/etc/gitlab/gitlab.rb
#设置访问url和关闭prometheus
external_url 'http://http://gitlablcx.com'
prometheus_monitoring['enable'] = false
#配置gitlab通过smtp发送邮件
# vim /etc/gitlab/gitlab.rb
gitlab_rails['gitlab\_email\_enabled'] = true
gitlab_rails['gitlab\_email\_from'] = '245684979@qq.com'
gitlab_rails['gitlab\_email\_display\_name'] = 'linux\_gitlab'
gitlab_rails['smtp\_enable'] = true
gitlab_rails['smtp\_address'] = "smtp.qq.com"
gitlab_rails['smtp\_port'] = 465
gitlab_rails['smtp\_user\_name'] = "245684979"
gitlab_rails['smtp\_password'] = "lvlina.199625"
gitlab_rails['smtp\_domain'] = "qq.com"
gitlab_rails['smtp\_authentication'] = "login"
gitlab_rails['smtp\_enable\_starttls\_auto'] = true
gitlab_rails['smtp\_tls'] = true
#重新配置
gitlab-ctl reconfigure
11.gitlab汉化
https://img-blog.csdnimg.cn/20190923165615703.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
#下载汉化包
https://gitlab.com/xhang/gitlab
gitlab-ctl stop
tar xf gitlab-11-9-stable-zh.tar.gz
\cp -a gitlab-11-9-stable-zh/* /opt/gitlab/embedded/service/gitlab-rails/
https://img-blog.csdnimg.cn/20190923170951661.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
12. gitlab-用户-用户组-项目之间的关系
先创建用户组,在基于用户组创建项目,最后创建用户,编辑用户组,添加成员,注意权限
https://img-blog.csdnimg.cn/20190923181542449.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
13. gitlab备份和规复
#备份
gitlab-rake gitlab:backup:create
#恢复
gitlab-ctl stop
gitlab-rake gitlab:backuip:restore BACKUP=1510472027_2019_09_23_9.4.5
gitlab-ctl start
vim /etc/gitlab/gitlab.rb
gitlab_rails['manage\_backup\_path'] = true
gitlab_rails['backup\_path'] = "/var/opt/gitlab/backups"
gitlab_rails['backup\_keep\_time'] = 604800
#迁移云主机
先备份,云主机安装相同版本,恢复
#更新配置
gitlab-ctl reconfigure
14.gitlab版本升级
gitlab升级,要小版本跨 10--->11--->12
扩展内容:
1.安装svn服务器,将svn中的数据迁徙到git仓库
git-svn
git clone svn
svn是一个中心化的版本控制工具,git是分布式的,每个人都可以有完备的代码仓库
#安装svn
yum install subversion -y
mkdir /svn/repo -p
#初始化仓库
svnadmin create /svn/repo
cd /svn/repo/conf
vimsvnserve.conf
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = /svn/repo
vim passwd
admin = 123456
vim authz
[/]
admin = rw
test = r
启动svn服务
svnserve -d -r /svn/repo
#svn迁移到git
yuminstallgit-svn-y
git svn clone svn://10.0.0.13 --username=admin --no-metadata --authors-file=password.txt git
cat password.txt
admin=<245684979@qq.com>
2.找回gitlab的root密码
2. 持续摆设
gitlab, lb(摆设服务器), web01,web02
#lb01,web01,web02都按照nginx
echo "192.168.37.202 mirrors.aliyun.com" >>/etc/hosts
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install nginx -y
#创建upstream资源池文件
vim/etc/nginx/upstream_monitor
server 10.0.0.7;
server 10.0.0.8;
#配置lb01负载均衡
vim /etc/nginx/nginx.conf
worker_processes1;
events {
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
sendfile on;
keepalive_timeout65;
upstream monitor {
include /etc/nginx/upstream_monitor;
}
server {
listen 80;
server_namemonitor.oldqiang.com;
location / {
proxy_pass http://monitor;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote\_addr;
}
}
}
nginx -t
systemctl restart nginx
systemctl enable nginx
#配置web01和web02,文件内容相同
vi /etc/nginx/nginx.conf
worker_processes1;
events {
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
sendfile on;
keepalive_timeout65;
server {
listen 80;
server_namemonitor.oldqiang.com;
location / {
root /code/web;
indexindex.html index.htm;
}
}
}
nginx -t
systemctl restart nginx
systemctl enable nginx
#在web01和web02创建首页并创建软连接
# cd /code/
# mkdir web\_v1
# echo web01 >web\_v1/index.html
# ln -s web\_v1 web
# ll
total 0
lrwxrwxrwx 1 root root6 Sep 24 11:11 web -> web_v1
drwxr-xr-x 2 root root 24 Sep 24 11:11 web_v1
# cd /code/
# mkdir web\_v1
# echo web02 >web\_v1/index.html
# ln -s web\_v1 web
# ll
total 0
lrwxrwxrwx 1 root root6 Sep 24 11:12 web -> web_v1
drwxr-xr-x 2 root root 24 Sep 24 11:12 web_v1
#在windows上做hosts解析
C:\Windows\System32\drivers\etc\hosts
10.0.0.5 http://monitor.lcx.com/
https://img-blog.csdnimg.cn/20190924111946759.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
新建项目
https://img-blog.csdnimg.cn/20190924112546876.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
流程
https://img-blog.csdnimg.cn/20190924113401482.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MjQyNTIw,size_16,color_FFFFFF,t_70
#在gitlab上
git config --global user.name "Administrator"
git config --global user.email "admin@example.com"
mkdir /code
cd /code/
ls
wget http://192.168.37.202/linux59/monitor_html.tar.gz
ls
tarxf monitor_html.tar.gz
cd monitor/
ls
ls .git/
git branch
git log --oneline
# mkdir -p /server/scripts
# cd /server/scripts/
============================================================
# cat auto\_deploy.sh
#!/bin/bash
serverlist="10.0.0.7 10.0.0.8"
#代码更新
fabu() {
cd /code/monitor/ && \
git pull -u origin
version=`git tag|tail -1`
echo $version
tar zcf /code/monitor_${version}.tar.gz *
for ip in $serverlist
do
scp -rp /code/monitor_${version}.tar.gz root@${ip}:/code
sshroot@${ip} "mkdir -p /code/web\_${version} &&
tar xf /code/monitor\_${version}.tar.gz -C /code/web\_${version} && \
rm -fr /code/web && ln -s /code/web\_${version} /code/web && rm -fr /code/monitor\_${version}.tar.gz "
done
}
huigun() {
cd /code/monitor/
version=`git tag|tail -1`
last_version=`git tag|tail -2|head -1`
for ip in $serverlist
do
ssh root@${ip} "rm -fr /code/web && ln -s /code/web\_${last\_version} /code/web"
done
}
case $1 in
deploy)
fabu;
;;
rollback)
huigun;
;;
*)
echo '无效的参数';
esac
**先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前在阿里**
**深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
**因此收集整理了一份《2024年最新Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。**
!(https://img-blog.csdnimg.cn/img_convert/141a1a9905e28b0a128f5b50dbcc75b7.png)
!(https://img-blog.csdnimg.cn/img_convert/5e66f72f3c8fc0adeb789606fb214581.png)
!(https://img-blog.csdnimg.cn/img_convert/afd031fbcb8193e6cd0ccfbe6a2f6afb.png)
!(https://img-blog.csdnimg.cn/img_convert/ffe1253dbc2c096c89d462938c5af575.png)
!(https://img-blog.csdnimg.cn/img_convert/3511318f4eeedd2e4fe01fc274ca9874.png)
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!**
**由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**
在阿里**
**深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
**因此收集整理了一份《2024年最新Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。**
[外链图片转存中...(img-bjdNn6CD-1714735267252)]
[外链图片转存中...(img-SAdmk2cl-1714735267253)]
[外链图片转存中...(img-4vGthWtq-1714735267253)]
[外链图片转存中...(img-OYZErixt-1714735267253)]
[外链图片转存中...(img-06fnzki4-1714735267253)]
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!**
**由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
**[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]