密码和 IP 地址到答题框
发布时间:2025-06-24 18:08:55 作者:北方职教升学中心 阅读量:063
(1)环境配置
(2) 修改 Redis 配置文件(所有节点操作)
systemctl stop firewalldsetenforce 0 vim /opt/redis-5.0.7/sentinel.confprotected-mode no #17行,关闭保护模式port 26379 #21行,Redis哨兵默认的监听端口daemonize yes #26行,指定sentinel为后台启动logfile "/var/log/sentinel.log"#36行,指定日志存放路径dir"/var/lib/redis/6379"#65行,指定数据库存放路径sentinel monitor mymaster 192.168.154.19 6379 2 #84行,修改 指定该哨兵节点监控192.168.184.10:6379这个主节点,该主节点的名称是mymaster,最后的2的含义与主节点的故障判定有关:至少需要2个哨兵节点同意,才能判定主节点故障并进行故障转移sentinel down-after-milliseconds mymaster 30000 #113行,判定服务器down掉的时间周期,默认30000毫秒(30秒)sentinel failover-timeout mymaster 180000 #146行,故障节点的最大超时时间为180000(180秒)
(3)启动哨兵模式
cd /opt/redis-5.0.7/redis-sentinel sentinel.conf &注意!先启动主服务器,再启动从服务器
(4)查看哨兵信息
[root@slave2 redis-5.0.7]# redis-cli -p 26379 info Sentinel# Sentinelsentinel_masters:1sentinel_tilt:0sentinel_running_scripts:0sentinel_scripts_queue_length:0sentinel_simulate_failure_flags:0master0:name=mymaster,status=ok,address=192.168.58.30:6379,slaves=2,sentinels=3[1]+完成 redis-sentinel sentinel.conf
1.检查 redis 主从集群部署正确计 0.5 分
2.检查 redis 集群部署为哨兵节点正确计 0.5 分
【题目 8】Redis 服务调优-AOF
使用上一题安装的Redis 服务。安装与配置完成后提交 skywalking 节点的用户名、
[root@controller ~]# du -sh CentOS7.5-compress.qcow2892M CentOS7.5-compress.qcow2[root@controller ~]# qemu-img convert -c -O qcow2 CentOS7.5-compress.qcow2 CentOS7.5-compress2.qcow2-c 压缩-O qcow2 输出格式为 qcow2CentOS7.5-compress.qcow2 被压缩的文件CentOS7.5-compress2.qcow2 压缩完成后文件[root@controller ~]# du -sh CentOS7.5-compress2.qcow2405M CentOS7.5-compress2.qcow2
1.检查镜像压缩正确计 0.5 分
【题目 4】glance 对接 cinder 后端存储
在自行搭建的OpenStack 平台中修改相关参数,使glance 可以使用cinder 作为后端存储, 将镜像存储于cinder 卷中。修复完成后提交该云主机的用户名、使用自行搭建的OpenStack 私有云平台,分别通过用户级别、
修改主机名
[root@node-1 ~]# hostnamectl set-hostname node-1[root@node-1 ~]# hostnamectl Static hostname: node-1 Icon name: computer-vm Chassis: vm Machine ID: cc2c86fe566741e6a2ff6d399c5d5daa Boot ID: 6c32a0c1d29e4f30929422c8032239ca Virtualization: kvmOperating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-1160.el7.x86_64 Architecture: x86-64
将提供的elasticsearch-7.17.0-linux-x86_64.tar.gz软件包上传到此节点并解压到/opt目录,进入解压后的目录并创建data目录
[root@node-1 ~]# tar -zxvf elasticsearch-7.17.0-linux-x86_64.tar.gz -C /opt[root@node-1 ~]# cd /opt/elasticsearch-7.17.0/[root@node-1 elasticsearch-7.17.0]# mkdir data
修改Elasticsearch配置,修改并添加如下几行内容
[root@node-1 elasticsearch-7.17.0]# vi config/elasticsearch.yml…cluster.name: my-applicationnode.name: node-1path.data: /opt/elasticsearch-7.17.0/datapath.logs: /opt/elasticsearch-7.17.0/logsnetwork.host: 0.0.0.0cluster.initial_master_nodes: ["node-1"]…http.cors.enabled: truehttp.cors.allow-origin: "*"http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
创建Elasticsearch启动用户,并设置属组及权限
[root@node-1 elasticsearch-7.17.0]# groupadd elsearch[root@node-1 elasticsearch-7.17.0]# useradd elsearch -g elsearch -p elasticsearch[root@node-1 elasticsearch-7.17.0]# chown -R elsearch:elsearch /opt/elasticsearch-7.17.0
修改资源限制及内核配置,添加如下内容
[root@node-1 elasticsearch-7.17.0]# vi /etc/security/limits.conf…* hard nofile 65536* soft nofile 65536[root@node-1 elasticsearch-7.17.0]# vi /etc/sysctl.confvm.max_map_count=262144[root@node-1 elasticsearch-7.17.0]# sysctl -p[root@node-1 elasticsearch-7.17.0]# reboot
启动Elasticsearch服务
[root@node-1 ~]# cd /opt/elasticsearch-7.17.0/[root@node-1 elasticsearch-7.17.0]# su elsearch[elsearch@node-1 elasticsearch-7.17.0]$ ./bin/elasticsearch -d按Ctrl+D退出
查询端口,存在9200则成功启动
[root@node-1 elasticsearch-7.17.0]# netstat -ntplActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1081/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1041/master tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 610/rpcbind tcp6 0 0 :::9300 :::* LISTEN 2261/java tcp6 0 0 :::22 :::* LISTEN 1081/sshd tcp6 0 0 ::1:25 :::* LISTEN 1041/master tcp6 0 0 :::111 :::* LISTEN 610/rpcbind tcp6 0 0 :::9200 :::* LISTEN 2261/java
使用提供的jdk-8u144-linux-x64.tar.gz软件包,上传jdk软件包,配置jdk如下
[root@node-1 ~]# tar -zxvf jdk-8u144-linux-x64.tar.gz -C /usr/local/[root@node-1 ~]# vi /etc/profile# /etc/profileexport JAVA_HOME=/usr/local/jdk1.8.0_144export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jarexport PATH=$PATH:${JAVA_HOME}/bin…[root@node-1 ~]# source /etc/profile[root@node-1 ~]# java -versionjava version "1.8.0_144"Java(TM) SE Runtime Environment (build 1.8.0_144-b01)Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
进入解压后目录,修改OAP配置文件
[root@node-1 ~]# cd /opt/apache-skywalking-apm-bin-es7/[root@node-1 apache-skywalking-apm-bin-es7]# vi config/application.yml…#集群配置使用单机版cluster:selector: ${SW_CLUSTER:standalone}standalone:…#数据库使用elasticsearch7storage:selector: ${SW_STORAGE:elasticsearch7}…elasticsearch7: nameSpace: ${SW_NAMESPACE:""} clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:172.128.11.32:9200}
启动OAP服务,查询端口,存在11800与12800则成功启动
[root@node-1 apache-skywalking-apm-bin-es7]# ./bin/oapService.shSkyWalking OAP started successfully![root@node-1 apache-skywalking-apm-bin-es7]# netstat -ntplActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1081/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1041/master tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 610/rpcbind tcp6 0 0 :::9300 :::* LISTEN 2261/java tcp6 0 0 :::22 :::* LISTEN 1081/sshd tcp6 0 0 :::11800 :::* LISTEN 2416/java tcp6 0 0 ::1:25 :::* LISTEN 1041/master tcp6 0 0 :::12800 :::* LISTEN 2416/java tcp6 0 0 :::111 :::* LISTEN 610/rpcbind tcp6 0 0 :::9200 :::* LISTEN 2261/java
部署SkyWalking UI服务由于SkyWalking UI的默认地址是8080,与很多中间件可能存在冲突,修改一下
[root@node-1 apache-skywalking-apm-bin-es7]# vi webapp/webapp.yml…server:port: 8888…
启动SkyWalking UI服务
[root@node-1 apache-skywalking-apm-bin-es7]# ./bin/webappService.shSkyWalking Web Application started successfully!
查看端口,存在8888则成功启动
[root@node-1 apache-skywalking-apm-bin-es7]# netstat -ntplActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1081/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1041/master tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 610/rpcbind tcp6 0 0 :::9300 :::* LISTEN 2261/java tcp6 0 0 :::22 :::* LISTEN 1081/sshd tcp6 0 0 :::8888 :::* LISTEN 3133/java tcp6 0 0 :::11800 :::* LISTEN 2416/java tcp6 0 0 ::1:25 :::* LISTEN 1041/master tcp6 0 0 :::12800 :::* LISTEN 2416/java tcp6 0 0 :::111 :::* LISTEN 610/rpcbind tcp6 0 0 :::9200 :::* LISTEN 2261/java
搭建并启动应用商城服务,并配置SkyWalking Agent修改mall节点主机名
[root@localhost ~]# hostnamectl set-hostname mall[root@mall ~]# hostnamectl Static hostname: mall Icon name: computer-vm Chassis: vm Machine ID: cc2c86fe566741e6a2ff6d399c5d5daa Boot ID: 51559d155ec14aafad2411ca8b85db42 Virtualization: kvmOperating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-1160.el7.x86_64 Architecture: x86-64
修改/etc/hosts配置文件如下
[root@mall ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6172.128.11.42 mal
将提供的gpmall包上传到服务器的/root目录下并解压gpmall.tar.gz,配置本地local.repo文件
[root@mall ~]# mv /etc/yum.repos.d/* /media/[root@mall ~]# cd gpmall/[root@mall gpmall]# tar -zxvf gpmall-repo.tar.gz -C /root/[root@mall ~]# cat /etc/yum.repos.d/local.repo[mall]name=mallbaseurl=file:///root/gpmall-repogpgcheck=0enabled=1
安装基础服务,包括Java JDK环境、Redis、密码和 IP 地址到答题框。可以通过修改 nova 的配置文件来自动清理该缓存目录,即在该节点没有使用某镜像启动的云主机,那么这个镜像在过一定的时间后会被自动删除。
需要比赛镜像根据实际情况操作
1.检查错误镜像glance 服务启动正确计 1 分
【题目 13】排错:数据库排错[1.5 分]
使用赛项提供的排错镜像 chinaskill-error2 创建一台云主机(云主机的登录用户名为 root, 密码为 000000),该云主机中存在错误的数据库服务,错误现象为数据库服务无法启动。系统级别、密码和 IP 地址到答题框。完成后提交 JumpServer 节点的用户名、完成后提交修改节点的用户名、
[root@mall ~]# vi /etc/redis.conf…#bind 127.0.0.1protected-mode no…[root@mall ~]# systemctl start redis[root@mall ~]# systemctl enable redisCreated symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
启动Nginx服务命令如下
[root@mall ~]# systemctl start nginx[root@mall ~]# systemctl enable nginxCreated symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
应用系统部署,使用提供gpmall-shopping-0.0.1-SNAPSHOT.jar、
[root@controller ~]# openstack image create --disk-format qcow2 --container-format bare --file cirros-0.3.4-x86_64-disk.img glance-cirros9+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|Field |Value |+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+|checksum |ee1eca47dc88f4879d8a229cc70a07c6 ||container_format |bare ||created_at |2022-09-19T07:02:51Z ||disk_format |qcow2 ||file |/v2/images/3bac7fd7-bc66-4586-9872-3cbea90da5d2/file ||id |3bac7fd7-bc66-4586-9872-3cbea90da5d2 ||min_disk |0 ||min_ram |0 ||name |glance-cirros ||owner |1b29cb9baa394a0eb3d531913dc9ccec ||properties |os_hash_algo='sha512',os_hash_value='1b03ca1bc3fafe448b90583c12f367949f8b0e665685979d95b004e48574b953316799e23240f4f739d1b5eb4c4ca24d38fdc6f4f9d8247a2bc64db25d6bbdb2',os_hidden='False'||protected |False ||schema |/v2/schemas/image ||size |13287936 ||status |active ||tags |||updated_at |2022-09-19T07:02:53Z ||virtual_size |None ||visibility |shared |+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+[root@controller ~]#[root@controller ~]# openstack domain list+----------------------------------+---------+---------+--------------------+|ID |Name |Enabled |Description |+----------------------------------+---------+---------+--------------------+|7fc907bd4a6e471aa6d714ff66646d2a |huhy |True |Default Domain ||default |Default |True |The default domain |+----------------------------------+---------+---------+--------------------+[root@controller ~]#[root@controller ~]# glance member-create 3bac7fd7-bc66-4586-9872-3cbea90da5d2 7fc907bd4a6e471aa6d714ff66646d2a# 镜像id 域名id+--------------------------------------+----------------------------------+---------+|Image ID |Member ID |Status |+--------------------------------------+----------------------------------+---------+|3bac7fd7-bc66-4586-9872-3cbea90da5d2 |7fc907bd4a6e471aa6d714ff66646d2a |pending |+--------------------------------------+----------------------------------+---------+[root@controller ~]#[root@controller ~]# glance member-update 3bac7fd7-bc66-4586-9872-3cbea90da5d2 7fc907bd4a6e471aa6d714ff66646d2a accepted +--------------------------------------+----------------------------------+----------+|Image ID |Member ID |Status |+--------------------------------------+----------------------------------+----------+|3bac7fd7-bc66-4586-9872-3cbea90da5d2 |7fc907bd4a6e471aa6d714ff66646d2a |accepted |+--------------------------------------+----------------------------------+----------+[root@controller ~]#
1.检查glance-cirros 镜像权限开放正确计 0.5 分
【题目 2】OpenStack 消息队列调优
OpenStack 各服务内部通信都是通过 RPC 来交互,各 agent 都需要去连接 RabbitMQ; 随着各服务 agent 增多,MQ 的连接数会随之增多,最终可能会到达上限,成为瓶颈。密码和 IP 地址到答题框。配置完成后提交改动节点的用户名、
2.检查配置 redis 进行 AOF 重写不执行 fsync 正确计 0.5 分
【题目 9】应用部署:堡垒机部署
使用提供的 OpenStack 平台申请一台 CentOS7.9 的云主机,使用提供的软件包安装JumpServer 堡垒机服务,并配置使用该堡垒机对接自己安装的 controller 和 compute 节点。(在提交信息前请准备好 yaml 模板执行的环境)
[root@controller ~]# vim create_container.yamlheat_template_version: 2014-10-16resources: user: type: OS::Container::Swift properties: name: heat-swift#此类题目,在dashboard界面上都有模板可以查询
1.执行heat 模板文件成功创建容器计 0.5 分
【题目 6】OpenStack Nova 清除缓存
在 OpenStack 平台的一台计算节点创建虚拟机,若是第一次在该节点创建次虚拟机,会先将镜像文件复制到该计算节点目录/var/lib/nova/instances/_base。配置完成后提交controller 点的用户名、接下来再申请一台CentOS7.9 的云主机,用于搭建gpmall 商城应用,并配置SkyWalking Agent, 将 gpmall 的 jar 包放置探针并启动。密码和 IP 地址到答题框。在 Redis 中,AOF 配置为以三种不同的方式在磁盘上执行 write 或者 fsync。
需要比赛镜像根据实际情况操作或者使用正常镜像创建一个数据库
1.检查错误镜像数据库服务启动正确计 1.5 分