queue ide is not exists in YARN

报错内容:

2023-08-17 17:30:31.342 [ERROR] [BaseTaskScheduler-Thread-7              ] o.a.l.o.s.a.AsyncExecTaskRunnerImpl (79) [run] - Failed to execute task astJob_1_codeExec_1 org.apache.linkis.orchestrator.ecm.exception.ECMPluginErrorException: errCode: 12003 ,desc: hadoop0004:9101_1 Failed  to async get EngineNode MatchError: LinkisException{errCode=11006, desc='Failed to request external resourceRMWarnException: errCode: 11006 ,desc: queue ide is not exists in YARN. ,ip: hadoop0004 ,port: 9101 ,serviceKind: linkis-cg-linkismanager', ip='hadoop0004', port=9101, serviceKind='linkis-cg-linkismanager'} (of class org.apache.linkis.manager.common.exception.RMErrorException) ,ip: hadoop0004 ,port: 9104 ,serviceKind: linkis-cg-entrance

这个问题比较好解决

linkis官方有说明 Linkis 部署排障 | Apache Linkis

异常信息:desc: queue ide is not exists in YARN. 表明配置的yarn队列不存在,需要进行调整

修改方式:linkis管理台/参数配置>全局设置>yarn队列名[wds.linkis.rm.yarnqueue],修改一个可以使用的yarn队列,可以使用的yarn 队列可以在 rmWebAddress:http://xx.xx.xx.xx:8088/cluster/scheduler 上查看到

我看到的队列是这样的

队列名应该是default, 不过我眼拙, 写上root, 仍然报错, 后又改成default, 还是报root, 可能有缓存?

然后报错内存不足,这个好理解, 应该是内存配置的问题

2023-08-17 17:53:01.660 [WARN ] [BaseTaskScheduler-Thread-30             ] o.a.l.o.e.ComputationEngineConnManager (50) [warn] - mark_5 Failed to askEngineAskRequest time taken (115), errCode: 12003 ,desc: hadoop0004:9101_19 Failed  to async get EngineNode LinkisRetryException: errCode: 30002 ,desc: not engough resource: : errCode: 12010 ,desc: Insufficient cluster queue memory ,ip: hadoop0004 ,port: 9101 ,serviceKind: linkis-cg-linkismanager ,ip: hadoop0004 ,port: 9101 ,serviceKind: linkis-cg-linkismanager ,ip: hadoop0004 ,port: 9104 ,serviceKind: linkis-cg-entrance

资源太小最小是1G

### 解决 `queue object is not iterable` 错误 在 Python 中,队列(Queue)是一种线程安全的数据结构,通常用于多线程编程中的数据共享。然而,`queue.Queue` 对象本身并不是可迭代的(iterable),因此如果尝试将其作为可迭代对象使用,则会引发 `'queue object is not iterable'` 的错误。 要解决此问题,可以通过以下方法获取队列的内容并使其成为可迭代的形式: #### 方法一:通过循环逐个取出元素 可以使用 `get()` 方法从队列中逐一提取元素[^5]。需要注意的是,在多线程环境中,应处理可能发生的异常情况(如队列为空时抛出的 `Empty` 异常)。以下是实现代码示例: ```python import queue q = queue.Queue() for i in range(5): q.put(i) while not q.empty(): try: item = q.get(block=False) # 非阻塞方式获取元素 print(item) except queue.Empty: break ``` #### 方法二:将队列转换为列表 另一种解决方案是先将队列中的所有元素转移到一个列表中,从而使得该集合变得可迭代。这种方法适用于单线程环境下的简单场景[^6]: ```python import queue q = queue.Queue() for i in range(5): q.put(i) list_items = [] while not q.empty(): list_items.append(q.get()) print(list_items) # 输出: [0, 1, 2, 3, 4] ``` #### 方法三:自定义生成器函数 为了更灵活地操作队列内容,还可以创建一个生成器函数来逐步返回队列中的项目。这种方式特别适合于需要延迟加载的应用场合[^7]: ```python def queue_to_iter(queue_obj): while True: try: yield queue_obj.get_nowait() # 使用 nowait 来避免阻塞 except queue.Empty: return q = queue.Queue() for i in range(5): q.put(i) for item in queue_to_iter(q): print(item) ``` 以上三种方法都可以有效规避 `'queue object is not iterable'` 的错误提示,具体选择取决于实际应用场景的需求以及运行环境的特点。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值