2024年Linux最全云计算day13-Git 版本控制体系、jenkins安装(笔记),2024 ...

八卦阵  金牌会员 | 2024-6-19 07:15:33 | 来自手机 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 520|帖子 520|积分 1560

为了做好运维面试路上的助攻手,特整理了上百道 【运维技能栈面试题集锦】 ,让你面试不慌心不跳,高薪offer怀里抱!
这次整理的面试题,小到shell、MySQL,大到K8s等云原生技能栈,不仅适合运维新人入行面试需要,还适用于想提升进阶跳槽加薪的运维朋友。

本份面试集锦涵盖了


  • 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起一个别名,轻易记忆
  1. #添加标签
  2. git log --oneline
  3. git tag v1.2    ----> 给当前版本打标签
  4. git tag -a v1.0 -m '注释,优化了修复了什么' <commit的ID>
  5. #删除标签
  6. git tag -d v1.2
  7. [root@k8s-node2 demo]# git log --oneline
  8. b8e21cc add test.txt
  9. 9d5ab15 add test.txt
  10. 382f080 add test.txt
  11. ff6047d add file6 file7
  12. b693580 add file6 file7
  13. 58bea1a add three file
  14. fe9e8c2 add two file
  15. [root@k8s-node2 demo]# git tag
  16. [root@k8s-node2 demo]# git tag v1.2
  17. [root@k8s-node2 demo]# git tag
  18. v1.2
  19. [root@k8s-node2 demo]# git show v1.2
  20. commit b8e21cc519dfd918ee880831e37585afcdf73410
  21. Author: oldqiang <296917342@qq.com>
  22. Date:   Mon Sep 23 12:03:35 2019 +0800
  23.     add test.txt
  24. diff --git a/demo/test.txt b/demo/test.txt
  25. index 69f66d3..d99f9f0 100644
  26. --- a/demo/test.txt
  27. +++ b/demo/test.txt
  28. @@ -1,3 +1,3 @@
  29. 11111
  30. -aaaaa
  31. +22222
  32. 33333
  33. [root@k8s-node2 demo]# git tag -a v1.0 -m 'v1.0 add 后裔' fe9e8c2
  34. [root@k8s-node2 demo]# git tag
  35. v1.0
  36. v1.2
  37. [root@k8s-node2 demo]# git show v1.0
  38. tag v1.0
  39. Tagger: oldqiang <296917342@qq.com>
  40. Date:   Mon Sep 23 12:18:45 2019 +0800
  41. v1.0 add 后裔
  42. commit fe9e8c25cfb61eb63da6681dc09d054cd5739243
  43. Author: oldqiang <296917342@qq.com>
  44. Date:   Mon Sep 23 10:44:54 2019 +0800
  45.     add two file
  46. diff --git a/file1 b/file1
  47. new file mode 100644
  48. index 0000000..5721413
  49. --- /dev/null
  50. +++ b/file1
  51. @@ -0,0 +1 @@
  52. +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


  1. ssh-keygen -t rsa
  2. cat /root/.ssh/id_rsa.pub
  3. cd /root/demo/
  4. ll
  5. git remote add origin git@gitee.com:linuxcx/linux.git
  6. git push -u origin master
复制代码
10. gitlab安装

  1. #上传gitlab-ce-11.9.11-ce.0.el7.x86\_64.rpm到当前目录
  2. echo "192.168.37.202 mirrors.aliyun.com" >>/etc/hosts
  3. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  4. yum localinstall gitlab-ce-11.9.11-ce.0.el7.x86_64.rpm -y
  5. vim  /etc/gitlab/gitlab.rb
  6. #设置访问url和关闭prometheus
  7. external_url 'http://http://gitlablcx.com'
  8. prometheus_monitoring['enable'] = false
  9. #配置gitlab通过smtp发送邮件
  10. [root@k8s-node2 demo]# vim /etc/gitlab/gitlab.rb
  11. gitlab_rails['gitlab\_email\_enabled'] = true
  12. gitlab_rails['gitlab\_email\_from'] = '245684979@qq.com'
  13. gitlab_rails['gitlab\_email\_display\_name'] = 'linux\_gitlab'
  14. gitlab_rails['smtp\_enable'] = true
  15. gitlab_rails['smtp\_address'] = "smtp.qq.com"
  16. gitlab_rails['smtp\_port'] = 465
  17. gitlab_rails['smtp\_user\_name'] = "245684979"
  18. gitlab_rails['smtp\_password'] = "lvlina.199625"
  19. gitlab_rails['smtp\_domain'] = "qq.com"
  20. gitlab_rails['smtp\_authentication'] = "login"
  21. gitlab_rails['smtp\_enable\_starttls\_auto'] = true
  22. gitlab_rails['smtp\_tls'] = true
  23. #重新配置
  24. gitlab-ctl reconfigure
复制代码
11.gitlab汉化


  1. #下载汉化包
  2. https://gitlab.com/xhang/gitlab
  3. gitlab-ctl stop
  4. tar xf gitlab-11-9-stable-zh.tar.gz
  5. \cp -a gitlab-11-9-stable-zh/* /opt/gitlab/embedded/service/gitlab-rails/
复制代码

12. gitlab-用户-用户组-项目之间的关系

先创建用户组,在基于用户组创建项目,最后创建用户,编辑用户组,添加成员,注意权限

13. gitlab备份和规复

  1. #备份
  2. gitlab-rake gitlab:backup:create
  3. #恢复
  4. gitlab-ctl stop
  5. gitlab-rake gitlab:backuip:restore BACKUP=1510472027_2019_09_23_9.4.5
  6. gitlab-ctl start
  7. vim /etc/gitlab/gitlab.rb
  8. gitlab_rails['manage\_backup\_path'] = true
  9. gitlab_rails['backup\_path'] = "/var/opt/gitlab/backups"
  10. gitlab_rails['backup\_keep\_time'] = 604800
  11. #迁移云主机
  12. 先备份,云主机安装相同版本,恢复
  13. #更新配置
  14. gitlab-ctl reconfigure
复制代码
14.gitlab版本升级

  1. gitlab升级,要小版本跨   10--->11--->12
复制代码
扩展内容:
   1.安装svn服务器,将svn中的数据迁徙到git仓库
git-svn
git clone svn
  svn是一个中心化的版本控制工具,git是分布式的,每个人都可以有完备的代码仓库
  1. #安装svn
  2. yum install subversion -y
  3. mkdir /svn/repo -p
  4. #初始化仓库
  5. svnadmin create /svn/repo
  6. cd /svn/repo/conf
  7. vim  svnserve.conf
  8. [general]
  9. anon-access = none
  10. auth-access = write
  11. password-db = passwd
  12. authz-db = authz
  13. realm = /svn/repo
  14. [sasl]
  15. vim passwd
  16. [users]
  17. admin = 123456
  18. vim authz
  19. [/]
  20. admin = rw
  21. test = r
  22. 启动svn服务
  23. svnserve -d -r /svn/repo
  24. #svn迁移到git
  25. yum  install  git-svn  -y
  26. git svn clone svn://10.0.0.13 --username=admin --no-metadata --authors-file=password.txt git
  27. cat password.txt
  28. admin=<245684979@qq.com>
复制代码
  2.找回gitlab的root密码
  1. [/code] [size=4]2. 持续摆设[/size]
  2.    gitlab, lb(摆设服务器), web01,web02
  3.   [code]#lb01,web01,web02都按照nginx
  4. echo "192.168.37.202 mirrors.aliyun.com" >>/etc/hosts
  5. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  6. curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  7. yum install nginx -y
  8. #创建upstream资源池文件
  9. vim  /etc/nginx/upstream_monitor
  10. server 10.0.0.7;
  11. server 10.0.0.8;
  12. #配置lb01负载均衡
  13. vim /etc/nginx/nginx.conf
  14. worker_processes  1;
  15. events {
  16.     worker_connections  1024;
  17. }
  18. http {
  19.     include       mime.types;
  20.     default_type  application/octet-stream;
  21.     sendfile        on;
  22.     keepalive_timeout  65;
  23.     upstream monitor {
  24.     include /etc/nginx/upstream_monitor;
  25.     }
  26.     server {
  27.         listen       80;
  28.         server_name  monitor.oldqiang.com;
  29.         location / {
  30.            proxy_pass http://monitor;
  31.            proxy_set_header Host $host;
  32.            proxy_set_header X-Forwarded-For $remote\_addr;
  33.         }
  34.     }
  35. }
  36. nginx -t
  37. systemctl restart nginx
  38. systemctl enable nginx
  39. #配置web01和web02,文件内容相同
  40. vi /etc/nginx/nginx.conf
  41. worker_processes  1;
  42. events {
  43.     worker_connections  1024;
  44. }
  45. http {
  46.     include       mime.types;
  47.     default_type  application/octet-stream;
  48.     sendfile        on;
  49.     keepalive_timeout  65;
  50.     server {
  51.         listen       80;
  52.         server_name  monitor.oldqiang.com;
  53.         location / {
  54.             root   /code/web;
  55.             index  index.html index.htm;
  56.         }
  57.     }
  58. }
  59. nginx -t
  60. systemctl restart nginx
  61. systemctl enable nginx
  62. #在web01和web02创建首页并创建软连接
  63. [root@cx01 nginx]# cd /code/
  64. [root@cx01 code]# mkdir web\_v1
  65. [root@cx01 code]# echo web01 >web\_v1/index.html
  66. [root@cx01 code]# ln -s web\_v1 web
  67. [root@cx01 code]# ll
  68. total 0
  69. lrwxrwxrwx 1 root root  6 Sep 24 11:11 web -> web_v1
  70. drwxr-xr-x 2 root root 24 Sep 24 11:11 web_v1
  71. [root@web02 code]# cd /code/
  72. [root@web02 code]# mkdir web\_v1
  73. [root@web02 code]# echo web02 >web\_v1/index.html
  74. [root@web02 code]# ln -s web\_v1 web
  75. [root@web02 code]# ll
  76. total 0
  77. lrwxrwxrwx 1 root root  6 Sep 24 11:12 web -> web_v1
  78. drwxr-xr-x 2 root root 24 Sep 24 11:12 web_v1
  79. #在windows上做hosts解析
  80. C:\Windows\System32\drivers\etc\hosts
  81. 10.0.0.5 http://monitor.lcx.com/
复制代码

新建项目
   

  流程
   

  1. #在gitlab上
  2. git config --global user.name "Administrator"
  3. git config --global user.email "admin@example.com"
  4. mkdir /code
  5. cd /code/
  6. ls
  7. wget http://192.168.37.202/linux59/monitor_html.tar.gz
  8. ls
  9. tar  xf monitor_html.tar.gz
  10. cd monitor/
  11. ls
  12. ls .git/
  13. git branch
  14. git log --oneline
  15. [root@k8s-node2 monitor]# mkdir -p /server/scripts
  16. [root@k8s-node2 monitor]# cd /server/scripts/
  17. ============================================================
  18. [root@lb scripts]# cat auto\_deploy.sh
  19. #!/bin/bash
  20. serverlist="10.0.0.7 10.0.0.8"
  21. #代码更新
  22. fabu() {
  23. cd /code/monitor/ && \
  24. git pull -u origin
  25. version=`git tag|tail -1`
  26. echo $version
  27. tar zcf /code/monitor_${version}.tar.gz *
  28. for ip in $serverlist
  29. do
  30.   scp -rp /code/monitor_${version}.tar.gz root@${ip}:/code
  31.   ssh  root@${ip} "mkdir -p /code/web\_${version} &&
  32. tar xf /code/monitor\_${version}.tar.gz -C /code/web\_${version} && \
  33. rm -fr /code/web && ln -s /code/web\_${version} /code/web && rm -fr /code/monitor\_${version}.tar.gz "
  34. done
  35. }
  36. huigun() {
  37.    cd /code/monitor/
  38.    version=`git tag|tail -1`
  39.    last_version=`git tag|tail -2|head -1`
  40.    for ip in $serverlist
  41.    do
  42.         ssh root@${ip} "rm -fr /code/web && ln -s /code/web\_${last\_version} /code/web"
  43.    done
  44. }
  45. case $1 in
  46. deploy)
  47.    fabu;
  48. ;;
  49. rollback)
  50.     huigun;
  51. ;;
  52. *)
  53.    echo '无效的参数';
  54. esac
  55. **先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前在阿里**
  56. **深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
  57. **因此收集整理了一份《2024年最新Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。**
  58. ![img](https://img-blog.csdnimg.cn/img_convert/141a1a9905e28b0a128f5b50dbcc75b7.png)
  59. ![img](https://img-blog.csdnimg.cn/img_convert/5e66f72f3c8fc0adeb789606fb214581.png)
  60. ![img](https://img-blog.csdnimg.cn/img_convert/afd031fbcb8193e6cd0ccfbe6a2f6afb.png)
  61. ![img](https://img-blog.csdnimg.cn/img_convert/ffe1253dbc2c096c89d462938c5af575.png)
  62. ![img](https://img-blog.csdnimg.cn/img_convert/3511318f4eeedd2e4fe01fc274ca9874.png)
  63. **既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!**
  64. **由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
  65. **[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**
  66. 在阿里**
  67. **深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**
  68. **因此收集整理了一份《2024年最新Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。**
  69. [外链图片转存中...(img-bjdNn6CD-1714735267252)]
  70. [外链图片转存中...(img-SAdmk2cl-1714735267253)]
  71. [外链图片转存中...(img-4vGthWtq-1714735267253)]
  72. [外链图片转存中...(img-OYZErixt-1714735267253)]
  73. [外链图片转存中...(img-06fnzki4-1714735267253)]
  74. **既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上运维知识点,真正体系化!**
  75. **由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
  76. **[需要这份系统化的资料的朋友,可以点击这里获取!](https://bbs.csdn.net/topics/618542503)**
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

八卦阵

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表