清除过滤器
文章
Michael Lei · 九月 13, 2022
医疗科技市场正处于强劲的演变之中。Gartner的医疗科技的波浪图展示了这些技术是什么,非常好地反映了医疗行业的数字化趋势。
其中很多技术都可以使用InterSystems的技术(ISC Health Tech)来实现:
知情同意管理使用InterSystems Healthshare Stack来做患者主索引和知情同意管理。
文章
Claire Zheng · 一月 4, 2023
这是InterSystems 2022年全球峰会上InterSystems 医疗行业负责人 Don Wooklock 的分享,他认为,在数字医疗发展如火如荼的当下,经济、消费主义和技术三股力量正在推动医疗行业快速变革。我们面临着压力,但更多的是机遇,利用好市场能量,在具备变革精神的医疗卫生行业中,全力以赴!
文章
Qiao Peng · 三月 29, 2021
InterSystems IRIS/Caché的CDC
InterSystems IRIS/Caché未提供开箱即用的变更数据捕获(CDC)工具,而且由于其多模型建模能力和底层的多维存储模型,相对于关系型数据库的单一模型,针对于SQL的CDC在InterSystems IRIS/Caché上会更复杂一些。例如通过Journal日志记录的是底层持久化多维数组的数据变更,而不是SQL table的变更。
通常,在应用层面实现变更数据捕获是更灵活和简单的方式,例如通过设置触发器、类的DSTIME参数。但如果无法在应用层做CDC,可以考虑使用InterSystems IRIS/Caché的Journal和强大的开发能力获取数据变更。
这里介绍使用InterSystems IRIS/Caché的Reporting类型的异步镜像成员获取数据变更。
Dejournal 过滤器
InterSystems IRIS/Caché的 Dejournal 过滤器用于在Reporting类型的异步镜像成员上过滤Journal记录。当配置了Dejournal 过滤器后,异步镜像成员在redo journal前会自动调用Dejournal过滤器类的方法RunFilter,并传入以下参数: 1. MirrorDBName:镜像数据库名称; 2. GlobalReference:Global节点(包括下标); 3. RecordType:操作类型,为S(Set)和K(Kill); 4. Address:Journal记录在Journal文件中的偏移量。
我们可以利用自定义的Dejournal过滤器,捕获持久化多维数组(Global)的数据变化,并输出给外部系统。
注意:1. 如果仅为实现CDC,并不需要配置镜像备机。2. Dejournal过滤器只能配置在Reporting类型的异步镜像成员上。3. 镜像配置不在本文内容里,请参考文档:[IRIS] https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GHA_mirror[Caché] https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GHA_mirror
编写Dejournal过滤器
InterSystems IRIS/Caché提供镜像Dejournal系统类 - SYS.MirrorDejournal。对于用户自定义过滤逻辑,通过继承于SYS.MirrorDejournal的子类来实现。
在Reporting异步镜像成员的%SYS命名空间(IRISLIB数据库)下创建SYS.MirrorDejournal的子类,命名应以Z或z开头,以避免升级时被覆盖,例如命名为ZCustom.MirrorDejournal。注意: IRISLIB数据库默认是只读的,需要先将其修改为可读写。
Override该类的RunFilter方法,将数据变更捕获的逻辑放在该方法里,并根据需要返回1或0。1代表这个global变更需要dejournal,0代表不需要。即便仅仅是为实现CDC,建议在Reporting异步镜像成员恢复所有数据,即让该方法返回1,从而不需要影响生产系统,直接从Reporting异步镜像成员上获取所有的变更数据。
例如,将global的数据变更记录在^CDCLog中:
Class ZCustom.MirrorDejournal Extends SYS.MirrorDejournal
{
Method RunFilter(
MirrorDBName As %String,
GlobalReference As %String,
RecordType As %String,
Address As %Integer) As %Integer
{
Set ^CDCLog( $$I ($^CDCLog))=$lb(MirrorDBName,GlobalReference,RecordType,Address)
Quit 1
}
}
配置Dejournal过滤器
在Reporting异步镜像成员上,配置其镜像Dejournal过滤器为上面创建的过滤器类的名称。
后记
今天有人问到,如何获取变更的值和变更前的值。可以使用`$$$JRNNEWVAL(Address) 、$$$JRNOLDVAL(Address)`在上面的RunFilter方法中获取变更后和变更前的数据。注意,`$$$JRNNEWVAL(Address) 、$$$JRNOLDVAL(Address)`这2个宏定义在%syJrnRecord.inc文件里,因此需要将这个include文件加入ZCustom.MirrorDejournal类定义:Include %syJrnRecord
又,在InterSystems IRIS上修改并编译dejournal过滤器类后,需要重启异步镜像成员的Mirror,以使更改生效。
CDC系列
更多的CDC选项实现,请参考:
1. CDC系列之一 :使用Dejournal Filter在InterSystems IRIS/Caché上通过Mirroring实现CDC功能
2. CDC系列之二 :使用Dejournaling filter routine在Caché上通过Shadow实现CDC
3. CDC系列之三 :建立InterSystems IRIS/Caché的Global数据变更与SQL表记录的对应关系
4. CDC系列之四:使用DSTIME特性在InterSystems IRIS/Caché上实现CDC功能
很好的文章 学习一下
公告
Claire Zheng · 七月 7
InterSystems 发布了新的点式更新,该更新解决的缺陷问题影响以下受支持的产品线的最新先前版本 2025.1.0、2024.1.4、2023.1.6 和 2022.1.7:
InterSystems IRIS
InterSystems IRIS for Health
HealthShare Health Connect
此问题可能导致在使用以下功能时出现意外的 <PROTECT> 错误或访问异常:
隐式命名空间
对数据库的混合只读/读写访问
用于列出例程和全局变量的管理门户页面
症状包括:
命名空间创建故障
在列出例程时,间歇性出现“访问被拒”错误
对于具有只读权限的用户,全局显示页面不返回数据
虽然这些问题并不影响访问控制或用户权限,但它们会在多种场景下影响预期的系统行为。
问题得到解决的版本
以下点式版本中修复了该问题:
2025.1.0.230.2
2024.1.4.516.1
2023.1.6.810.1
2022.1.7.116.1
建议使用受影响版本的客户应用相关更新,以确保系统正常运行。
如果您有任何问题或需要支持,请联系 InterSystems 全球响应中心 (WRC)。
文章
Claire Zheng · 九月 3
InterSystems提供统一数据战略,聚焦复杂行业中的速度、安全性与实时洞察能力。
文章要点
InterSystems是一家深耕数据管理、集成与分析领域48年的私营企业,2024年营收达11.3亿美元。
其旗舰产品InterSystems IRIS旨在为多样化需求(包括生成式AI与机器学习)提供全面数据平台支持。
针对医疗健康与供应链等复杂领域,推出InterSystems IRIS for Health与InterSystems Supply Chain Orchestrator等专业化解决方案。
InterSystems提供通过“贴近数据源处理(processing closer to data)”的架构设计,提升性能、强化安全性并降低运营成本。
核心价值主张包括:易用性、深度集成、行业定制化方案快速落地及强健的客户支持。
👉直播回放 | 以医疗AI枢纽构建智能协同生态:InterSystems IRIS AI 组件注册中心
分析师观点
近期,在InterSystems分析师关系峰会期间,通过与InterSystems的交流,我们发现该公司专注于其基础的“永恒设计”理念,并坚定不移地致力于提供强大的数据管理和医疗信息系统。InterSystems自1979年以来便是一家私有且持续盈利的公司,凭借系统出色的性能、可扩展性、互操作性及可靠性,已确立其在数据管理、集成与分析领域的全球领导地位。该公司的InterSystems IRIS看上去是其战略的核心支柱,旨在提供一个统一的数据平台。我们观察到,该平台旨在处理从传统数据库管理到生成式人工智能、机器学习和高级分析等更现代需求在内的广泛功能。这一广泛的能力集旨在使IRIS成为企业在复杂数据环境中导航的通用解决方案。
InterSystems方法中更引人注目的一个方面是,它强调“贴近数据源处理(processing closer to the data)”。这种架构设计旨在带来诸多益处,如更快的处理速度、增强的安全性以及潜在的成本降低。在数据量激增且实时洞察至关重要的时代,这样的架构可能成为一个显著的区别因素。这表明其设计深思熟虑,旨在缓解与数据移动和分布式处理相关的一些常见瓶颈。该公司的优势在于为关键任务型应用提供服务,在这些应用中,性能和可靠性至关重要。当现有系统无法再满足业务需求时,InterSystems似乎常常成为解决方案,显著提高处理速度。
该公司还非常注重针对特定行业的解决方案,尤其是在医疗领域。其HealthShare、TrakCare和InterSystems IntelliCare产品体现了对医疗机构和组织所面临的独特挑战的深刻理解。这种专业化是一个明智之举——医疗是一个数据密集且高度依赖合规性的行业,现成的通用解决方案往往难以满足需求。通过提供定制化的电子健康记录和信息交换平台,InterSystems旨在解决这一重要领域的关键痛点。同样,其在金融服务和供应链领域的表现证明该公司有更广泛的战略,即将其拥有的数据管理专业知识应用于其他复杂行业。
我们发现,该公司致力于使数据实现“AI Ready(AI就绪)”,这一点尤其值得关注。随着人工智能在各种业务功能中的日益普及,可靠地访问和利用实时数据的能力至关重要。InterSystems专注于确保数据为人工智能和机器学习计划做好准备,这凸显了他们对当前市场需求的深刻理解。他们强调易于学习和使用,并承诺通过针对特定行业的解决方案包,快速实现价值,这也很好地契合了当今快节奏环境中对敏捷部署的需求。此外,InterSystems提供行业领先的支持,这表明了他们对客户成功的长期承诺,而这正是企业客户关注的关键因素。我们认为,如果您的组织面对着复杂数据和集成挑战,同时寻求利用数据做出更好决策的,那么InterSystems可以成为您可靠的合作伙伴。
👉直播回放 | 以医疗AI枢纽构建智能协同生态:InterSystems IRIS AI 组件注册中心
关注Smart Data Fabric(智能数据编织)
InterSystems智能数据编织是一种先进的企业架构,它通过按需访问、转换和协调来自多个来源的信息,简化和加速了对数据资产的访问。智能数据编织既可以作为独立产品存在,也是InterSystems面向行业的应用程序的基础支撑。该方法嵌入了广泛的分析功能,包括生成式人工智能、数据探索、商业智能、自然语言处理和机器学习,可在不干扰现有系统的情况下增强数据的可用性。该架构为企业提供一致、实时的数据视图,助力企业做出更优决策、提升客户体验并提高运营效率。在数据管理方面,它通过统一不同的数据源来解决数据孤岛问题,对于复杂环境中的访问和集成现代化至关重要。
智能数据编织与人工智能技术的集成,允许直接嵌入预测性、决策优化型和生成式人工智能工具,从而推动智能应用的发展,如支持人工智能的顾问和情景规划。在新兴的人工智能技术栈中,InterSystems智能数据编织作为基础层,为人工智能模型提供统一、高质量的数据,加速决策智能化,并支持人工智能驱动的工作流程中的实时分析。其真实世界应用案例包括金融服务领域的风险管理和合规性,以及供应链编排中的规范性洞察和敏捷运营。
智能数据编织的广度和深度给我们留下了深刻印象,在分析师峰会上重点介绍的两个案例研究——一家全球零售商和一家创新型医疗保健提供商概述了他们对智能数据编织的采用情况,展现了一种全面的方法。InterSystems无疑具备在该领域大规模运营的资质和业绩记录。然而,问题依然存在:他们会被邀请加入这场AI盛宴吗?该公司当然拥有在重新架构的人工智能数据栈中成为可行参与者的技术解决方案,但当高级IT主管们寻求建立值得信赖的供应商名单以支持他们的人工智能之旅时,其品牌认可度是否意味着它难以跻身“热门之选”呢?
👉直播回放 | 以医疗AI枢纽构建智能协同生态:InterSystems IRIS AI 组件注册中心
展望未来
基于我们的观察以及本周讨论所引发的思考,InterSystems正将自己定位为一家全面的数据解决方案提供商,尤其侧重于专业化的行业应用,特别是医疗领域。我们将重点追踪的一个关键趋势是,其“贴近数据源处理(processing closer to the data)”的架构在现实场景中,究竟能多有效地为客户带来切实、可衡量的益处。尽管理论上的优势显而易见,但在大型、多样化的企业环境中,该架构的实际实施情况及其产生的影响才是关键所在。
简而言之,在此次活动中,InterSystems近50年来对创新的执着追求以及其庞大的业务规模令我们印象深刻。
当我们纵观整个市场时,InterSystems的定位并非是一场重大变革,而是对其既定战略的强化:将数据管理领域的深厚专业知识应用于特定的高价值行业。
与Databricks或Snowflake等更广泛的数据平台提供商相比,InterSystems似乎采取了更为垂直整合和专业化的发展路径,尤其是在医疗领域。Databricks和Snowflake提供的是更为通用的数据湖仓和云数据仓库解决方案,而InterSystems则致力于提供更全面、针对特定行业的解决方案包,特别是其面向医疗领域的TrakCare和HealthShare等产品。InterSystems的数据集成能力也十分突出,尤其是在那些拥有多种类型数据存储且无法迁移至单一技术的组织中。我们认为,其专业化和集成能力使其能够满足更为精细的行业需求,而这些需求可能是更通用的平台所忽视的。
对于InterSystems而言,一个关键问题是,鉴于超大规模企业和云原生数据平台拥有庞大的营销和研发预算,它打算在哪些领域与这些对手直接竞争,以及如何与它们开展良好合作。我们认为,对于那些在核心业务中要求极高可靠性、实时性能和复杂互操作性的组织来说,InterSystems具备得天独厚的优势。在人工智能应用日益广泛的背景下,InterSystems面临的挑战尤其在于:不仅要清晰阐述这些区别于技术规格的独特之处,还要展示出切实的业务成果。InterSystems必须在要求严苛的行业中,展示出人工智能驱动的解决方案,在提高效率、降低成本和推动新产品创新方面带来可衡量改进的具体案例。
HyperFRAME研究团队上周在波士顿参加了多个聚焦于ETL和数据集成的分析师活动,各方传递出的一个一致信息是,人工智能计划对实时集成数据的需求日益增长。InterSystems的战略与这一更广泛的市场趋势高度契合,特别是其强调“AI Ready(AI就绪)”的数据,以及通过“贴近数据源处理(processing closer to the data)”来减轻ETL负担。未来,HyperFRAME将追踪InterSystems如何在日益拥挤的数据平台市场中持续展现自身特色,尤其是其“AI Ready(AI就绪)”如何得以广泛应用及其为客户在未来几个季度带来的可衡量的业务成果。
👉直播回放 | 以医疗AI枢纽构建智能协同生态:InterSystems IRIS AI 组件注册中心
文章来源及作者信息
👉本文翻译自:HyperFRAME Research
👉点击查看原文
👉作者信息
@Stephanie Walter | 人工智能技术栈常驻分析师
Stephanie Walter是一位成果导向型的技术高管兼常驻分析师,在云计算、软件即服务(SaaS)、中间件、数据和人工智能领域拥有超过20年的创新领导经验。她曾在IBM担任高级职务,也以兼职高管的身份参与工作,凭借工程专业知识与商业战略及市场洞察力的结合,指导产品从概念构思到推向市场的整个生命周期。从软件工程与架构设计,到执行产品管理,她在初创企业、成长阶段企业和大型企业环境中,推动大规模转型、培养技术人才并解决复杂挑战。
@Steven Dickens | HyperFRAME Research首席执行官
Steven Dickens被誉为技术与商业转型领域的杰出领军人物,他是HyperFRAME Research的首席执行官兼首席分析师,多次被AR Insights评为全球十大分析师之一,还是《福布斯》的撰稿人。其专业见解备受顶级媒体青睐,《华尔街日报》和CNBC等一线媒体纷纷向他寻求观点,他也是施瓦布网络(Schwab Network)和彭博社(Bloomberg)等电视网络的常客。
文章
Claire Zheng · 二月 13, 2023
InterSystems IRIS数据平台深度支持Python,令您随心所愿!
文章
姚 鑫 · 九月 17, 2022
# 第三十五章 在 Windows 上使用 IRIS(二)
# IRIS 启动器
`Microsoft Windows` 平台上的主要`IRIS` 界面是 `IRIS` 启动器。从 `IRIS` 启动器,可以启动所有 `IRIS` 配置和管理工具。还可以从快捷方式或命令行调用每个启动器命令。
相应地,可以从 `Windows` 程序菜单中启动许多 `IRIS` 工具,方法是指向 `IRIS` 文件夹,然后指向启动 `IRIS` 以获得适当的 `IRIS` 实例名称。
当在基于 `Windows` 的系统上启动 `IRIS` 时, `IRIS` 启动器图标会出现在任务栏的系统托盘中。
当单击 `IRIS` 启动器时,会出现一个菜单,其中包含使用 `ObjectScript` 实用程序和编程环境的命令。
下表描述了 IRIS 启动器菜单中可用的命令。
IRIS 启动器命令| 描述
---|---
`Getting Started`|显示教程、发行说明、文档和其他相关信息的链接
`Start IRIS`|启动菜单项后方括号中指定的默认实例,例如 `[ii2081]`。如果 `IRIS` 服务器已经启动,这个选项会变暗——它不可用。
`Stop InterSystems`|关闭或重新启动本地 `IRIS` 实例。如果 `IRIS` 服务器已停止,此选项将显示为灰色——它不可用。
`Studio`|创建、编辑、删除和编译 `IRIS` 类定义和例程。
`Terminal`|调用 `IRIS` 的命令行解释器。
`Management Portal`|执行常见的系统管理任务。创建数据库和命名空间,并调整所有 `IRIS` 配置设置。显示类、全局变量和例程,以及用于管理它们的函数。显示表和视图,执行查询和 `SQL` 管理功能。
`Documentation`|显示 `IRIS` 在线文档。
`Preferred Server [server name]`|显示远程服务器列表并使用子菜单上的“添加/编辑”命令维护服务器连接。首选服务器出现在括号中,并且在服务器列表中旁边有一个复选标记。
`About`|显示 `IRIS` 版本和构建信息。
`Exit`|从系统托盘中删除`IRIS` 启动器图标;这不会停止 `IRIS`。当实例重新启动时,启动器会重新出现。
# 启动 IRIS
要启动 `IRIS`,请在系统级别运行启动程序。此过程使用默认配置文件或指定的配置文件运行。
**注意:如果在启动 `IRIS` 时遇到任何问题,请按照“监控指南”的“监控日志文件”部分中的说明查看 `messages.log` 文件。**
要在 `Windows` 平台上启动 `IRIS`,请从 `IRIS` 启动器中选择启动 `IRIS`。这将使用指定的配置文件启动 `IRIS` 实例。当 `IRIS` 未运行时, `IRIS` 启动器图标显示为灰色。
如果 `IRIS` 启动器不在系统托盘中,请从 `Windows` 程序菜单中选择 `IRIS` 文件夹并为该实例启动 `IRIS`。要将启动器返回到系统托盘,请转到 `install-dir/bin` 目录并双击 `iristray.exe` 文件。
或者,可以从“开始”菜单上“运行”命令的“打开”框中的 `install-dir/bin` 目录输入这些命令。例如,要从 `MyIris\bin` 目录启动名为 `MyIris` 的实例,请输入以下命令:
```
c:\MyIris\bin\iris start iris
```
# 停止 `IRIS`
通常让 `IRIS` 系统保持运行。但是,如果操作系统需要重新启动,请在关闭系统之前停止 `IRIS`。诸如备份和数据库修复实用程序等维护任务不需要停止 `IRIS`。
从 `IRIS` 启动器菜单中单击停止 以关闭或重新启动本地 `IRIS` 实例。默认情况下,此选项使用默认关闭例程立即关闭(或重新启动) `IRIS`。但是,它还提供了设置延迟关闭的计时器、运行用户定义的关闭例程、向服务器上的用户广播警告消息以及关闭而不进行故障转移的选项。可以从 `Windows` 程序菜单运行相同的过程。为该实例名称选择 `IRIS` 文件夹并停止 `IRIS`。一旦倒计时达到 `0` 并且关机程序已开始,将无法取消关机。

**重要提示:`InterSystems` 建议运行 `Stop IRIS` 来关闭 `IRIS` 以确保其正确关闭。**
## 删除 `Stop InterSystems` 命令
为防止意外执行 `Stop InterSystems` 命令,可以通过从相应 `IRIS` 实例的 `install-dir/bin` 目录中删除 `irisstop.exe` 文件来从 `IRIS` 启动器中删除该命令。还可以从“开始”菜单中的相应 `IRIS` 实例中删除停止 `InterSystems` 快捷方式。指向 `Programs` 和 IRIS 实例名称,然后右键单击 `Stop` 并单击 `Delete`。
# 从命令提示符控制 `IRIS`
可以通过运行 `install-dir\bin` 目录中的 `iris.exe` 程序从 `Windows` 命令提示符控制 `IRIS` 实例。
要显示此命令的最新帮助信息,请从 `IRIS install-dir\bin` 目录调用 `iris` 帮助。例如:
```java
C:\InterSystems\IRISHealth\bin>iris help
usage:
iris start []
to start instance , optionally using the specified .cpf file.
An optional /EmergencyId=Username,Password can be used to start
InterSystems IRIS in emergency mode. When the EmergencyId argument
is supplied, the system starts up in emergency mode in which only the
baseline databases are mounted and access to InterSystems IRIS is
governed by InterSystems IRIS login using that username and password.
Emergency mode is supplied to give access in the event that privileged
users are not available or their password is forgotten. Emergency
startup is only available from an administrator account.
When InterSystems IRIS is started in emergency mode, the IRIS control
service is not used. This means that if you log out of Windows, all
the InterSystems IRIS processes will immediately exit.
or: iris startnostu
to start instance without running ^STU.
or: iris stop
to shut down instance .
or: iris stopnoshut
to shut down instance without running user shutdown routines.
or: iris stopstart
to shut down and restart instance .
Note: An optional /nofailover argument can be specified for stop,
stopnoshut, or stopstart to not trigger a mirror failover.
or: iris force
to force down instance .
or: iris [ run OR console OR terminal ]
to run InterSystems IRIS in programmer mode with
[ no-device OR console OR terminal ] for $Principal.
or: iris [ run OR console OR terminal ]
to run InterSystems IRIS routine in application mode with
[ no-device OR console OR terminal ] for $Principal.
or: iris [ run OR console OR terminal ]
to run InterSystems IRIS routine in in application
mode with [ no-device OR console OR terminal ] for $Principal.
or: iris runw []
to run InterSystems IRIS routine in application mode with
no input/output device for $Principal using the optional namespace.
When run from a batch script, iris will wait for the InterSystems IRIS
process to terminate before returning. The exit code from the InterSystems
IRIS process will be returned by iris.
Note: An optional /Title="Title string" can specify the console
or terminal title bar text.
or: iris iristraystart
to start IRISTray for instance .
or: iris iristraystop
to stop IRISTray for instance .
or: iris licmanagerstop
to stop licmanager running in instance .
or: iris all [> outputfile]
to list all installed instances.
or: iris allw [> outputfile]
to list (wide format) all installed instances.
or: iris list [] [> outputfile]
to list information about all installed instances or the
specified instance.
or: iris qlist [] [> outputfile]
to display a quick list of information about all installed
instances or the specified instance, in a format suitable
for parsing in command scripts.
The record for an instance contains fields separated by "^" (carats):
Field 1: instance name
Field 2: instance directory
Field 3: version identifier
Field 4: current status for the instance
Field 5: configuration file name last used
Field 6: SuperServer port number
Field 7: WebServer port number
Field 8: JDBC Gateway port number
Field 9: Instance status (e.g., ok, warn, alert)
Field 10: Product name of the instance
Field 11: Mirror Member Type (e.g., Failover, Disaster Recovery)
Field 12: Mirror Status (e.g., Primary, Backup, Connected)
or: iris serverlist [> outputfile]
to list information about all defined servers.
Note: When [> outputfile] is present, output is redirected
to the file instead of being displayed on the terminal.
or: iris telnetstop
to stop the InterSystems IRIS TELNET daemon.
or: iris telnettrace
to toggle the TELNET trace state.
or: iris iristrmdstop
to stop the InterSystems IRIS terminal daemon.
Note: iris often displays error information in a message box.
You can suppress the message box containing error information
by adding "quietly" (without the quotation marks) as the
final argument to the iris command.
or: iris help [display]
to show this help. If display is specified the help
is displayed in a browser window.
```
`iris help` 命令将在终端中显示最新的帮助信息。还可以通过将 >outputfilename 添加到 `iris` 帮助命令,将帮助信息保存到 `intsall-dir\bin` 目录中的文件中。例如:
```
C:\MyIris\bin>iris help>helpinformation
```
# 在命令行上连接到 `IRIS`
可以使用 `iris` 终端命令在命令行上登录 `IRIS` 实例。
文章
姚 鑫 · 八月 29, 2022
# 第十六章 维护本地数据库(一)
可以在管理`Portal` (`System Operations` > `databases`)的“数据库”页面查看和维护本地数据库。
在此页面,可以查看到以下信息:
- 数据库一般信息` Databases General Information`-所有数据库的概述信息。
- 数据库空闲空间信息 `Databases Free Space Information` - 所有数据库的空闲空间信息
- 数据库详细信息页 `Database Details Page` -个别数据库的特定信息。
还可以通过维护操作增加该页面的可用空间。
本节中描述的大多数信息和操作也可以使用`^DATABASE`命令行实用程序找到并执行。
# 数据库的一般信息
数据库页面(系统操作 > 数据库)包含所有本地数据库的列表。对于每个本地数据库,会看到以下信息:
#### 本地数据库信息
- `Name` - 数据库名称。
- `Directory` - 分配给数据库可以增长的最大大小,以 `GB` 为单位。
- `Max Size (GB)` - 分配给数据库可以增长的最大大小,以 `GB` 为单位。
- `Size (MB)` - 当前分配的数据库大小,以兆字节为单位。
注意:此字段衡量数据库的逻辑大小。因此,此处报告的大小可能低于数据库的物理大小,特别是对于 `IRISTEM` 数据库。
- `Status` - 数据库的状态:`mounted` (包括它有哪些权限)、`unmounted`或`dismounted`。
- 已安装的数据库是选择了启动时需要安装的数据库,因此必须安装该数据库才能使 `IRIS` 启动或成为镜像中的主数据库;在这种情况下,它总是在 `IRIS` 启动时被安装和访问。或者,它是一个先前未挂载的数据库,在访问它或显式挂载时已动态挂载;在这种情况下,它会一直挂载,直到明确卸载它或重新启动/停止 `IRIS`。
- 未挂载的数据库是未选择启动时需要挂载的数据库,因此不需要挂载 `IRIS` 即可启动或成为镜像主数据库,并且既未访问也未显式挂载;当访问它或显式安装它时,它会动态安装,并保持安装状态,直到显式卸载它或重新启动/停止 `IRIS`。
- 已卸载的数据库是已显式卸载的数据库;在显式安装它或重新启动/停止 `IRIS` 之前,它是不可访问的(也就是说,如果尝试访问已卸载的数据库,则不会动态安装它)。要永久卸载数据库,您必须将其从配置中删除。
- `Encrypted` - 指示数据库是否已加密。
- `Journal` - 指示数据库中的全局变量是用 `Y` 还是 `N` 记录的。
此外,该页面包含一个过滤栏,可以使用它来控制显示的数据库数量。例如,要仅列出系统数据库,可以在 `Filter:` 文本框中输入 `IRIS*`;和/或要每页仅列出五个数据库,请在页面大小:文本框中输入 `5`;和/或将显示的行数限制为 `3`,在 `Max rows`: 文本框中输入 `3`(在 `Results` 字段中显示带有数字的 `+` 号表示存在满足指定条件的其他数据库,但它们不会显示)。
# 数据库可用空间信息
管理数据库中的可用空间(空块)是数据库维护的一个重要方面。要查看可用空间信息,可以显示管理门户的可用空间视图或使用 `^%FREECNT` 实用程序。请记住,正常操作中数据库的大小和可用空间属性会不断变化,门户网站或实用程序在给定时间点报告的数字只是近似值。
## 使用管理门户显示可用空间信息
要显示可用空间信息,其中显示有关每个本地数据库上可用空间量的信息,请导航到数据库页面(系统操作 > 数据库)并单击可用空间视图单选按钮。下表描述了显示的信息:
#### 本地数据库可用空间信息
- `Name` - 数据库名称。
- `Directory` - 数据库的主卷所在的系统目录。
- `Max Size` - 数据库可以增长到的最大分配大小,以 `GB` 为单位。创建数据库时默认为无限制。
- `Size` - 当前分配的数据库大小,以兆字节为单位。
注意:此字段衡量数据库的逻辑大小。因此,此处报告的大小可能低于数据库的物理大小,特别是对于 `IRISTEM` 数据库。
- `Expansion Size` - 扩展数据库的大小(以 `MB` 为单位)。创建数据库时,默认和推荐设置为零 (`0`),这表示使用系统默认值(当前大小的 `12%` 或 `10 MB`,以较大者为准)。在此设置下,扩展大小不会大于 1GB。
- `Available` - 数据库中可用的可用空间量(以 `MB` 为单位)。
- `%Free` - 数据库中可用空间的百分比。
- `Disk Free Space` - 卷上的可用空间量。
- `Status` - 目录的状态,指示数据库是否已挂载以及具有哪些权限。
# 使用 ^%FREECNT 显示可用空间信息
`IRIS` 还提供了 `^%FREECNT` 实用程序,可以通过在终端中输入 `do` `^%FREECNT` 来运行该实用程序,以显示数据库中的可用空间。
在 `%SYS` 命名空间中使用 `^%FREECNT` 时,可以选择通过在提示符处输入星号 (`*`) 来显示所有数据库的可用空间,或者输入一个数据库目录名称。例如:
```java
%SYS>do ^%FREECNT
Database directory to show free space for (*=All)? *
Databases Selected
------------------
c:\intersystems\irishealth\mgr\
c:\intersystems\irishealth\mgr\enslib\
c:\intersystems\irishealth\mgr\hscustom\
c:\intersystems\irishealth\mgr\hslib\
c:\intersystems\irishealth\mgr\hssys\
c:\intersystems\irishealth\mgr\irisaudit\
c:\intersystems\irishealth\mgr\irislib\
c:\intersystems\irishealth\mgr\irislocaldata\
c:\intersystems\irishealth\mgr\iristemp\
c:\intersystems\irishealth\mgr\user\
Device:
Right margin: 80 =>
Database Free Space
Aug 20 2022 12:30 PM
Database Max Size Size Available %Free Disk Free
c:\intersystems\irishealth\mgr\ 无限制 113MB 19MB 16.81 31.67GB
c:\intersystems\irishealth\mgr\enslib\
无限制 208MB 16MB 7.69 31.67GB
c:\intersystems\irishealth\mgr\hscustom\
无限制 21MB 8.7MB 41.42 31.67GB
c:\intersystems\irishealth\mgr\hslib\
无限制 1.19GB 132MB 10.82 31.67GB
c:\intersystems\irishealth\mgr\hssys\
无限制 21MB 8.9MB 42.38 31.67GB
c:\intersystems\irishealth\mgr\irisaudit\
无限制 11MB 10.0MB 90.9 31.67GB
c:\intersystems\irishealth\mgr\irislib\
无限制 356MB 0.51MB .14 zn "user"
USER>do ^%FREECNT
Databases Selected
------------------
c:\intersystems\cache\mgr\user\
Device:
Right margin: 80 =>
Cache Database Free Space
Aug 20 2022 12:32 PM
Database Max Size Size Available %Free Disk Free
c:\intersystems\cache\mgr\user\ 无限制 11MB 9.4MB 85.45 31.67G B
```
**注意:`
文章
姚 鑫 · 四月 4, 2021
# 第十六章 导入SQL Code
本章介绍如何将SQL代码从文本文件导入Intersystems SQL。导入SQL代码时,IntersystemsIris®数据平台使用动态SQL准备并执行每行SQL。如果遇到无法解析的代码行,则SQL导入跳过该行代码并继续准备和执行后续行,直到它到达文件的末尾。所有SQL代码导入操作导入到当前名称空间。
SQL导入主要用于导入数据定义语言(DDL)命令(例如`Create Table`),并使用`Insert`,`Update`和`Delete`命令填充表。 SQL导入确实准备并执行`SELECT`查询,但不创建结果集。
SQL导入可用于导入Intersystems SQL代码。它也可以用于代码迁移,从其他供应商导入SQL代码(`FDBMS`,`Informix`,`Interbase`,`MSSQLServer`,`MySQL`,`Oracle`,`Sybase`)。来自其他供应商的代码被转换为Intersystems SQL代码并执行。 SQL导入无法将所有SQL命令导入Intersystems SQL。它导入与SQL标准的Intersystems Iris实现兼容的那些命令和条款。不兼容的功能通常被解析,但忽略了。
SQL导入可以成功准备一个SQL查询 - 在适当的情况下创建相应的缓存查询 - 但它不会执行查询。
通过从`%system.sql.schema`类中调用相应的方法,执行SQL代码导入。导入SQL代码时,这些方法可以创建其他两个文件:`errors.log`文件,它记录解析SQL命令中的错误,以及一个不支持的。其中包含该方法无法识别为SQL命令的文字文本。
# 导入Intersystems SQL.
可以使用以下`%System.sql.schema`方法从文本文件中导入Intersystems SQL代码:
- `ImportDDL()`是一个通用的SQL导入方法。此方法运行作为背景(非交互式)进程。要导入Intersystems SQL,请将“IRIS”指定为第一个参数。
- `run()`是一个Intersystems SQL导入方法。该方法从终端交互方式运行。它会提示指定导入文本文件的位置,创建`Errors.log`文件和U`nsupported.log`文件以及其他信息。
注意:此导入和执行SQL DDL代码不应与管理门户SQL接口的Import语句操作混淆。该操作以XML格式导入SQL语句。
以下示例导入Intersystems Iris SQL代码文件`Pathname MySQLCode.txt`,在当前命名空间中执行该文件中列出的SQL命令:
```java
DO $SYSTEM.SQL.Schema.ImportDDL("IRIS",$USERNAME,"c:\temp\mysqlcode.txt",,1)
```
默认情况下,`ImportDDL()`创建错误日志文件。此示例在与SQL代码文件中创建名为`mysqlcode_errors.log`的文件。第五个参数是一个布尔值,指定是否创建列出不受支持的SQL命令的文件。默认值为0.在此示例中,第五个参数设置为1,在与SQL代码文件相同的目录中创建名为`mysqlcode_unsupported.log`的文件。即使没有写入它们时,也会创建这些日志文件。
从终端执行`ImportDDL()`时,它首先列出输入文件,错误日志文件和不受支持的日志文件。然后,对于每个SQL命令,它显示一个列表,例如以下内容:
```sql
SQL statement to process (number 1):
CREATE TABLE Sample.MyStudents (StudentName VARCHAR(32),
StudentDOB DATE)
Preparing SQL statement...
Executing SQL statement...
DONE
```
如果在任何SQL命令中发生错误,则终端显示错误,如以下示例所示:
```sql
SQL statement to process (number 3):
INSERT INTO Sample.MyStudents (StudentName,StudentDOB) SELECT Name,
DOB FROM Sample.Person WHERE Age
文章
Claire Zheng · 六月 8, 2023
医院管理者、信息中心、业务骨干,每个角色都有独特的业务诉求,InterSystems IRIS医疗版互联互通套件专为国内用户设计,可助力医院用户释放数据价值,推动应用创新!截至目前,InterSystems技术已助力150余家医院通过四级及以上医院信息互联互通标准化成熟度评测,其中,五级乙等用户近30家。
文章
Michael Lei · 一月 17, 2023
每秒插入大量记录,同时同步进行实时查询的能力称为**混合事务分析处理 (HTAP)**。 它也被称为 Transactional analytics 或 Transanalytics 或 Translytics,当存在来自工业物联网传感器的持续实时数据流或股票市场的波动数据时,它是非常有用的技术,并且允许实时或接近实时地查询这些数据集。
在本文中我将分享我在不同平台上运行带有测试流数据的演示,同时进行持续插入和持续查询,看看每个平台上有何不同反应,如在每个平台上输入和输出数据的速度以及它们的性能。 我在本演示中试验的平台包括:InterSystems IRIS、MariaDB 和 MySQL。
试验结果
20秒的测试时间里:
| | 插入数据条数 | 查询次数 | 插入数据大小 | 查询数据大小 |
| --- | ------ | ---- | ------ | ------ |
| IRIS | 708,000 | 59,000 | 184M | 15.217M |
| MariaDB | 98,000 | 23,679 | 25M | 6.69M |
| MySQL | 38,000 | 11,947 | 9.869M | 2.45M |
本演示的视频:
需要环境
Docker 和 Docker Compose
本地运行
我们在三个不同的平台(MySQL、MariaDB 和 InterSystems IRIS 社区版)上运行记录的摄取和查询速度测试。
为此,需要按如下所示为每个平台下载容器的 YAML 文件:
1. 使用 MySQL 运行速度测试
1. 下载 YAML 文件:
2. 在上述 YAML 文件所在的文件夹中打开命令提示符并运行命令,为 MySQL 构建 docker 镜像:**docker-compose -f ./docker-compose-mysql.yml up**
3. 在浏览器选项卡中输入 以查看演示 UI。
2. 使用 MariaDB 运行速度测试
1. 下载 YAML 文件:
2. 在上述 YAML 文件所在的文件夹中打开命令提示符并运行命令,为 MariaDB 构建 docker 镜像:**docker-compose -f ./docker-compose-mariadb.yml up**
3. 在浏览器选项卡中输入 以查看演示 UI。
3. 使用 InterSystems IRIS 运行速度测试
1. 下载 YAML 文件:
2. 在上述 YAML 文件所在的文件夹中打开命令提示符并运行命令,为 InterSystems IRIS 构建 docker 镜像:**docker-compose up**
3. 在浏览器选项卡中输入 以查看演示 UI。
从 localhost 运行测试后,可以看到以每秒钟摄取和查询的记录数形式显示的结果。
与 MySQL 和 MariaDB 相比,InterSystems IRIS 的数值更令人印象深刻。
异常
在尝试为每个平台运行 docker 容器时,可能会出现以下错误:
“Missing Linux capabilities”(缺少 Linux 功能)

可以在 YAML 文件的 htapirisdb 部分添加以下行,以跳过 Linux 功能检查:
**command: --check-caps false**
_(@Robert.Kuszewski, 2022)_
__如下所示:
每个平台上的实时测试运行:
每个平台的速度测试结果
InterSystems IRIS:

MariaDB:

MySQL:
 参考文献
1. [intersystems.com](http://intersystems.com). (Amir, S.). _InterSystems Open Exchange_. [在线] 网址: [访问日期:2022 年 9 月 20 日]。
2. Kuszewski, B. (2022). _[在 Docker 20.10.14+使用 InterSystems IRIS 容器_.](https://cn.community.intersystems.com/post/在-docker-201014-使用-intersystems-iris-容器) [在线] InterSystems 开发者社区。 英文原文: [访问日期:2022 年 10 月 20 日]。
公告
Claire Zheng · 八月 2, 2022
开发者们,大家好!
在此向您介绍开发者社区的一个新特性—— InterSystems开发者关键问题(Key Questions).
我们增加了一个新的 #Key Question 标签(#关键问题),用以显著标识与InterSystems数据平台有关的、影响重大的提问/问题。
每个月,InterSystems专家会选择一些这类问题,提出这些问题的社区成员将被授予荣誉奖励!
有哪些荣誉呢?详情如下!
什么是 #Key Question(#关键问题) ?
这个标签突出了关于如何使用InterSystems数据平台开发、测试、部署、管理等解决方案的问题,这些问题或富有洞察、或有趣、或最令人困惑等等。
谁来决定?
InterSystems 专家(Expert)会审阅开发者社区的问题,并决定将哪些问题归为 #Key Questions(#关键问题)。
哪些问题会被审阅?
开发者社区的所有问题都会被纳入审阅范围。
你多久可以在开发者社区上看到新的 #Key Questions(#关键问题)?
我们的专家每个月都会选取一些问题并赋予 #Key Question(#关键问题)标签。
你会获得什么荣誉?
在Global Masters,你会获得新增荣誉徽章 "Key Question"。
开发者社区亮点:我们会在被选为 #Key Question(#关键问题)的问题下面,以@DC.Administration 账号添加评论。
提问赢取奖励积分, 开发者社区探索之夏,或许你的问题就是我们专家选取的下一个 #Key Question(#关键问题)!
关注标签 ,时刻了解详情!
公告
Claire Zheng · 九月 23, 2022
亲爱的社区同学们!
2022年9月5日-10月24日,我们正在举办InterSystems开发者社区中文版首届技术征文大赛!
🏆InterSystems开发者社区中文版首届技术征文大赛🏆(←点击链接进入参赛页面,浏览所有参赛文章)!
2022年9月27日(下周二)11:00-11:30,我们将进行一次针对此次征文大赛的线上宣讲,欢迎您通过腾讯会议参加,了解关于此次征文大赛的信息,针对感兴趣的问题提问。
#腾讯会议信息
会议主题:InterSystems 社区技术征文大赛宣讲&解读会议时间:2022/09/27 11:00-11:30 (GMT+08:00) 中国标准时间 - 北京
点击链接入会,或添加至会议列表:https://meeting.tencent.com/dm/4UEzyh467wae
#腾讯会议:493-643-076
文章
Jingwei Wang · 八月 25, 2021
Object Script(一)
概况
ObjectScript是一种用于在InterSystems IRIS数据平台上快速开发编程语言,它是面向对象的弱类型脚本语言,非常适用于各种应用,包括业务逻辑、应用集成和数据处理。
在这里,我将主要介绍ObjectScript的命令脚本,类,方法和Routine等使用方式和语法规范。如有任何疑问,可在InterSystems开发者社区进行深入讨论。
IDE选择
可以使用InterSystems IRIS内置的Studio或Visual Studio Code(需要安装Object Script扩展)来查看和编辑代码。这里我们使用InterSystems IRIS内置Studio来做示例。
如果你已安装InterSystems IRIS或者InterSystems HS 等任何InterSystems产品,找到右下角的图标 ,单击鼠标右键,点击Studio,如下图所示:
输入用户名和密码(用户名:superuser 密码:安装时自己设置的密码),即可进入到Studio开发环境,如下图所示:
Terminal
可以直接打开InterSystems IRIS的终端尝试执行ObjectScript的简单指令。通过右下角的图标 ,单击鼠标右键,点击Terminal,如下图所示:
命名空间
启动一个终端会话后,输入用户名和密码(用户名可以使用superuser,密码是安装时自己设置的密码),之后就会显示你在哪个命名空间下,如下图所示,我的就在USRE这个命名空间下。
命名空间切换
do ^%CD
set $namespace = "Namespace"
Terminal指令语法
在终端中,可以输入各种ObjectScript命令语句。但是不支持多行模式,所以整个命令必须在单行输入。
常用执行指令
指令
缩写
操作
语法/示例
write
w
打印变量
write "Hello World!"
write !
W !
新行打印变量
write !, "This", !, "Is", !, "A", !, "Multi-line", !, "Message!", !
write ?
w ?
列定位打印变量
write !, "This", ?9, "Is", ?18, "A", ?27, "Columnar", ?36, "Message!", !
write #
w #
清除屏幕
write #
zwrite
zw
打印变量的名称和它们的值
zwrite
read
r
读入字段
read x
set
s
赋值
set x = "Hello World!"
kill
k
清除变量,慎用(不加参数调用时将清除内存中的所有变量!)
kill x
quit
q
终止一个例程的执行
后面加返回值(类似return)
do
d
调用函数,routine
do ##class(myclass).[method](…)
if
评估条件,并根据条件来决定运行哪些代码
if condition { code } elseif condition {code} else {code}
for
重复代码的部分
FOR variable=start:increment:end {…}
while
作用与无参数的For类似,都是重复代码的部分.
2. 与for的区别在于条件是在整个代码块之前(While)还是之后(Do/While)被评估
do {code} while condition
或者
while condition {code}
异常错误解读
输入 quit 退出错误
数据类型
%String, %Status, %Integer, %Double, %DateTime等
运算符
关系运算符:= , < ,> ,<= ,>=
算术运算符:+ ,- , * , / 等
逻辑运算符:&& , || , '
连字符:_
运算优先级:严格按照从左到右执行,数学运算没有优先级,但先计算括号内表达式。
文章
Kelly Huang · 八月 2, 2023
这是一个使用 IKO 在 k3d 上部署 iris-oauth-fhir 的示例。
* iris-oauth-fhir 是一个示例,用于部署带有 OAuth2 身份验证功能的 FHIR 服务器,InterSystems IRIS for Health 作为资源服务器,Google OpenId 则作为授权服务器。
* k3d 作为一个轻量级封装器,用于在 docker 中运行 k3s (Rancher Lab 的最小 Kubernetes 发行版)
* IKO 是一个在 Kubernetes 上部署 InterSystems IRIS for Health 的工具。
2. 目录表
1. K3D + iris-operator + iris-oauth-fhir
2. Table of Contents
2.1. Prerequisites
2.2. Installation
2.2.1. Warning
2.2.2. Build iris-oauth-fhir image
2.2.3. Download k3d
2.2.4. Create a registry
2.2.4.1. add registry to hosts
2.2.4.1.1. mac
2.2.4.1.2. windows
2.3. Start the culster
2.3.1. Check the cluster
2.3.2. Install iris-operator
2.3.2.1. install helm
2.3.2.2. install iris-operator
2.3.3. Install iriscluster
2.3.3.1. What are we going to deploy?
2.3.3.2. Prepare the deployment for the data node
2.3.3.3. Prepare the deployment for the web gateway node
2.3.4. Deploy iriscluster
2.3.5. Deploy ingress
2.4. Easy scale
2.5. Quick init
2.6. Quick deployment
2.1 须知
Docker
Git
Helm
k3d
kubectl
IKO
2.2 安装
2.2.1 警告
这将是很值得经历的一段漫长的过程,您将学到很多关于 Kubernetes 和 InterSystems IRIS for Health 的知识。
2.2.2 构建 iris-oauth-fhir 镜像
首先克隆下面这个存储库
git clone https://github.com/grongierisc/iris-oauth-fhir
然后按照 README.md 中的说明构建 iris-oauth-fhir 镜像。
接下来我们安装 k3d。
2.2.3 下载k3d
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
2.2.4 创建一个注册表
我们必须创建一个注册表,因为目前 Docker Desktop 还没有将其内部注册表用作容器 ID 注册表。有一项实验性功能可将 Docker Desktop 注册表用作容器 ID 注册表,但目前还不稳定。因此,我们将使用 k3d 创建一个注册表。
k3d registry create registry.localhost --port 5000
该命令将在端口 5000 上创建一个注册表。我们将用它来推送图像。这是在 k3d 中使用图像的唯一方法。
现在,我们将把注册表添加到 hosts 文件中。这样,我们就能将其用作 DNS 名称。这一点很重要,因为我们将在部署中使用它。这个 DNS 名称对于我们的主机和 Kubernetes 都是一样的。
2.2.4.1 将注册表添加到主机中
2.2.4.1.1. mac
sudo sh -c 'echo "127.0.0.1 k3d-registry.localhost" >> /etc/hosts'
2.2.4.1.2 windows
Open Notepad as an administrator.
Open the file C:\Windows\System32\Drivers\etc\hosts.
Add the following line to the end of the file: 127.0.0.1 k3d-registry.localhost.
Save the file and close Notepad.
2.3 启动群集
现在,我们将使用此命令行启动群集:
k3d cluster create demo --servers 1 --agents 2 --volume $(pwd)/k8s/data:/var/lib/rancher/k3s/storage@all --registry-use k3d-registry.localhost:5000 -p "8081:80@loadbalancer" -p "4443:443@loadbalancer" --api-port 6550 --volume "$(pwd)/k8s/config/traefik-config.yaml:/var/lib/rancher/k3s/server/manifests/traefik-config.yaml"
有哪些选项
--servers 1 will create one server node, server nodes are the master nodes.
--agents 2 will create two agent nodes, agent nodes are the worker nodes.
--volume $(pwd)/k8s/data:/var/lib/rancher/k3s/storage@all will mount the k8s/data folder to the cluster. This is where we will store our data.
--registry-use k3d-registry.localhost:5000 will use the registry we created before.
-p "8081:80@loadbalancer" -p "4443:443@loadbalancer" will expose the port 8081 and 4443 to the host. This is where we will access our cluster.
--api-port 6550 will expose the port 6550 to the host. This is where we will access the Kubernetes API.
--volume "$(pwd)/k8s/config/traefik-config.yaml:/var/lib/rancher/k3s/server/manifests/traefik-config.yaml" will mount the k8s/config/traefik-config.yaml file to the cluster. This is the configuration file for the ingress controller. This will configure the ingress controller to allow traefik to route the data on the secure port without verification of the certificate.
# k8s/config/traefik-config.yaml
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
globalArguments:
- "--serversTransport.insecureSkipVerify=true"
2.3.1 检查群集
为了让你了解 Kubernetes 集群的样子,下面是一个示意图:
kubectl get nodes
你应该看到如下的内容
NAME STATUS ROLES AGE VERSION
k3d-demo-server-0 Ready control-plane,master 10m v1.21.2+k3s1
k3d-demo-agent-0 Ready <none> 10m v1.21.2+k3s1
k3d-demo-agent-1 Ready <none> 10m v1.21.2+k3s1
这意味着集群已准备就绪。现在,您拥有了一个包含一个主节点和两个工作节点的 Kubernetes 集群。
2.3.2 安装 iris-operator
我们现在开始安装 iris-operator。iris-operator是一个 Kubernetes 操作器,用于在 Kubernetes 上部署 InterSystems IRIS for Health。它可在 WRC 或 InterSystems Container Registry 上获取。我们将使用 3.6.6.100 版本。
例如,如果容器注册表有 IKO,可以使用此命令行:
docker pull containers.intersystems.com/intersystems/iris-operator-amd:3.6.6.100
现在,我们将标记这个image,将其推送到注册表中:
docker tag intersystems/iris-operator-amd:3.6.6.100 k3d-registry.localhost:5000/intersystems/iris-operator-amd:3.6.6.100
继续推送
docker push k3d-registry.localhost:5000/intersystems/iris-operator-amd:3.6.6.100
要安装 Iko 操作员,我们将使用 helm。Helm 是 Kubernetes 的软件包管理器。可在here下载。
2.3.2.1 安装 helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 chmod 700 get_helm.sh ./get_helm.sh
2.3.2.2 安装 iris-operator
helm install intersystems k8s/iris_operator_amd-3.6.6.100/chart/iris-operator
要检查 operator 是否正在运行,可以使用此命令行:
kubectl --namespace=default get deployments -l "release=intersystems, app=iris-operator-amd"
你应该看到👇🏻的内容
NAME READY UP-TO-DATE AVAILABLE AGE
intersystems-iris-operator 1/1 1 1 2m
2.3.3 安装 iriscluster
2.3.3.1 我们要部署什么
我们需要部署👇🏻的架构
One data node
One web gateway node
正是我们在这个 docker-compose 文件中看到的内容:
# docker-compose.yaml
version: '3.6'
services:
iris:
image: iris-oauth-fhir-iris:latest
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 1972
- 8083:52773
- 53773
volumes:
- ./:/irisdev/app/
- ./data:/data
environment:
- ISC_CPF_MERGE_FILE=/irisdev/app/common.cpf
- ISC_OAUTH_SECRET_PATH=/irisdev/app/misc/auth/secret.json
- ISC_DATA_DIRECTORY=/data/iris
webgateway:
build:
context: ./webgateway
args:
link: 'iris'
port: '52773'
image: proxyiris:latest
ports:
- "8080:80"
- "4443:443"
volumes:
- ./webgateway/CSP.ini:/opt/webgateway/bin/CSP.ini
- ./webgateway/httpd-csp.conf:/usr/local/apache2/conf/extra/httpd-csp.conf
几个注意的点:
我们在数据节点中使用了 iris-oauth-fhir-iris:latest 镜像。
该镜像使用三个环境变量:
ISC_CPF_MERGE_FILE 用于合并 common.cpf 文件。
ISC_OAUTH_SECRET_PATH 用于设置秘密文件的路径。
ISC_DATA_DIRECTORY 用于设置数据目录。
网络网关节点使用 proxyiris:latest 映像。
该镜像使用两个volumes:
CSP.ini 用于配置 CSP 应用程序。
httpd-csp.conf 用于配置 apache 服务器。
因此,在 Kubernetes 部署中,我们必须做同样的事情。
这意味着我们必须
数据节点
向数据节点提供 common.cpf 文件。
同样也要提供 secret.json 文件,以配置 OAuth2 身份验证。
数据目录将作为volume加载。
对于网络网关节点:
向网络网关节点提供一些 CSP.ini 文件。
同样,httpd-csp.conf 文件用于配置 apache 服务器。
2.3.3.2 准备数据节点的部署
为了向数据节点提供 common.cpf 文件,我们将使用配置映射。配置映射是用于存储配置文件的 Kubernetes 对象。我们将使用本版本库中的 common.cpf 文件。
下面是配置映射的示意图:
要创建配置映射,我们将使用以下命令行:
kubectl create cm iriscluster-config --from-file common.cpf
为了向数据节点提供 secret.json 文件,我们将使用一个secret。secret是用于存储敏感数据的 Kubernetes 对象。我们将使用该版本库中的 secret.json 文件。
要创建secret,我们将使用以下命令行:
kubectl create secret generic iriscluster-secret --from-file misc/auth/secret.json
要将数据目录挂载为volume,这将是自动的。我们将使用 IrisCluster 定义拓扑部分的存储字段,并将其作为默认设置。
我们仍需将 iris-oauth-fhir-iris:latest 映像推送到注册表。我们将使用与之前相同的命令行:
docker tag iris-oauth-fhir-iris:latest k3d-registry.localhost:5000/iris-oauth-fhir-iris:latest
docker push k3d-registry.localhost:5000/iris-oauth-fhir-iris:latest
2.3.3.3 准备网络网关节点的部署
网络网关节点有点不同,因为我们不会使用 proxyiris:latest 映像。我们将使用 intersystems/webgateway:2023.1.1.380.0-linux-amd64 映像。该镜像可从 InterSystems Container Registry. 上获取。该镜像是原始 Web 网关镜像。
原始网络网关镜像与 proxyiris 镜像有何不同?
proxyiris 已用自签证书预配置了 https。
因此,我们必须配置网络网关使用 https。为此,我们将使用一个secret。secret是一个用于存储敏感数据的 Kubernetes 对象。我们将使用该版本库中的 tls.crt 和 tls.key 文件。
要创建secret,我们将使用以下命令行:
kubectl create secret tls tls-secret --key k8s/tls/tls.key --cert k8s/tls/tls.crt
好消息是,我们无需配置 CSP 应用程序和 apache 服务器。我们将使用 IrisCluster 定义中拓扑部分的 applicationPaths 和 alternativeServers 字段,并将它们作为默认设置。
在 docker-compose.yaml 文件中,我们必须配置 CSP.ini 文件和 httpd-csp.conf 文件。在 Kubernetes 部署中,我们不需要这样做,因为我们无法提前知道数据节点的 IP 地址。但我们仍然需要告诉 IKO 连接到数据节点的登录名和密码。为此,我们将使用一个secret。secret是一个用于存储敏感数据的 Kubernetes 对象。我们将使用该版本库中的 iris-webgateway-secret 文件。
要创建secret,我们将使用以下命令行:
kubectl create secret generic iris-webgateway-secret --from-literal='username=CSPSystem' --from-literal='password=]]]U1lT'
我们仍然需要将 intersystems/webgateway:2023.1.1.380.0-linux-amd64 映像推送到注册表中。我们将使用与之前相同的命令行
docker tag containers.intersystems.com/intersystems/webgateway:2023.1.1.380.0-linux-amd64 k3d-registry.localhost:5000/intersystems/webgateway:2023.1.1.380.0-linux-amd64
docker push k3d-registry.localhost:5000/intersystems/webgateway:2023.1.1.380.0-linux-amd64
2.3.4 部署 iriscluster
现在,我们将安装 IrisCluster。IrisCluster 是一种 Kubernetes 自定义资源,用于在 Kubernetes 上部署 InterSystems IRIS for Health。它定义在 k8s/config/iris-sample.yaml 文件中。
# k8s/config/iris-sample.yaml
## uncommented fields deploy one InterSystems IRIS data server
## WARNING: default password is not reset, to do so include
## configSource below
## include commented fields for purposes described; see documentation at
## https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=AIKO_clusterdef_sample
## update image tags (from ":tag") before using; see list of available images at
## https://docs.intersystems.com/components/csp/docbook/Doc.View.cls?KEY=PAGE_containerregistry
apiVersion: intersystems.com/v1alpha1
kind: IrisCluster
metadata:
name: sample
spec:
## provide InterSystems IRIS license key if required
# licenseKeySecret:
# name: iris-key-secret
## specify files used to customize the configurations of
## InterSystems IRIS nodes, including passwordHash parameter
## to set the default password, securing InterSystems IRIS
configSource:
name: iriscluster-config
## provide repository credentials if required to pull images
# imagePullSecrets:
# - name: iris-pull-secret
## provide VolumeSource specifications for certificates for each desired TLS feature
## "common" enables all TLS features, but each particular feature's property is given priority over "common"
tls:
# common:
# secret:
# secretName: tls-certs
# mirror:
# csi:
# driver: secrets-store.csi.k8s.io
# readOnly: true
# volumeAttributes:
# secretProviderClass: "my-provider"
webgateway:
secret:
secretName: tls-secret
## specify platform-specific storage class used to allocate storage
## volumes (default: use platform-defined class)
# storageClassName: iris-ssd-storageclass
## select update strategy (default: RollingUpdate)
# updateStrategy:
# type: RollingUpdate
## create external IP address(es)for the cluster
## ("type: LoadBalancer" and "externalTrafficPolicy: Local" are required)
# serviceTemplate:
# spec:
# type: LoadBalancer
# externalTrafficPolicy: Local
## define persistent volumes (to be mounted by "volumeMounts:" in node definitions)
# volumeClaimTemplates:
# - metadata:
# name: extra-disk
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 2Gi
## define ephemeral volumes (to be mounted by "volumeMounts:" in node definitions)
volumes:
- name: auth-config
secret:
secretName: iriscluster-secret
## topology: defines node types to be deployed; only "data:" is required
topology:
data:
image: k3d-registry.localhost:5000/iris-oauth-fhir-iris:latest
## set enviroment variable for the container
podTemplate:
spec:
env:
- name: ISC_OAUTH_SECRET_PATH
value: /auth/secret.json
## deploy a sharded cluster of data nodes and (optionally) compute
## nodes; if not included, "data:" definition in "topology:" deploys
## a single data server, "compute:" adds application servers
# shards: 2
## deploy mirrored data nodes or data server (default: nonmirrored)
# mirrored: true
## override default size and other attributes of predefined storage
## volumes for data nodes (additional volume names: storageWIJ,
## storageJournal1, storageJournal2); can also be included in
## "compute:" definition
# storageDB:
# resources:
# requests:
# storage: 10Gi
# storageClassName: my-storageclass
## constrain nodes to platform-specific availability zones (can be
## included in other node definitions)
# preferredZones:
# - us-east1-a
# - us-east1-b
## mount volumes defined in "volumeClaimTemplates:" (persistent) and "volumes:" (ephemeral)
volumeMounts:
- mountPath: "/auth"
name: auth-config
## deploy webgateway (web server) nodes
webgateway:
image: k3d-registry.localhost:5000/intersystems/webgateway:2023.1.1.380.0-linux-amd64
type: apache
replicas: 1
applicationPaths:
- /csp/sys
- /fhir/r4
alternativeServers: LoadBalancing
loginSecret:
name: iris-webgateway-secret
## deploy System Alerting and Monitoring (SAM) with InterSystems IRIS
# sam:
# image: containers.intersystems.com/intersystems/sam:tag
## deploy InterSystems API Manager (IAM) with InterSystems IRIS
# iam:
# image: containers.intersystems.com/intersystems/iam:tag
内容太多了!别担心,我们一一做解释
让我们从 configSource 部分开始:
## specify files used to customize the configurations of
## InterSystems IRIS nodes, including passwordHash parameter
## to set the default password, securing InterSystems IRIS
configSource:
name: iriscluster-config
这是我们之前创建的配置映射。我们将在这里找到 common.cpf 文件。
接下来是 tls 部分:
## provide VolumeSource specifications for certificates for each desired TLS feature
## "common" enables all TLS features, but each particular feature's property is given priority over "common"
tls:
webgateway:
secret:
secretName: tls-secret
这是我们之前创建的secret。我们将在这里找到 tls.crt 和 tls.key 文件。
接下来是volumes部分:
## define ephemeral volumes (to be mounted by "volumeMounts:" in node definitions)
volumes:
- name: auth-config
secret:
secretName: iriscluster-secret
这是我们之前创建的secret。我们将在这里找到 secret.json 文件。
IrisCluster 定义了如何在 Kubernetes 上部署 InterSystems IRIS for Health。重要的部分是拓扑部分。该部分定义了要部署的节点。在本例中,我们将部署一个数据节点和一个网络网关节点。
让我们看看数据节点的定义:
## topology: defines node types to be deployed; only "data:" is required
topology:
data:
image: k3d-registry.localhost:5000/iris-oauth-fhir-iris:latest
## set enviroment variable for the container
podTemplate:
spec:
env:
- name: ISC_OAUTH_SECRET_PATH
value: /auth/secret.json
volumeMounts:
- mountPath: "/auth"
name: auth-config
图像字段定义了要使用的图像。我们将使用之前构建的映像。podTemplate 字段定义 Kubernetes pod 模板。env 字段定义要在容器中设置的环境变量。我们将使用该环境变量来设置将创建的秘密文件的路径。podTemplate 相当于 docker-compose.yaml 文件中的 podTemplate。volumeMounts 字段定义了要挂载到容器中的卷。我们将挂载之前创建的秘密。
现在让我们看看网络网关节点的定义:
## deploy webgateway (web server) nodes
webgateway:
image: k3d-registry.localhost:5000/intersystems/webgateway:2023.1.1.380.0-linux-amd64
type: apache
replicas: 1
applicationPaths:
- /csp/sys
- /fhir/r4
alternativeServers: LoadBalancing
loginSecret:
name: iris-webgateway-secret
图像字段定义了要使用的图像。类型字段定义要部署的网络网关类型。我们将使用 apache。副本字段定义要部署的网络网关的数量。我们将部署一个。applicationPaths 字段定义路由到网络网关的应用程序路径。我们将把 /csp/sys 和 /fhir/r4 路由到网络网关。alternativeServers 字段定义要使用的替代服务器。我们将使用 LoadBalancing。loginSecret 字段定义连接网关和数据节点的登录名和密码。
要部署 IrisCluster,我们将使用以下命令行:
kubectl apply -f k8s/config/iris-sample.yaml
要检查 IrisCluster 是否正在运行,可以使用此命令行:
kubectl get iriscluster
几分钟后,可以看到👇🏻这些信息
NAME SHARDS MIRRORED STATUS AGE
sample Running 2m16s
要了解 IrisCluster 的详细信息,可以使用此命令行:
kubectl describe iriscluster sample
要检查 pod 是否正在运行,可以使用此命令行:
kubectl get pods
几分钟后,可以看到👇🏻这些信息
NAME READY STATUS RESTARTS AGE
intersystems-iris-operator-amd-87c955c9c-4zmrj 1/1 Running 0 44m
sample-data-0 1/1 Running 0 4m19s
sample-webgateway-0 0/1 ContainerCreating 0 17s
要获取 pod 的详细信息,可以使用以下命令行
kubectl describe pod sample-data-0
2.3.5 部署 ingress
现在,我们将部署一个ingress。ingress 是一个 Kubernetes 对象,用于将流量路由到正确的 pod。我们将使用 k8s/config/ingress.yaml 文件。
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
namespace: default
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sample-webgateway
port:
number: 443
该ingress将把流量路由到端口为 443 的 sample-webgateway 服务。
要部署ingress,我们将使用以下命令行
kubectl apply -f k8s/config/ingress.yaml
要检查ingress是否正在运行,可以使用此命令行:
kubectl get ingress
要测试整个过程,可以使用以下命令行:
curl -k https://localhost:4443/fhir/r4/metadata
恭喜您!已成功的在 Kubernetes 上部署了 iris-oauth-fhir。
2.4 Easy Scale
如果要创建一个新租户,可以使用 iris-demo.yaml 文件。
基本上,它与 iris-sample.yaml 文件相同,只是改变了租户的名称。
你可以使用此命令行进行部署:
kubectl apply -f k8s/config/iris-demo.yaml
您可以使用新的 ingress 将流量路由到新租户。
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: strip-prefix
namespace: default
spec:
stripPrefix:
prefixes:
- /sample
- /demo
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
namespace: default
annotations:
traefik.ingress.kubernetes.io/router.middlewares: default-strip-prefix@kubernetescrd
spec:
rules:
- http:
paths:
- path: /sample
pathType: Prefix
backend:
service:
name: sample-webgateway
port:
number: 443
- path: /demo
pathType: Prefix
backend:
service:
name: demo-webgateway
port:
number: 443
新增两条路线
/sample to route the traffic to the sample-webgateway service.
/demo to route the traffic to the demo-webgateway service.
您可以缩放 Compte 节点,但需要License Key。
2.5 快速 init
Tag images
docker tag iris-oauth-fhir-iris:latest k3d-registry.localhost:5000/iris-oauth-fhir-iris:latest
docker tag containers.intersystems.com/intersystems/webgateway:2023.1.1.380.0-linux-amd64 k3d-registry.localhost:5000/intersystems/webgateway:2023.1.1.380.0-linux-amd64
docker tag intersystems/iris-operator-amd:3.6.6.100 k3d-registry.localhost:5000/intersystems/iris-operator-amd:3.6.6.100
Push image
docker push k3d-registry.localhost:5000/iris-oauth-fhir-iris:latest
docker push k3d-registry.localhost:5000/intersystems/webgateway:2023.1.1.380.0-linux-amd64
docker push k3d-registry.localhost:5000/intersystems/iris-operator-amd:3.6.6.100
2.6 快速部署
删除 cluster
k3d cluster delete demo
创建 cluster
k3d cluster create demo --servers 1 --agents 2 --volume $(pwd)/k8s/data:/var/lib/rancher/k3s/storage@all --registry-use k3d-registry.localhost:5000 -p "8081:80@loadbalancer" -p "4443:443@loadbalancer" --api-port 6550 --volume "$(pwd)/k8s/config/traefik-config.yaml:/var/lib/rancher/k3s/server/manifests/traefik-config.yaml"
安装 iris-operator
helm install intersystems k8s/iris_operator_amd-3.6.6.100/chart/iris-operator
创建配置和Secret
kubectl create cm iriscluster-config --from-file common.cpf
kubectl create secret generic iriscluster-secret --from-file misc/auth/secret.json
kubectl create secret tls tls-secret --key k8s/tls/tls.key --cert k8s/tls/tls.crt
kubectl create secret generic iris-webgateway-secret --from-literal='username=CSPSystem' --from-literal='password=]]]U1lT'
部署 IrisCluster:
kubectl apply -f k8s/config/iris-sample.yaml
部署 Ingress
kubectl apply -f k8s/config/ingress.yaml