nacos 常见问题整理包含容器环境

news2025/2/24 21:26:10

文章目录

  • 0. nacos客户端日志文件位置
  • 最常见的问题
  • 1. 容器环境端口开放不够导致的问题
    • 原理解析
  • 2.服务端启用了鉴权
      • 客户端常见错误信息如下
      • 服务端报错信息如下
  • 其他一些问题
    • 0. nacos高版本服务端是否支持旧的客户端?
    • 1. Error code:503,msg:server is DOWN now, please try again later! during using.
    • 2. com.alibaba.nacos.consistency.entity can't be found in source codes
    • 3. Error Connection is unregistered. or Client not connected, current status:STARTING during startup client.
    • Nacos2.0增加了用于GRPC通信的9848和9849端口。是否需要在application.properties中配置额外的设置?
    • nginx 代理 nacos 2.x版本问题
    • 1071 - nacos 数据库 Specified key was too long; max key length is 767 bytes, Time: 0.008000s
    • nacos java.net.ConnectException: no available server, currentServerAddr
    • c.a.c.n.registry.NacosServiceRegistry : nacos registry,xx register
    • nacos Error to process server push response 报错

在这里插入图片描述

0. nacos客户端日志文件位置

有的问题我们都是基于日志分析,所以大家要了解日志的文件在哪
windows下 C:\Users\用户名\logs\nacos
linux 在 当前用户目录下 ~\logs\nacos

最常见的问题

虽然nacos支持客户端版本和服务端版本不同甚至差异很大的情况下服务端也能正常服务,但是在这个过程中会出现一些。
目前服务端2.2版本也是支持client 依赖未1.4版本正常运行。 但是当支持2.2.x客户端版本的时候,就需要做一些额外的配置。比如端口,以及鉴权等。

1. 容器环境端口开放不够导致的问题

报错信息
2023-11-01 14:14:33.223 ERROR [com.alibaba.nacos.client.remote.worker:c.a.n.c.r.c.g.GrpcClient] Server check fail, please check server 10.161.xx.xx ,port 9848 is available , error ={}
java.util.concurrent.TimeoutException: Waited 3000 milliseconds (plus 719300 nanoseconds delay) for com.alibaba.nacos.shaded.io.grpc.stub.ClientCallsKaTeX parse error: Expected '}', got 'EOF' at end of input: ….ProtoLiteUtilsMessageMarshaller@31611954, responseMarshaller=com.alibaba.nacos.shaded.io.grpc.protobuf.lite.ProtoLiteUtils M e s s a g e M a r s h a l l e r @ 3 e 598 d f 9 , s c h e m a D e s c r i p t o r = c o m . a l i b a b a . n a c o s . a p i . g r p c . a u t o . R e q u e s t G r p c MessageMarshaller@3e598df9, schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpc MessageMarshaller@3e598df9,schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpcRequestMethodDescriptorSupplier@7e31ce0f}}}]]
at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:508) ~[nacos-client-2.2.0.jar:na]
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:196) [nacos-client-2.2.0.jar:na]
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:307) [nacos-client-2.2.0.jar:na]
at com.alibaba.nacos.common.remote.client.RpcClient.reconnect(RpcClient.java:498) [nacos-client-2.2.0.jar:na]
at com.alibaba.nacos.common.remote.client.RpcClient.lambda$start 2 ( R p c C l i e n t . j a v a : 339 ) [ n a c o s − c l i e n t − 2.2.0. j a r : n a ] a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s 2(RpcClient.java:339) [nacos-client-2.2.0.jar:na] at java.util.concurrent.Executors 2(RpcClient.java:339)[nacosclient2.2.0.jar:na]atjava.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511) ~[na:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access 201 ( S c h e d u l e d T h r e a d P o o l E x e c u t o r . j a v a : 180 )   [ n a : 1.8. 0 1 31 ] a t j a v a . u t i l . c o n c u r r e n t . S c h e d u l e d T h r e a d P o o l E x e c u t o r 201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor 201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0131]atjava.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_131]
2023-11-01 14:14:36.330 ERROR [com.alibaba.nacos.client.remote.worker:c.a.n.c.r.c.g.GrpcClient] Server check fail, please check server 10.161.xx.xx ,port 9848 is available , error ={}

查阅资料
https://nacos.io/en-us/docs/v2/upgrading/2.0.0-compatibility.html
在这里插入图片描述

Whether support the old client? Configuration Management can support
all clients after 1.0, and Service Management can support all client
after 1.2.

So recommending use Nacos client after 1.2.0.

But Nacos 1.X client can’t use new connection features, so
recommending to use 2.0.0 client strongly.

Error code:503,msg:server is DOWN now, please try again later! during
using. After version 1.4, Nacos use SOFA-Jraft to replace old raft
implementation by nacos-self. Jraft will election leader with raft
protocol and save the cluster metadata. If cluster restart with ip
changed, it might cause Jraft can election leader successfully so that
nacos can’t start up.

The solution is removed the data directory under nacos directory and
restart.

Or use -Dnacos.server.ip=${domain} jvm parameters to start nacos and
set domain list in nacos/conf/cluster.conf to avoid the ip change
effect.

com.alibaba.nacos.consistency.entity can’t be found in source codes
This package will be auto-generated by protobuf, so if you want to
read source code or do some develop, you can use mvn compile to
generate them. If you are using IDEA, you can also use IDEA’s protobuf
plugin.

Error Connection is unregistered. or Client not connected, current
status:STARTING during startup client. The reason is that the client
gRPC cannot establish a connection with the server. Please use telnet
n a c o s . s e r v e r . a d d r e s s : {nacos.server.address}: nacos.server.address:{nacos.server.grpc.port} to test the network
and to check the server port is correct.

If there is no problem with the server, check whether the
configuration is wrong. The configured ports of the server and client
should be the same.

If there is no problem with the configuration, check whether there is
a firewall or VIP port forwarding problem. The gRPC ports of Nacos2.0
are calculated by the offset of the main port, so the port forwarding
also needs to meet the offset.

Nacos2.0 adds ports 9848 and 9849 for GRPC communication. Do I need to
configure additional settings in application.properties? No, these two
ports are calculated by 8848 + 1000 and 8848 + 1001 in Nacos2.0
internally. No additional configuration by the user is required in the
configuration file. But if you are using docker or there is a port
forwarding method to start, you need to configure these two ports.

###I want to start nacos2.0, and uses nginx proxy, how to deal with the port 9848, should it be exposed through nginx?

If there is a firewall or nginx port forwarding problem, you need to
configure the corresponding port exposure. For example, in nginx, on
the basis of the already exposed 8848(x), an additional 9848(x+1000)
needs to be exposed.

原理解析

在Nacos 2.2.0版本中,主要涉及4个端口

  1. 8848:这是Nacos服务器的默认端口,客户端通过此端口连接到Nacos服务器获取配置信息和服务注册信息。

  2. 7848:这是Nacos服务器的集群通信端口,它主要在集群模式下使用,用于节点间的状态同步。

  3. 9848:这是Nacos服务器的嵌入式的CP协议Raft通信端口。

  4. 9849:这是Nacos服务器的嵌入式的CP协议Raft Leader选举端口。

这些端口都可以在Nacos的配置文件中进行修改。
在这里插入图片描述

2.服务端启用了鉴权

服务端配置了 nacos.auth.enable=true

nacos 的yaml

kind: ConfigMap
apiVersion: v1
metadata:
  name: nacos-cm
  namespace: hngh-dev
  annotations:
    originName: nacos-cm
data:
  mysql.db.host: mysql8.dev.ahn1.e6niu.com
  mysql.db.name: hnhg3_nacos_config
  mysql.param: characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false
  mysql.password: WiY_y_syt1gu7gvO0ev-
  mysql.port: '3306'
  mysql.user: hnhg3_user
  nacos.auth.enable: 'false'
  nacos.auth.identity.key: nacos
  nacos.auth.identity.value: nacos
  nacos.auth.token: YkFdyixnNhUZOp6pWw902QjBnqJH3HAmCJTAwYQgzu4=

客户端常见错误信息如下

错误文件在
windows下 C:\Users\用户名\logs\nacos
linux 在 当前用户目录下 ~\logs\nacos
错误内容如下
ERROR c.a.n.c.a.i.process.HttpLoginProcessor : login failed: {“code”:500,“message”:“caused: Cannot invoke “com.alibaba.nacos.plugin.auth.impl.jwt.NacosJwtParser.getExpireTimeInSeconds(String)” because “this.jwtParser” is null;”,“header”:{“header”:{“Accept-Charset”:“UTF-8”,“Authorization”:“Bearer”,“Connection”:“close”,“Content-Length”:“142”,“Content-Security-Policy”:“script-src ‘self’”,“Content-Type”:“text/html;charset=UTF-8”,“Date”:“Tue, 25 Jul 2023 02:58:33 GMT”,“Vary”:“Access-Control-Request-Headers”},“originalResponseHeader”:{“Authorization”:[“Bearer”],“Connection”:[“close”],“Content-Length”:[“142”],“Content-Security-Policy”:[“script-src ‘self’”],“Content-Type”:[“text/html;charset=UTF-8”],“Date”:[“Tue, 25 Jul 2023 02:58:33 GMT”],“Vary”:[“Access-Control-Request-Headers”,“Access-Control-Request-Method”,“Origin”]},“charset”:“UTF-8”}}

服务端报错信息如下

打开服务端日志文件,报错详情如下:
2023-07-25 10:58:23,669 ERROR CONSOLE /nacos/v1/auth/users/login

java.lang.NullPointerException: Cannot invoke “com.alibaba.nacos.plugin.auth.impl.jwt.NacosJwtParser.getExpireTimeInSeconds(String)” because “this.jwtParser” is null
at com.alibaba.nacos.plugin.auth.impl.token.impl.JwtTokenManager.getTokenTtlInSeconds(JwtTokenManager.java:150)
at com.alibaba.nacos.plugin.auth.impl.token.TokenManagerDelegate.getTokenTtlInSeconds(TokenManagerDelegate.java:89)
at com.alibaba.nacos.plugin.auth.impl.controller.UserController.login(UserController.java:235)
at jdk.internal.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at

其他一些问题

0. nacos高版本服务端是否支持旧的客户端?

配置管理支持1.0之后的所有客户端,服务管理支持1.2之后的所有客户端。

因此,建议使用1.2.0之后的Nacos客户端。

但是,Nacos 1.X客户端不能使用新的连接功能,所以强烈建议使用2.0.0客户端。

1. Error code:503,msg:server is DOWN now, please try again later! during using.

在使用过程中出现错误代码:503,消息:服务器现在关闭,请稍后再试!
在1.4版本之后,Nacos用SOFA-Jraft替换了自己的旧raft实现。Jraft会用raft协议选举领导者并保存集群元数据。如果集群在ip改变后重启,可能会导致Jraft无法成功选举领导者,从而使nacos无法启动。

解决方案

删除nacos目录下的数据目录并重新启动。

或者使用-Dnacos.server.ip=${domain} jvm参数启动nacos,并在nacos/conf/cluster.conf中设置域名列表,以避免ip更改影响。

2. com.alibaba.nacos.consistency.entity can’t be found in source codes

在源代码中找不到com.alibaba.nacos.consistency.entity 错误
这个包是由protobuf自动生成的,所以如果你想阅读源代码或进行一些开发,你可以使用mvn编译来生成它们。如果你在使用IDEA,你也可以使用IDEA的protobuf插件。

3. Error Connection is unregistered. or Client not connected, current status:STARTING during startup client.

启动客户端时出现错误 连接未注册。或者 客户端未连接,当前状态:正在启动。

原因是客户端gRPC无法与服务器建立连接。

解决方案
请使用telnet n a c o s . s e r v e r . a d d r e s s : {nacos.server.address}: nacos.server.address:{nacos.server.grpc.port}测试网络,并检查服务器端口是否正确。

如果服务器没有问题,检查配置是否错误。服务器和客户端的配置端口应该相同。

如果配置没有问题,检查是否存在防火墙或VIP端口转发问题。Nacos2.0的gRPC端口是通过主端口的偏移量计算的,所以端口转发也需要满足偏移量。

Nacos2.0增加了用于GRPC通信的9848和9849端口。是否需要在application.properties中配置额外的设置?

不需要,这两个端口在Nacos2.0内部通过8848 + 1000和8848 + 1001计算得出。用户在配置文件中不需要进行额外配置。
但是,如果你正在使用docker或者有端口转发方式启动,你需要配置这两个端口。

nginx 代理 nacos 2.x版本问题

如果存在防火墙或nginx端口转发问题,需要配置相应的端口暴露。例如,在nginx中,除了已经暴露的8848(x),还需要额外暴露9848(x+1000)。

1071 - nacos 数据库 Specified key was too long; max key length is 767 bytes, Time: 0.008000s

这个是bug 已经修复 https://github.com/alibaba/nacos/pull/11307

nacos java.net.ConnectException: no available server, currentServerAddr

这个问题在容器环境遇到过,因为服务下线和网络不稳定导致

c.a.c.n.registry.NacosServiceRegistry : nacos registry,xx register

failed…NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr=‘nacos:8848’, username=‘service’, password=‘nacos’, endpoint=‘’, namespace=‘’, watchDelay=30000, logName=‘’, service=‘xx’, weight=1.0, clusterName=‘DEFAULT’, group=‘DEFAULT_GROUP’, namingLoadCacheAtStart=‘false’, metadata={IPv6=null, preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip=‘xx.xx.xx.xx’, networkInterface=‘’, port=xx, secure=false, accessKey=‘’, secretKey=‘’, heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, instanceEnabled=true, ephemeral=true, failureToleranceEnabled=false}, ipDeleteTimeout=null, failFast=true}},

com.alibaba.nacos.api.exception.NacosException: authorization failed!

nacos Error to process server push response 报错

通过debug发现,好像是PlayloadRegistry中的 REGISTRY_REQUEST,没有注册NotifySubscriberRequest ,从服务端push一个这个类型的消息过来。
在这里插入图片描述
引入依赖导致的

<dependency>
   <groupId>org.reflections</groupId>
   <artifactId>reflections</artifactId>
</dependency>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1159007.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

XML External Entity-XXE-XML实体注入

XML 实体? XML 实体允许定义标签,在解析 XML 文档时这些标签将被内容替换。一般来说,实体分为三种类型: 内部实体 外部实体 参数实体。 必须在文档类型定义(DTD)中创建实体 一旦 XML 文档被解析器处理,它将js用定义的常量“Jo Smith”替换定义的实体。正如您所看到…

智慧公厕:让城市更宜居的升级之路

随着智慧城市建设的不断推进&#xff0c;公共厕所的升级改造也成为了重要的一环。智慧公厕的强大功能正助力着公共厕所的升级进程&#xff0c;为城市居民和游客提供更加便利和舒适的厕所体验。本文将以智慧公厕实力源头厂家广州中期科技有限公司专业的智慧公厕整体解决方案&…

精品Python考研调配系统考试成绩招生调剂-爬虫可视化大屏

《[含文档PPT源码等]精品基于Python的考研调配系统-爬虫》该项目含有源码、文档、PPT、配套开发软件、软件安装教程、项目发布教程、包运行成功&#xff01; 软件开发环境及开发工具&#xff1a; 开发语言&#xff1a;python 使用框架&#xff1a;Django 前端技术&#xff…

虹科分享 | 太赫兹成像技术透视分层结构助力文物研究

文章来源&#xff1a;虹科光电Hophotonix 阅读链接&#xff1a;虹科分享 | 太赫兹成像技术透视分层结构助力文物研究 对于时间分辨成像方法来说&#xff0c;分层结构的无创检测具有挑战性&#xff0c;其中分辨率和对比度可能会因层间反射和色散的突出信号衰减而受到影响。在一…

配置vue 环境

一、安装Node.js及配置环境 环境变量配置 第一步&#xff1a;“此电脑”-右键-“属性”-“高级系统设置”-“高级”-“环境变量” 第二步&#xff08;我的为&#xff1a;C:\Program Files\nodejs &#xff09;&#xff0c;然后编辑path&#xff0c;新建&#xff0c;为&#xf…

智慧矿山:利用AI算法实现皮带撕裂的实时监测和预警

随着科技的进步&#xff0c;人工智能&#xff08;AI&#xff09;在各行各业的应用越来越广泛。智慧矿山作为矿业领域的发展趋势&#xff0c;对提高矿山安全和生产效率具有重要意义。其中&#xff0c;皮带撕裂是矿山生产中常见的故障之一&#xff0c;因此&#xff0c;利用AI算法…

sqli 靶场 Level23-Level30 wp

level-23 &#xff08;注释被过滤&#xff09; 抓包&#xff0c;查看正常请求和响应。 略 尝试是否存在注入 id1’,id1’&#xff0c;成周期性变化 尝试 POC POC: id1andextractValue(1,concat(0x7e,user()))-- 结果&#xff1a;failed。怀疑–被过滤掉了&#xff0c;尝试…

YApi接口管理平台远程代码执行漏洞复现

一、简介 YAPI是由去哪儿网移动架构组(简称YMFE&#xff0c;一群由FE、iOS和Android工程师共同组成的最具想象力、创造力和影响力的大前端团队)开发的可视化接口管理工具&#xff0c;是一个可本地部署的、打通前后端及QA的接口管理平台。YAPI旨在为开发、产品和测试人员提供更优…

【JavaScript】JS基础语法

1 JavaScript 的书写形式 1.1 行内式 直接嵌入到 html 元素内部 <input type"button" value"按钮" onclick"alert(hello JavaScript)" >1.2 内嵌式 写在script标签内 <script>alert("haha")</script>1.3 外部式…

京东大数据平台(京东数据分析):9月京东牛奶乳品排行榜

鲸参谋监测的京东平台9月份牛奶乳品市场销售数据已出炉&#xff01; 9月份&#xff0c;牛奶乳品市场销售呈大幅上涨。鲸参谋数据显示&#xff0c;今年9月&#xff0c;京东平台牛奶乳品市场的销量为2000万&#xff0c;环比增长约65%&#xff0c;同比增长约3%&#xff1b;销售额为…

S32DS踩坑日记四-增加I2C

添加采集温度的ADC之后&#xff0c;又增加了两个LPUART。之后又打算先尝试着把RTC调试出来&#xff0c;然后就遇到莫名奇妙的问题了。 RTC采用的MCP7940N芯片&#xff0c;是I2C接口的。 先配置的引脚&#xff1a; 然后增加I2C的驱动&#xff1a; 在代码中增加初始化和发送测…

进口跨境商城源码(海关179接口+跨境报关商城+多平台搭建+多终端支持)

随着互联网的普及和电子商务的快速发展&#xff0c;进口跨境电商商城逐渐成为消费者购买海外商品的主要渠道。为了满足消费者的需求&#xff0c;许多企业都开始开发自己的进口跨境电商商城源码&#xff0c;以提高商城的效率和稳定性。 其中&#xff0c;海关179接口是进口跨境电…

竖版视频怎么做二维码?扫码播放竖版视频的方法

当我们在将视频转二维码图片展示的时候&#xff0c;一般横版视频在手机展示不会有影响&#xff0c;但是竖版视频会默认用横版的方式播放就会导致无法清晰的看到画面的内容&#xff0c;那么如何将竖版视频生成二维码是很多小伙伴头疼的一个问题。那么下面教大家使用二维码生成器…

yolov5 v7.0转ncnn时问题解决

yolov5 v7.0转ncnn时遇到很多问题&#xff0c;ncnn版本20231027以下仅做记录&#xff1a; 1.通过官方代码&#xff0c;export.py 转onnx&#xff0c;指定–dynamic --simplify参数 2.编译并安装ncnn&#xff0c;通过onnx2ncnn将onnx转化为ncnn.bin和ncnn.param 3.加载ncnn模…

在规划项目进度时,必须关注的两个关键点

要想确保项目的成功&#xff0c;项目经理需要制定一个周密的计划&#xff0c;以便快速有效地应对可能出现的问题。这是最佳实践问题管理过程的核心&#xff0c;也是良好项目管理的本质要求。 在规划项目进度时&#xff0c;应该至少关注两个关键方面。 1、进度规划要做到粗细…

一个极好用的浏览器标签页插件

这是我登录后&#xff0c;并且上传了个人壁纸的页面 Br标签页 一 . 我们来看看界面和功能1.注册登录2.首页及右键功能3.添加小组件和app网址4.切换壁纸5. 计划页面 二 . Edge浏览器安装和chrome&#xff08;谷歌&#xff09;浏览器安装1. Edge浏览器安装2. chrome&#xff08;谷…

java--java的参数传递机制

1.java的参数传递机制都是&#xff1a;值传递 ①所谓值传递&#xff1a;值的是在传递实参给方法的形参的时候&#xff0c;传输的是实参变量中存储的值的副本。 ②实参&#xff1a;在方法内部定义的变量。 ③形参&#xff1a;定义方法时"(...)"中所声明的参数。 2.…

区块链-蚂蚁链(阿里系产品),至信链(腾讯系),长安链(国家队)

目录 区块链-蚂蚁链&#xff08;阿里系产品&#xff09;,至信链&#xff08;腾讯系&#xff09;,长安链&#xff08;国家队&#xff09; ①蚂蚁链&#xff08;阿里系产品&#xff09; ②至信链&#xff08;腾讯系&#xff09; ③长安链&#xff08;国家队&#xff09; Hyp…

基于世界杯算法的无人机航迹规划-附代码

基于世界杯算法的无人机航迹规划 文章目录 基于世界杯算法的无人机航迹规划1.世界杯搜索算法2.无人机飞行环境建模3.无人机航迹规划建模4.实验结果4.1地图创建4.2 航迹规划 5.参考文献6.Matlab代码 摘要&#xff1a;本文主要介绍利用世界杯算法来优化无人机航迹规划。 1.世界杯…

【C++ 系列文章 -- 程序员考试 201811 下午场 C++ 专题 】

1.1 C 题目六 阅读下列说明和C代码&#xff0c;填写程序中的空&#xff08;1&#xff09; &#xff5e;&#xff08;5&#xff09;&#xff0c;将解答写入答题纸的对应栏内。 【说明】 以下C代码实现一个简单乐器系统&#xff0c;音乐类&#xff08;Music&#xff09;可以使用…