清除过滤器
文章
Michael Lei · 七月 6, 2021
如果一张图片胜过千言万语,那么一段视频又价值几何? 当然胜过敲一个帖子。
请在 [InterSystems Developers YouTube](https://www.youtube.com/c/InterSystemsDevelopers) 观看我的“Coding talks”:
1. 使用 Yape 分析 InterSystems IRIS 系统性能。 第 1 部分:安装 Yape
在容器中运行 Yape。
2. Yape 容器 SQLite iostat InterSystems
提取和绘制 pButtons 数据,包括时间范围和 iostat。
如果您需要一个简单的方法来捕获和查看 Caché 和 IRIS 以及系统性能指标,可以安排每天运行 pButtons 来轻松实现。 [我之前写过这方面的文章](https://cn.community.intersystems.com/post/intersystems-数据平台的容量规划和性能系列文章)。
我经常需要查看客户系统以进行容量规划和性能检查,这就是我编写 Yape 并在 [GitHub](https://github.com/murrayo/yape "GitHub") 上提供它的原因。 我的 InterSystems 同事 Fabian 将 Yape 的内部结构带入了新方向,并[使其正式在容器中运行](https://community.intersystems.com/post/visualizing-data-jungle-part-iv-running-yape-docker-image)。 Fabian 已经离开 InterSystems,但我继续在 GitHub 上进行开源开发。 在过去一个月左右的时间里,我修复了一些操作系统命令格式错误,使日期处理更智能,在 vmstat 中添加了“Total CPU”图表(倒着看“id”导致我的脖子拉伤),以及其他修饰性更改。
如果您想为 Yape 做出贡献,它在 GitHub 上是开源的。 如果您有功能要求,请[通过建议页面](https://github.com/murrayo/yape/issues)告诉我。
另外,请查看 [Open Exchange 上的 Yape 应用程序](http://bit.ly/2WnqmSt)。
在接下来的几个月,我将分享工作流程中的其他一些技巧,并期望继续开发以使呈现的数据更加有用。 Yape 非常适合检查和查看昨天或过去一周发生的事件的趋势,但是您还需要实时监视和警报... 这里我也对将来的一些帖子做个预告 ;)
文章
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
文章
姚 鑫 · 四月 23, 2022
# 第121章 SQL函数 RPAD
字符串函数,它返回一个右填充到指定长度的字符串。
# 大纲
```java
RPAD(string-expression,length[,padstring])
```
# 参数
- `string-expression` - 字符串表达式,可以是列名、字符串文字、主机变量或另一个标量函数的结果。可以是可转换为 VARCHAR 数据类型的任何数据类型。字符串表达式不能是流。
- `length` - 整数,指定返回的字符串中的字符数。
- `padstring` - 可选 — 由一个字符或一串字符组成的字符串,用于填充输入字符串表达式。 `padstring` 字符或字符附加到 `string-expression` 的右侧,以提供创建长度字符的输出字符串所需的尽可能多的字符。 `padstring` 可以是字符串文字、列、主机变量或另一个标量函数的结果。如果省略,则默认为空格字符。
# 描述
`RPAD` 用尾随填充字符填充字符串表达式。它返回填充到长度字符数的字符串的副本。如果字符串表达式的长度超过 `length` 个字符,则返回字符串被截断为 `length` 个字符。
如果 `string-expression` 为 `NULL`,则 `RPAD` 返回 `NULL`。如果 `string-expression` 为空字符串 (`''`) ,则 `RPAD` 返回一个完全由填充字符组成的字符串。返回的字符串是 `VARCHAR` 类型。
`RPAD` 可用于针对链接表的查询。
`RPAD` 不会删除前导或尾随空格;它填充字符串,包括任何前导或尾随空格。要在填充字符串之前删除前导或尾随空格,请使用 `LTRIM`、`RTRIM` 或 `TRIM`。
# 示例
以下示例用 `^` 字符(在需要时)右填充列值以返回长度为 `16` 的字符串。请注意,某些名称字符串被右填充,某些名称字符串被右截断以返回长度为 `16` 的字符串。
```sql
SELECT TOP 15 Name,RPAD(Name,16,'^') AS Name16
FROM Sample.Person
```
以下示例使用 `^=^` 填充字符串(在需要时)填充列值以返回长度为 `20` 的字符串。请注意,填充名称字符串根据需要重复多次,并且一些返回字符串包含部分填充字符串:
```sql
SELECT TOP 15 Name,RPAD(Name,20,'^=^') AS Name20
FROM Sample.Person
```
文章
姚 鑫 · 十二月 12, 2024
# 第四十八章 终端输入 输出 - PRINT 和 ZPRINT 命令
# `PRIN`T 和 `ZPRINT` 命令
将当前加载的 `IRIS` 例程的一行或多行写入当前设备。
`ZPRINT与`PRINT`具有相同的效果和参数。
# 语法
```java
PRINT
ZPRINT
PRINT x
ZPRINT x
PRINT x:y
ZPRINT x:y
```
参数| `Definition` 定义
---|---
`(none) `|不带参数的`PRINT`或`ZPRINT`命令打印整个例程。
`x,y` |变量`x`和`y`指示要打印的行范围。它们可以是 `TAG+OFFSET` 形式的行引用,也可以是 `+7` 形式的行号。引用不在例程中的行意味着例程最后一行后面有空行。 `x =` 要打印的第一行或唯一一行。 `y =` 要打印的最后一行。
## 示例
此示例打印当前例程的第一行、从 `INIT` 开始的四行以及从 `FINI` 到结尾的所有行:
```java
INIT
SET a=1
SET b=2
SET c=3
SET d=4
FINI
SET x=24
SET y=25
SET z=26
PRINT +1,INIT:INIT+3,FINI:+9999
```
# 对终端进行编程
# 使用 `IRIS` 对格式化 `CRT` 屏幕进行编程
终端 `I/O` 的几个功能有助于对格式化屏幕进行编程:
- 使用`WRITE *`轻松发送控制序列。
- 使用`READ`接收转义序列响应。
- 使用`SET $X = `表达式和`SET $Y = `表达式更新当前光标位置。
固定长度的`READ`和程序员指定的终止字符使读取各个字段变得很方便。可以使用 `Secret` 协议使密码不可见。
请记住,` WRITE *`不会更改`$X`或`$Y` 。如果您想更改它们,请使用`WRITE $C(X)` ,或者直接显式设置它们。
# 示例
本示例将 `VT100` 光标设置为第 `10` 行第 `20 `列
```java
%SYS>SET DY=10,DX=20
%SYS>WRITE *27,*91,DY+1,*59,DX+1,*72 SET $Y=DY,$X=DX
```
## 使用 `CURRENT^%IS` 设置变量
实用程序 `CURRENT^%IS` 设置一些有用的局部变量以适用于当前设备。要调用此例程,请输入:
```java
%SYS>DO CURRENT^%IS
```
该命令设置下表中所示的变量。
`Code` 代码| `Definition` 定义
---|---
`W @FF`|清除屏幕并将光标移动到左上角(第 `0` 列,第 `0` 行),留下`$X =0`, `$Y =0`。
`S DX=42,DY=10 X XY`|将光标直接移动到第 `42` 列第 `10` 行, `$X =42, $Y =10`。
文章
Claire Zheng · 二月 23, 2022
最新一期“极客聊吧”,InterSystems销售工程师们聊了聊这些话题:为什么有些医院和某些商保之间可以直接结算,有些又不能?医院和保险之间的结算难在哪儿?在InterSystems 2021全球线上峰会中提到的医保结算案例对国内实践有哪些借鉴意义?FHIR又能起到什么关键作用?医疗数据实现互联互通的关键是什么?来听听的答案。
公告
Jingwei Wang · 八月 29, 2022
各位开发者,
新的视频已经发布在BiliBili平台:
⏯ 在InterSystmes IRIS 使用 Business Process Designer(业务流程设计器)
请观看如何构建一个新的业务流程,在InterSystems Production 中提供业务逻辑和路由功能。了解如何使用管理门户中的业务流程设计器构建一个BPL业务流程。此外,还可以尝试使用InterSystems集成开发环境自己构建一个。
祝您观看愉快 ! B站上能看到字幕
问题
smith tob · 五月 12, 2023
使用sql访问数据库时,如何对sql语句进行加密? 您是想在 插入表数据的时候将数据加密吗? 比如 在执行insert的 时候把一个字段 用md5 hash 起来存储的,这个现成的sql function 是没有的。SQL Functions | InterSystems SQL Reference | InterSystems IRIS for Health 2023.1这个是我们目前最新版本支持的所有 sql function 如果你是想把sql语句作为整体加密,然后在cache执行的时候解密出来,这样操作的话,加密基本都行吧
文章
姚 鑫 · 二月 3
# 第十四章 I - J 开头的术语
### InterSystems IRIS 存储 (InterSystems IRIS storage)
对象(Objects)
持久对象的默认存储类型。如果你使用 `IRIS` 存储,则无需指定任何存储数据的细节,并且你的类会自动投射到 `SQL`。
### InterSystems SQL
`SQL`
`SQL` 是 `IRIS` 的高级关系接口。`SQL` 完全集成了`IRIS` 的对象功能,共享其类字典用于表定义,并使用作为类定义的高级数据类型。
### InterSystems SQL 服务器 (InterSystems SQL server)
`SQL`
`SQL` 服务器处理来自客户端应用程序的 `SQL` 请求,以对`IRIS` 数据库应用查询和更新、错误日志记录以及其他与 `SQL` 相关的任务。这是 `ODBC` 和 `JDBC` 驱动程序连接的服务器进程。
### InterSystems SQL 存储 (InterSystems SQL storage)
对象(Objects)
`SQL` 存储提供了一种通过对象持久接口使用 `SQL` 插入、更新和检索数据的机制。如果类的存储定义指定了 `%Storage.SQL` 存储类并包含 `SQL` 映射部分,则这些类使用 `SQL` 存储。
### 输入输出转换 (I/O translation)
系统
国家语言支持设施,由一组表组成,用于在计算机的字符集和特定设备的字符集之间进行转换。另见语言配置。
### IP 地址 (IP address)
`IRIS` 系统
根据互联网协议(`IP`)为计算机分配的数字标识符。`IRIS` 支持 `IPv6` 和 `IPv4` 格式。有关 `IRIS` 对 `IPv6` 的支持的更多信息,请参见“使用` IPv6` 地址”。
### IRIS.DAT
系统
`IRIS` 数据库的主卷。它包含`IRIS` 全局和例程。
### ITG 文件 (ITG file)
系统
包含数据库完整性报告的 `ASCII` 文件,扩展名为 `.ITG`,便于识别。`ITG` 文件由数据库完整性检查创建。
# 以 J 开头的术语
### Java
通用
`Java` 是一种面向对象的编程语言,最初由 `Sun Microsystems` 创建。
### Java 数据库连接 (Java Database Connectivity, JDBC)
通用
`Java` 数据库连接,或称 `DBC`,提供了一种用于关系型数据访问的标准 `Java` 接口。
### 后台进程 (JOBbed process)
系统
通过在`IRIS` 提示符下或在应用程序中发出 `ObjectScript JOB` 命令创建的后台进程。在关系服务器系统上,服务器主进程及其创建的服务器进程是后台进程的示例。
### 连接 (join)
`SQL`
从`IRIS` 关系数据库的基表(通过查询、表单或报告)请求信息,其中必须从多个表中检索数据,因此需要表之间的链接。
文章
姚 鑫 · 一月 27, 2023
# 第五十八章 使用 `^BLKCOL` 监视块冲突
当一个进程被迫等待访问一个块时,就会发生块冲突。过多的块冲突会降低应用程序性能。
# `Using ^BLKCOL`
在 `IRIS®` 数据平台中,`^BLKCOL` 实用程序对指定时间段(默认为 `10` 秒)内的块碰撞进行采样,记录这段时间内指定时间间隔(默认为 `10` 毫秒)内的最新块碰撞。对于每个记录的冲突,`^BLKCOL` 不仅标识块,还标识涉及的全局及其在块中的第一个和最后一个引用,以及创建试图访问块的进程的例程和行。
注意:`irisstat -D` 选项,如本指南附录“使用 `irisstat` 实用程序监视 `IRIS`”中的使用选项运行 `irisstat` 中所述,也对块冲突进行采样,但仅识别涉及的块。
`irisstat -D` 的输出包含在 `^SystemPerformance` 实用程序生成的报告中,如本指南的使用 `^SystemPerformance` 监控性能一章所述。
运行 `^BLKCOL` 时,可以指定以下内容:
- 采样周期的长度(以秒为单位)
- 采样之间的间隔(以毫秒为单位)
- 是否收集例程详细信息(默认为是)
- 是否将输出格式化为:
- 具有最高冲突计数的块列表(默认)
- 涉及的所有块的列表`in collisions`
- 来自检测到的所有块碰撞的逗号分隔值,按块编号和例程排序和计数
- 来自所有检测到的块碰撞的逗号分隔值,未排序(`RAW`)
- 例程中的碰撞热点列表
- 要显示的块数(如果适用)
- 是否将输出发送到文件
# `^BLKCOL Ouputend` 输出到文件
`^BLKCOL` 实用程序的使用显示在以下示例终端会话中:
```java
%SYS>do ^BLKCOL
Block Collision Analysis
How many seconds should we sample:
How long to wait (ms) between each sample:
Collect routine details?
Format for 'T'op counts, 'D'isplay all, 'S'orted CSV, 'H'ot spot, or 'R'aw CSV:
Number of blocks to display:
Output to file:
Sampling ... (any key to interrupt)
625 block collisions in 735 samples.
Block # (count) - Global refs (first - last in block) - Routine refs (SFN)
767 (395) in c:\InterSystems\iris\mgr\user\
^acctest - ^acctest(10220," 167") (T/BPtr)
325 at ^AccessTest+156(4)
25 at ^AccessTest+121(4)
24 at ^AccessTest+92(4)
8 at ^AccessTest+109(4)
8 at ^AccessTest+127(4)
4 at ^AccessTest+170(4)
1 at ^AccessTest+163(4)
3890 (11) in c:\InterSystems\iris\mgr\user\
^acctest(2552," 371") - ^acctest(2552," 38") (Data)
6 at ^AccessTest+164(4)
3 at ^AccessTest+163(4)
1 at ^AccessTest+134(4)
1 at ^AccessTest+156(4)
15572 (9) in c:\InterSystems\iris\mgr\user\
^acctest(6980," 4795") - ^acctest(6988," 3259") (Data)
7 at ^AccessTest+134(4)
1 at ^AccessTest+164(4)
1 at ^AccessTest+170(4)
15818 (8) in c:\InterSystems\iris\mgr\user\
^acctest(9124," 173") - ^acctest(9124," 1743") (Data)
5 at ^AccessTest+164(4)
3 at ^AccessTest+170(4)
971 (7) in c:\InterSystems\iris\mgr\user\
^acctest(484," 3927") - ^acctest(484," 3938") (Data)
5 at ^AccessTest+170(4)
2 at ^AccessTest+164(4)
1137 (7) in c:\InterSystems\iris\mgr\user\
^acctest(756," 4063") - ^acctest(756," 4073") (Data)
3 at ^AccessTest+109(4)
2 at ^AccessTest+134(4)
1 at ^AccessTest+156(4)
1 at ^AccessTest+163(4)
2999 (7) in c:\InterSystems\iris\mgr\user\
^acctest(2092," 666") - ^acctest(2092," 674") (Data)
3 at ^AccessTest+170(4)
1 at ^AccessTest+109(4)
1 at ^AccessTest+121(4)
1 at ^AccessTest+134(4)
1 at ^AccessTest+164(4)
6173 (7) in c:\InterSystems\iris\mgr\user\
^acctest(3684," 528") - ^acctest(3684," 536") (Data)
3 at ^AccessTest+163(4)
1 at ^AccessTest+109(4)
1 at ^AccessTest+156(4)
1 at ^AccessTest+164(4)
1 at ^AccessTest+170(4)
14617 (7) in c:\InterSystems\iris\mgr\user\
^acctest(9688," 18") - ^acctest(9688," 26") (Data)
4 at ^AccessTest+170(4)
2 at ^AccessTest+164(4)
1 at ^AccessTest+134(4)
15282 (7) in c:\InterSystems\iris\mgr\user\
^acctest(8700," 4889") - ^acctest(8760," 1402") (Data)
4 at ^AccessTest+170(4)
3 at ^AccessTest+164(4)
%SYS>d ^BLKCOL
Block Collision Analysis
How many seconds should we sample:
How long to wait (ms) between each sample:
Collect routine details?
Format for 'T'op counts, 'D'isplay all, 'S'orted CSV, 'H'ot spot, or 'R'aw CSV: H
Number of blocks to display:
Output to file:
Sampling ... (any key to interrupt)
571 block collisions in 768 samples.
Sorted by routine/line that waits for block ownership
_____________________________________________________
(571) AccessTest
(324) +156^AccessTest : s @G@($J,node)=$$getdata($E(Str,1,$r(1000))) ;SMLXXX+, AFH
(54) +164^AccessTest : k @G@($J,node)
(43) +134^AccessTest : . k @G@($J,node)
(31) +92^AccessTest : . . k @G@($j)
(28) +109^AccessTest : . s x=$O(@G@($J,x))
Sorted by routine that owns the block
_____________________________________
(472) AccessTest
(472) +AccessTest
```
公告
Claire Zheng · 三月 26, 2024
2024年3月29日-3月31日,由国家卫生健康委医院管理研究所主办、《中国数字医学》杂志社有限公司承办的“2024中华医院信息网络大会(CHINC)”将在青岛国际会展中心(红岛馆)举办。InterSystems诚邀您莅临展会,我们带来了内容丰富的Demo演示,包括:InterSystems IRIS 2024.1新特性、 InterSystems IRIS矢量存储和矢量查询、InterSystems FHIR数据资产化解决方案,以及InterSystems IRIS医疗版互联互通套件解决方案。
2024 CHINC期间,InterSystems在合作伙伴东华医为展位(B3馆-A02)设立Demo演示区,即日起即可预约现场Demo咨询,欢迎点击【此处】注册预约。
Demo演示详情
Demo演示: InterSystems IRIS 2024.1新特性
欢迎点击【此处】注册,预约Demo咨询
矢量查询
快速联机备份 (EAP)
多超级服务器端口SuperServer Ports
FHIR R4 and R5 Object Model Generation
IRIS for Health 支持 Smart on FHIR 2.0.0
FHIR查询的性能提升
新的监控指标
嵌入式Python BPL editor
灵活的Python版本设置
Demo演示: InterSystems IRIS矢量存储和矢量查询
欢迎点击【此处】注册,预约Demo咨询
InterSystems IRIS 提供全SQL的矢量存储和基于矢量相似度矢量查询能力
让业务数据无需迁移到其它平台就可以矢量化存储和查询
进一步通过集成矢量化语言模型、生成式语言模型,利用本地数据实现检索增强生成
Demo演示: InterSystems FHIR数据资产化解决方案
欢迎点击【此处】注册,预约Demo咨询
数据作为生产要素推动数字经济已成为我国国策。要让数据成为生产资料参与交易,则需满足两个条件:其一是建立数据生产、流通、消费环节中数据语义的一致性,使数据质量可被控制,数据价值可被度量;二是对数据进行按需加工,形成品类众多的半成品、预制件,以便适应各类业务场景的需要。也即:交易双方应对数据的含义和价值达成共识,这是能够交易的前提——这也正如在中国制造业高速发展的三十年中,标准化部件和预制件之于大规模生产的作用一样。
数据资产清单就是一种有助于在交易双方建立共识、进一步计量计价的有力工具。在医疗行业,FHIR可以成为语言基础,而SQL Builder则提供了FHIR数据资产清单。因此,“FHIR 存储库+SQL builder”能够构成盘活数据资产价值的解决方案。
InterSystems作为深耕医疗行业40余年的专业厂商,在IRIS for Health(IRIS医疗版)数据平台中,借助HL7 FHIR标准提供的语义基础,推出了集FHIR存储库、SQL Builder、FHIR API等功能于一体的医疗行业数据资产解决方案,用于满足医疗数据资产化的业务需要。
在本次解决方案展示中,我们将演示如何基于FHIR进行数据资产盘点,如何按需投放资产支撑数据集需求和数据应用,一遍盘活已成规模的行业数据。包括:1)使用SQL Builder投射SQL数据,在SQL上进一步支撑以数据集为基础的业务(数据集交易或BI),其中按需投放、最小化原则是重要的规约,而IRIS提供了这两种规约的直接支持。2)使用API支撑的业务,不仅仅是使用CRUD操作,FHIR的Search操作对于支撑CDSS等业务具有重要意义。
Demo演示: InterSystems IRIS医疗版互联互通套件
欢迎点击【此处】注册,预约Demo咨询
InterSystems IRIS医疗版互联互通套件是一个全面的解决方案,提供了一整套工具和标准,旨在支持互联互通成熟度测评和通过测评之后的数据利用。它提供了满足互联互通成熟度测评的符合性基础,包括数据元与值集标准以及基于互联互通规范的69个服务和53个电子病历共享文档。此外,该套件还赋能数据利用,能够将电子病历共享文档转换成FHIR资源并存储,通过FHIR SQL Builder实现FHIR资源到SQL表的转换,从而支持数据分析,这一功能打通了互联互通和FHIR生态系统,促进了医疗数据的流动和分析。
更多活动|答问卷,领取《FHIR白皮书》!
由HL7中国委员会主持撰写的《FHIR白皮书》包含FHIR的设计路线与版本、基本用法、核心定义解读与适配、FHIR的发布实施、本地化方法、国外典型实践和案例、国内案例、基于FHIR的参考架构等丰富的内容。欢迎点击【此处】答问卷,领取《FHIR白皮书》!
文章
Claire Zheng · 三月 11, 2021
新冠肺炎疫情大流行史无前例地推动着医疗数字化发展,这一进程不仅影响了医疗服务的提供方式,更带来深刻的行业服务模式变革。经济学人邀请了来自数据技术提供商InterSystems、初级医疗服务提供商Babylon、咨询服务提供商埃森哲、数字化医疗解决方案提供商Kaiser Permanente的专家,从各自的领域和观察出发解读多个热点话题。InterSystems医疗行业解决方案副总裁Don Woodlock参加了此次研讨,分享了InterSystems在数据管理、医疗模式转变、数字化工具面临的优势与挑战、患者对数字化手段的接纳程度等方面的洞察。
能不能搞几个观点摘要? 欢迎课代表留言 请 @Jun.Qian @Li.Yan 同学抽空看看视频,给我们分享一下,谢谢! 好的
公告
Michael Lei · 八月 7, 2023
大家好,
与我们一起参加 8 月 31 日上午 10 点(美国东部时间)在线开发者圆桌会议,讨论医疗保健中的生成式 AI 使用案例。学习医疗保健领域的用例+参考架构,并观看关于大语言模型的Demo演示。我们将像往常一样有时间进行问答和公开讨论。
通过开发者社区Global Masters报名。
演讲者: @Nicholai.Mitchko ,InterSystems 解决方案合作伙伴销售工程师经理
背景: Nicholai 在 InterSystems 管理着一支由 10 名解决方案工程师组成的团队,帮助医疗保健公司大规模设计、开发和交付解决方案。在业余时间,Nicholai 致力于大型语言模型的研究,包括开发自己的模型,这些模型出现在Huggingface OpenLLM 排行榜上。
还不是Global Master会员?使用您的 InterSystems SSO (开发者社区帐号)登录。
公告
Claire Zheng · 十月 23, 2022
开发者社区的同学们,1024快乐!
今晚19:30,我们将通过“InterSystems首届技术征文大赛线上分享会”发布获奖名单、进行征文作品分享&点评、探讨热门话题,同期还将举办多轮抽奖!欢迎参会,锁定#腾讯会议
会议主题:InterSystems首届技术征文大赛线上分享会会议时间:2022/10/24 19:30-21:00 (GMT+08:00) 中国标准时间 - 北京
点击链接入会,或添加至会议列表:https://meeting.tencent.com/dm/nVHWgZcY5NfZ
#腾讯会议:372-615-324
文章
Louis Lu · 十一月 2, 2021
本文介绍了 InterSystems IRIS®数据平台中的大文件传输(Managed File Transfer,MFT)集成选项,它使您能够轻松地将第三方文件传输服务直接集成到 InterSystems IRIS 产品中。本文还包括在新产品中使用 MFT 的逐步指导。
要浏览所有的技术概要(First Look),包括可以在 InterSystems IRIS 免费的评估实例上执行的那些,请参见 InterSystems First Looks(《InterSystems 技术概要》)。
在 InterSystems IRIS 中使用 MFT 的好处
许多拥有 InterSystems IRIS 产品的网站也使用文件传输服务,如 Box、Dropbox 或 Accellion kiteworks,以实现安全、符合 HIPAA 的文件共享。然而,这种服务的使用取决于终端用户是否愿意使用它。在没有强制执行的情况下,他们可能很容易忘记这样做,或者有时干脆选择将文件作为附件发送。通过将 MFT 服务集成到您的产品中,您可以确保文件总是被安全地发送。另一个好处是,由于产品可以根据需要自动地将敏感文件路由到正确的位置,并遵循适当的工作流程,因此,错位或错误指向文件的风险更小。
考虑以下用例:一家职业介绍所将潜在员工的常规体检或药物测试外包给门诊医疗测试机构。测试机构和职业介绍所都有责任确保私人信息的安全数据传输,并在彼此之间进行传输。然而,虽然医疗机构可能已经有了符合 HIPAA 的程序,并可能已经使用了安全文件传输服务,但职业介绍所可能没有适当的基础设施来处理所需的安全级别。在任何一端设置启用 MFT 的 InterSystems IRIS 产品,均可简化所有此类通信的标准化文件传输服务的使用。
对于需要向内部和外部位置(location)提交相同文件的企业来说,或者当单个部门接收到需要根据发件人进行不同处理的文件时,MFT 也非常有用。例如,假设一家汽车经销商需要将签署的客户财务文件传送到他们的总部以及金融机构。另外,假设销售部门与租赁部门有不同的流程(即使这两个部门必须向同一家银行提交相同类型的信息)。这些差异可能会导致混乱和错位或发送错误的文书工作。此外,经销商不能也不应该将客户签署的财务或其他个人数据作为常规电子邮件的附件发送。使用集成了 MFT 的 InterSystems IRIS 产品简化了提交和路由过程,以便将正确的文档送到正确的部门进行适当的处理,从而减少了文档丢失的机会。
它是如何工作的?
InterSystems IRIS 提供了业务主机,您可以将其添加到产品和配置中,而不需要编程。这些业务主机支持 Box、DropBox 和 Accellion kiteworks 服务。一旦您添加了这些业务主机并配置了它们,产品就可以轻松地从终端用户帐户检索文件,或将文件放入这些帐户,或两者都是。
InterSystems IRIS 使用开放授权框架(Open Authorization Framework)2.0 版本(称为 OAuth 2.0)授权对第三方传输服务的访问。当您配置 InterSystems IRIS 产品来使用传输服务时,您将该产品设置为传输服务帐户的授权用户。这允许产品从该帐户下的任何目录(例如分配给单个终端用户的目录)中提取文件并将文件放入其中。这些个人 终端用户的访问完全不受任何影响,他们可以继续像以前一样放置和检索文件。
尝试 MFT:创建启用 MFT 的产品
将 MFT 集成到 InterSystems IRIS 产品中只需要几个步骤:首先,创建并初始化与传输服务的连接,然后包括适当的业务主机,使产品能够直接与传输服务对话。您可以按照本节中的步骤创建一个在您的 Accellion kiteworks 帐户和您的本地桌面系统之间复制文件的产品,就可以看到它是多么简单。如果您更习惯或已经可以访问 Box 或 DropBox,只需在使用 kiteworks 的地方为您的服务替换这些项目。
重要提示: 为了简单起见,使用这些说明创建的产品使用默认设置。在创建实时产品时,InterSystems 强烈建议您根据您的环境来调整设置,特别是那些与安全和您自己特定的 InterSystems IRIS 实例有关的设置。例如,下面提到的 Redirect URL(重定向 URL) 使用 http 而不是 https,这在产品中不是一个好的做法。
想试试 InterSystems IRIS 互操作性功能的在线视频演示吗?请查看 Interoperability QuickStart(互操作性快速入门)!
用前须知
要使用这个程序,您需要一个正在运行的 InterSystems IRIS 实例。您对 InterSystems IRIS 的选择包括多种类型的已授权的和免费的评估实例;该实例不需要在您工作的系统中(尽管它们必须相互具有网络访问权限)。有关如何部署每种类型的实例的信息(如果您还没有可使用的实例),请参见 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。
您还需要对 Accellion kiteworks 上的帐户进行管理访问;您可以在 https://www.accellion.com/kiteworks/ 上创建一个免费试用帐户。
创建 TLS 配置
使用以下程序创建一个 TLS 配置:
使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中为您的实例描述的 URL,在浏览器中打开您的实例的管理门户(Management Portal)。
导航到 TLS 配置页面(System Administration(系统管理) > Security(安全) > SSL/TLS Configurations(SSL/TLS 配置))。
点击 Create New Configuration(创建新的配置) ,并为 Configuration Name(配置名称) 字段输入 MFTTLSConfig。让所有其他字段保持原样,并点击Save(保存)来保存这个新的配置。
在传输服务中注册您的 InterSystems IRIS 实例
接下来,您需要在传输服务本身上为这个 MFT 产品创建一个应用程序(条目)。在一个单独的浏览器窗口或标签中,进入您的 Accellion kiteworks 帐户的管理页面并执行这些步骤。
在管理门户(Management Portal)中,进入 Customs Applications(自定义应用程序)页面,该页面在 Application(应用程序) > Client Management(客户端管理)(适用于 kw2017.02.04 版本)下。
添加一个新条目,并为应用程序指定一个名称,如 ISCFileTransferApp。
请确保 Authorization Code(授权代码)和 Enable Refresh Token(启用刷新令牌)被选中。
在 Redirect URI(重定向 URI) 字段中,输入 URL http://server:port/csp/sys/oauth2/OAuth2.Response.cls,其中服务(server) 和端口(port) 是您的实例的主机标识符和 web 服务器端口。例如,对于一个云实例,URL可能是
http://35.192.42.98:52773/csp/sys/oauth2/OAuth2.Response.cls
本地安装的实例可以在服务(server) 字段中使用 localhost。
这是 kiteworks 用来联系 InterSystems IRIS 实例的 URL。
点击 Add Application(添加应用程序)并记录显示的安全令牌(Client Application ID(客户端应用程序 ID) 和 Client Secret Key(客户端密钥))。稍后在 InterSystems IRIS 上创建 TLS 连接时将使用此信息。
重要提示: 此信息只有在这个时候对您可用,所以您必须立即记录它。如果您在 InterSystems IRIS 产品上创建 TLS 连接时没有此信息,那么您必须再次生成此信息并使用新的值来创建 TLS 连接。
在传输服务中添加目录
现在导航到主 kiteworks(非管理)Folders(文件夹)页面,其中显示您的文件和目录,并创建两个新的顶级目录,一个名为 FilesReceived,用于接收文件,另一个名为 FilesToSend,用于发送文件。
添加可访问 InterSystems IRIS 的目录
现在您应该在实例的主机上创建两个目录,InterSystems IRIS 将在其中访问文件。执行此操作的方法取决于您所使用的实例类型 ,如下所示:
对于由 ICM 部署的实例,可以使用带有 -machine 和 -interactive 选项的 icm exec 命令,在运行实例的容器内打开 bash shell,例如:
icm exec -command bash -machine MYIRIS-AM-TEST-0004 -interactive
然后您可以在容器文件系统上创建目录。
对于任何容器化的实例, 无论是授权版还是社区版(Community Edition),使用命令 docker exec -it container_name bash 在容器中打开 bash shell (社区版[Community Edition]容器的名称是 try-iris)。然后在容器文件系统上创建目录。
对于 InterSystems 学习实验室(Learning Labs),使用集成 IDE 中的命令行终端,在 Shared 文件夹中创建新文件夹;您可以在 /home/project/shared 下的管理门户(Management Portal)中浏览到这些。
对于已安装的实例,在本地文件系统上创建目录。
这个文本假设在 Windows 系统上安装的实例有以下目录路径;替换您创建的实际目录的路径。
C:\InterSystems\ToRemote
C:\InterSystems\FromRemote
创建 MFT 连接
接下来,您需要通过创建 MFT 连接对象在 Intersystems IRIS 上注册传输服务。要做到这一点,请返回管理门户(Management Portal),进入 Managed File Transfer Connections(托管文件传输连接)页面(System Administration[系统管理] > Security(安全)> Managed File Transfer Connections[托管文件传输连接])。点击 Create Connection(创建连接)。请以以下方式指定字段的值,然后点击 Save(保存):
Field Name(字段名称)
Value(值)
Connection Name(连接名称)
KiteSecured
File management service(文件管理服务)
Kiteworks
SSL/TLS configuration(SSL/TLS 配置)
MFTTLSConfig
Email address(电子邮件地址)
您的 Kiteworks 管理员的电子邮件地址,例如
MFTadmin@yourcompany.com
Base URL(基准 URL)
您企业的 kiteworks 的根 URL,例如
https://yourcompany.kiteworks.com/
OAuth 2.0 application name(OAuth 2.0 应用程序名称)
ISCFileTransferApp
OAuth 2.0 client id(OAuth 2.0 客户端 id)
之前从 kiteworks 检索到的 Client Application ID(客户端应用程序 ID)
OAuth 2.0 client secret(OAuth 2.0 客户端机密)
之前从 kiteworks 检索到的 Client Secret Key(客户端密钥)
OAuth 2.0 redirect URL(OAuth 2.0 重定向 URL)
留空。一旦您填写了 Host name(主机名) 和 Port(端口),该字段将自动使用前面提供的 Redirect URI(重定向 URI) 的值填充。
Use TLS/SSL(使用 TLS/SSL)
(清除复选框)
Host name(主机名)
您的实例的主机标识符。
Port(端口)
您的实例的 web 服务器端口。
Prefix(前缀)
(留空)
获取访问令牌
Managed File Transfer Connections(托管文件传输连接)页面会再次显示所有可用的连接,包括您刚刚创建的新连接。如果该连接的状态是 Not Authorized,那么:
点击 Get Access Token(获取访问令牌) 以显示来自 kiteworks 的 Oauth 同意页面,该页面识别了您之前注册的应用程序的名称(ISCFileTransferApp)。
点击 Grant Access(授予访问权限)来授权访问。这将重新显示 Connections(连接) 列表,新的 MFT 连接的状态现在被列为 Authorized。
创建命名空间
为了创建产品,您必须有一个启用互操作性的命名空间。如果您已经创建了一个启用互操作性的命名空间,您可以把它用于此产品。要创建一个新的启用互操作性的命名空间,请使用以下程序。(您首次安装 InterSystems IRIS 时创建的命名空间没有启用互操作性。)
在管理门户(Management Portal)主页上,选择 System Administration(系统管理) > Configuration(配置) > System Configuration(系统配置) >Namespaces(命名空间),进入 Namespaces(命名空间)页面。
在 Namespaces(命名空间)页面,选择 Create New Namespace(创建新的命名空间)。这将显示 New Namespace(新的命名空间)页面;按照 System Administration Guide(《系统管理指南》)的“Configuring InterSystems IRIS(《配置 InterSystems IRIS》)”章节中 Create/Modify a Namespace(创建/修改命名空间)中的使用说明,确保选中了 Enable namespace for interoperability productions(启用互操作性产品的命名空间)复选框。
选择靠近页面顶部的 Save(保存),然后在生成的日志末尾选择 Close(关闭)。
创建产品
接下来,您需要切换到新的命名空间来创建新的产品本身。
进入 InterSystems IRIS 管理门户(Management Portal)主页,在顶部横幅的中间部分找到命名空间标识符。点击 Switch(切换)链接以调出 Namespace Chooser(命名空间选择器)。
选择您刚刚创建的命名空间(例如,ForMFT),然后点击 OK(确定)。
现在导航到 Production(产品) 页面(Interoperability(互操作性) > Configure(配置) > Production(产品))。
点击 New(新建)以调出 Production Wizard(产品向导)。
对于 Package(包),从下拉菜单中选择 INFORMATION(信息)。
输入 Production Name(产品名称),如 NewMFTProduction。
将 Production Type(产品类型)保留为 Generic(通用型),然后点击 OK(確定)来创建产品。
有关产品的更多信息,请参见 Introducing Interoperability Productions guide(《介绍互操作性产品指南》)的 "Introduction to InterSystems IRIS Interoperability(《InterSystems IRIS 互操作性介绍》)"一章中的 "Introduction to Productions(产品介绍)"。
创建业务操作和业务服务
留在新创建的产品中,并添加文件传输所需的四种业务操作和服务(每个方向一个业务操作和一个业务服务):
业务主机名
主机类型
用于
SecureToRemoteOffice
业务操作
发送文件到传输服务
GatherLocalFiles
业务服务
发送文件到传输服务
StoreFilesLocally
业务操作
从传输服务中接收文件
ReceiveFromRemoteOffice
业务服务
从传输服务中接收文件
创建和配置:SecureToRemoteOffice
SecureToRemoteOffice 是将文件发送到传输服务的业务操作(Operation)。为了将它添加到产品中:
点击 Operations(操作)旁边的加号。
选择 Operation Class(操作类) EnsLib.MFT.Operation.Passthrough。
输入 Operation Name(操作名称) SecureToRemoteOffice。
请确保未选中 Enable Now(立即启用),并保留其他字段。
点击 OK(确定)来添加该操作。
选择该操作,然后从右侧的面板进入 Settings(设置)标签。
在 Basic Settings(基础设置)部分,仅配置以下内容:
Field Name(字段名称)
Value(值)
说明
Enable(启用)
(在方框内打勾)
启用该业务主机
MFT Connection Name(MFT 连接名称)
KiteSecured
之前创建的 TLS 配置的名称
Default MFT Folder(默认的 MFT 文件夹)
/FilesReceived/
传输服务的顶级接收目录的名称
Default Filename Specification(默认的文件名规范)
%f
用于创建接收文件名称的模板
将所有其他字段保留为默认设置,并点击 Apply(应用)来保存您的更改。
创建和配置:GatherLocalFiles
GatherLocalFiles 是用于收集从 InterSystems IRIS 发送的文件的业务服务(Service)。为了将它添加到产品中:
点击 Services(服务)旁边的加号。
选择 Service Class(服务类) EnsLib.File.PassthroughService。
输入 Service Name(服务名称) GatherLocalFiles。
请确保未选中 Enable Now(立即启用),并保留其他字段。
点击 OK(确定) 来添加该服务,
选择该服务,然后从右侧的面板进入 Settings(设置)标签。
在 Basic Settings(基础设置)部分,仅配置以下内容:
Field Name(字段名称)
Value(值)
说明
Enable(启用)
(在方框内打勾)
启用该业务主机
File Path(文件路径)
C:\InterSystems\ToRemote\
您的本地系统中包含要发送的文件的目录(如果不同,请用正确的路径代替)。
File Spec(文件规范)
*
要发送的文件名的正则表达式
Target Config Names(目标配置名称)
SecureToRemoteOffice
从此业务服务接受输入的业务主机
将所有其他字段保留为默认设置,并点击 Apply(应用)来保存您的更改。
创建和配置:StoreFilesLocally
StoreFilesLocally 是在 InterSystems IRIS 中存储接收到的文件的业务操作(Operation)。为了将它添加到产品中:
点击 Operations(操作)旁边的加号。
选择 Operation Class(操作类) EnsLib.File.PassthroughOperation。
输入 Operation Name(操作名称) StoreFilesLocally。
请确保未选中 Enable Now(立即启用),并保留其他字段。
点击 OK(确定)来添加该操作。
选择该操作,然后从右侧的面板进入 Settings(设置)标签。
在 Basic Settings(基础设置)部分,仅配置以下内容:
Field Name(字段名称)
Value(值)
说明
Enable(启用)
(在方框内打勾)
启用该业务主机
File Path(文件路径)
C:\InterSystems\FromRemote\
您的本地系统中存储所接收的文件的目录(如果不同,请用正确的路径代替)。
File Name(文件名称)
%f_%Q%!+(_a)
要发送的文件名的语法。为了保证唯一性,InterSystems 建议在文件名中加入日期和时间戳。
将所有其他字段保留为默认设置,并点击 Apply(应用)来保存您的更改。
创建和配置:ReceiveFromRemoteOffice
ReceiveFromRemoteOffice 是用于从您的传输服务接收文件的业务服务(Service)。为了将它添加到产品中:
点击 Services(服务)旁边的加号。
选择 Service Class(服务类)EnsLib.MFT.Service.Passthrough。
输入 Service Name(服务名称) ReceiveFromRemoteOffice。
请确保未选中 Enable Now(立即启用),并保留其他字段。
点击 OK(确定)来添加该服务。
选择该服务,然后从右侧的面板进入 Settings(设置)标签。
在 Basic Settings(基础设置)部分,仅配置以下内容:
Field Name(字段名称)
Value(值)
说明
Enable(启用)
(在方框内打勾)
启用该业务主机
MFT Connection Name(MFT 连接名称)
KiteSecured
之前创建的 TLS 配置的名称
MFT Source Folders(MFT 源文件夹)
/FilesToSend
传输服务的顶级发送目录的名称
Files to Retrieve(检索的文件)
(留空)
从远程位置收集的文件名称(类型)的模板
Target Config Names(目标配置名称)
StoreFilesLocally
从此业务服务接受输入的业务主机
将所有其他字段保留为默认设置,并点击 Apply(应用)来保存您的更改。
测试产品
现在,您已经创建了产品,是时候尝试一下了!只需将文件拖放到您的本地目录和第三方传输服务的指定文件夹中,就可以看到它们出现在另一个位置。
通过点击顶部的 Start(启动) 按钮来启动产品,然后在 Start Production(启动产品)对话框中点击 OK(确定)。
要验证发送到 kiteworks 的文件:
使用操作系统的目录资源管理器,导航到添加 GatherLocalFiles 业务服务时,您在 FilePath(文件路径)字段中指定的目录(C:\InterSystems\ToRemote\ 或您创建的其他目录)。
在该位置放置一个文件。
进入 kiteworks 并导航到 /FilesToRemote/ 文件夹,(添加 SecureToRemoteOffice 业务操作时,您在 Default MFT Folder(默认的 MFT 文件夹)字段中指定的目录)。
刷新文件夹视图,直到新文件出现。这通常是在几秒钟内,甚至更早。
要验证从 kiteworks 接收的文件:
进入 kiteworks 并导航到 /FilesToCentral 文件夹(添加 ReceiveFromRemoteOffice 业务服务时,您在 DefaultMFTFolder(默认的 MFT 文件夹)字段中指定的目录)。
在该位置放置一个文件。
使用您的 OS 目录资源管理器,导航到添加 StoreFilesLocally 业务操作时,您在 FilePath(文件路径) 字段中指定的目录 (C:\InterSystems\FromRemote\ 或您创建的其他目录)。
刷新目录视图,直到新文件出现。这通常是在几秒钟内,甚至更早。
祝贺您,您刚刚成功地使用 MFT 创建了一个工作的production!
了解有关 MFT 的更多信息
更多信息,请参见:
Video Introduction to Managed File Transfer(《托管文件传输视频简介》)
Enabling Productions to Use Managed File Transfer Services(《启用Production使用大文件传输》)
文章
Hao Ma · 四月 19, 2022
本文档只是给您一个大致的概念,方便您了解IRIS安装的方方面面。并非官方安装手册或者安装建议。生产环境的安装请仔细研究并参照[IRIS官方的安装文档](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AB_install#AB_install_Linux)
### 操作系统的选择
IRIS支持多种Linux系统。详细的列表请参见各个版本的支持列表,比如这个是最新的[2021IRIS的支持列表](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=ISP_technologies#ISP_platforms_server)。需要注意的是, CentOS只支持作为测试系统, 并不支持生产系统的安装。
官方文档是以Redhat为主介绍的IRIS安装, 这是IRIS在生产环境中最常用的Linux系统之一。另一个Ubantu, InterSystems提供的docker版本是安装在Ubantu上的。
我自己测试的时候喜欢使用CentOS, 所以后面有具体安装步骤中,使用的CentOS上的记录。
### 服务器的配置
对于生产系统,安装前需要一个硬件配置方案,这个方案通常是您的项目的实施部门根据用户需求提供的。
对于测试系统,只有一个最小的磁盘的要求:1.5G。无论是实体服务器, 虚拟服务器,或者docker container,根据您要测试的内容, 一切以方便为准。如果不做性能测试,我个人经常使用的CentOS虚拟机是2核CPU, 2G或4G内存,没有运行不流畅的问题。
### 磁盘分区
标准的Linux磁盘分区并不适合IRIS的生产运行。哪怕要创建一个尽量接近生产的测试环境,建议您安装软件前要有一个完整的磁盘分区规划。在官方文档中,创建IRIS服务器分区有以下原则:
1. **IRIS程序,客户的数据库,首选Journal,备选Journal应该是分开标准分区或者逻辑盘存储的。所以至少要4个分区/逻辑盘**。
您也可能会喜欢再给backup文件和其他的比如IRIS使用的web文件添加更多的逻辑盘。
2. 文件系统方面,IRIS程序,客户的数据库推荐使用xfs文件格式,**journal盘推荐ext4格式**。( 经过专家确认,这个推荐不属于强烈推荐,更不是强制要求。大多数情况下使用xfs格式没问题。只是在大项目中,比如当您的Journal盘需要分配1TB的空间,特别是使用ECP服务器的情况下, ext4会因为更低的延时带来相对好的性能表现)
以下是一个测试系统中的分区配置,仅仅是示意。
```sh
[root@MyCentOS7 ~]# cat /etc/fstab
/dev/mapper/centos_hmscentos7-root / xfs defaults 0 0
UUID=1d1b46a2-d66d-4346-8709-e70854088b11 /boot xfs defaults 0 0
/dev/mapper/vg_iris-isc_data /isc/data xfs defaults 0 0
/dev/mapper/vg_iris-isc_iris /isc/iris xfs defaults 0 0
UUID=c9ce6576-b469-4c74-8867-fe5b5060ad62 /isc/j1 ext4 defaults 1 2
UUID=0be8a20a-b76c-4a17-9018-ecea1964b73b /isc/j2 ext4 defaults 1 2
/dev/mapper/centos_hmscentos7-swap swap swap defaults 0 0
[root@hmsCentOS7 ~]#
```
这是一个生产环境的配置实例, 其中/isc/iris是iris安装路径:下面放系统的文件,系统使用的数据库,以及和系统工作相关的文件等等,通常分配100-200G。其他的逻辑盘按客户需要分配。SWAP, /boot, /home, /var等等的配置按Linux的推荐及客户的方案配置。
| **Mount Point** | **VG** | **LV** | Size | **File System** | **Mount Options** |
| :-------------- | :------ | :-------- | :--- | --------------- | :---------------- |
| /isc/iris | vg_iris | lv_iris | 200G | XFS | 默认, nobarrier |
| /isc/db | vg_iris | lv_irisdb | 1TB | XFS | 默认, nobarrier |
| /isc/jrnpri | | | 500G | EXT4 | 默认 |
| /isc/jrnsec | | | 500G | EXT4 | 默认 |
在上面的方案中, iris系统自带的数据库IRISTEMP是放在/isc/iris下的。 IRISTEMP正常情况下不会很大,但如果应用的设计很特别,或者出了什么问题,分配了200G大小的/isc/iris可能不足够。如果生产环境发现IRISTEMP有过大的风险,您可能需要单独给IRISTEMP分配一个逻辑盘。
###优化服务器内存配置
以下的对服务器内存的设置可以提高IRIS的性能。
**使用HugePage内存**
IRIS会自动使用系统配置的HugePage, 这会提高IRIS的内存使用效率。在线文档有这么一句: **在超大页内存中可用的内存数量应大于待分配的共享内存总数;否则,将不会使用超大页内存**。 因为 内存数据的总数是为Global, Routine, Lock等分配的内存的和。可以简单的从IRIS启动的日志message.log里看到。
比如下面IRIS被分配了8913M的总内存:
```sh
12/24/21-16:28:58:490 (14080) 0 [Generic.Event] Allocated 8913MB shared memory: 8003MB global buffers, 300MB routine buffers
```
另外,因为操作系统自身的进程不会使用HugePage内存, 您也不能把内存都设置成HugePage。所以设置为**比IRIS需要的多一点就好**。
我们来看看配置HugePage的一个简单例子
```bash
# 查看服务器物理内存
[root@hmsCentOS7 ~]# cat /proc/meminfo | grep MemTotal
MemTotal: 995676 kB
#查看HugePage配置
[root@hmsCentOS7 ~]# cat /proc/meminfo | grep Huge
AnonHugePages: 67584 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
# 修改配置,分配256个2M的HugePage
[root@hmsCentOS7 ~]# vi /etc/sysctl.conf
[root@hmsCentOS7 ~]# cat /etc/sysctl.conf | grep -v ^#
vm.nr_hugepages=256
#load新配置
[root@hmsCentOS7 ~]# sysctl -p
vm.nr_hugepages = 256
[root@hmsCentOS7 ~]
[root@hmsCentOS7 ~]# cat /proc/meminfo | grep Huge
AnonHugePages: 6144 kB
HugePages_Total: 256
HugePages_Free: 256
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
[root@hmsCentOS7 ~]#
```
如果此时您启动IRIS, 会出现“Allocated xxxxMB shared memory using Huge Pages"的日志记录,而且能在/proc/meminfo里看到HugePage的占用情况。
**禁用THP(Transparent Huge Pages)**
InterSystems建议在IRIS服务器禁用THP。RedHat或者CentOS是默认打开的:
```SH
[root@hmsCentOS7 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
[root@hmsCentOS7 ~]#
```
禁用THP您需要修改/etc/default/grub中的GRUB_CMDLINE_LINUX记录,添加“transparent_hugepage=never“
```sh
# 修改文件
[root@hmsCentOS7 ~]# cat /etc/default/grub | grep GRUB_CMDLINE
GRUB_CMDLINE_LINUX="crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos_hmscentos7/root rd.lvm.lv=centos_hmscentos7/swap rhgb quiet transparent_hugepage=never"
# regenerate grub2配置
[root@hmsCentOS7 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-bd06ad08438443f5a959cb7c0c264e89
Found initrd image: /boot/initramfs-0-rescue-bd06ad08438443f5a959cb7c0c264e89.img
done
#重启
[root@hmsCentOS7 ~]shutdown -r now
# 确认配置成功
[root@hmsCentOS7 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
[root@hmsCentOS7 ~]#
```
> [Redhat文档:配置THP](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/performance_tuning_guide/sect-red_hat_enterprise_linux-performance_tuning_guide-configuring_transparent_huge_pages)
**Dirty Page Cleanup**
在一个大内存(比如大于8G)的Linux系统中,以下参数的修改会提高大量flat-files的写性能,比如大量的文件拷贝或者IRIS backup。
- dirty-background_ratio: InterSystems建议设置为5
- dirty_ratio: InterSystems建议设置为10
您需要修改/etc/sysctl.conf文件, 添加这两行:
```sh
vm.dirty_background_ratio=5
vm.dirty_ratio=10
```
###配置NTP服务
各个数据库服务直接以及数据库服务器和应用服务,Web服务,打印服务等等之间要求精准的时间同步。客户可以自己选择采用chornyd或者ntpd来配置NTP。而且, 每个IRIS服务器推荐配置至少2个NTP Server地址。
有关配置NTP的方法请参考相关文档。
比如:[Redhat文档: CONFIGURING NTP USING THE CHRONY SUITE](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_ntp_using_the_chrony_suite#sect-differences_between_ntpd_and_chronyd)
### 安装Web Server (optional)
IRIS提供Web服务需要单独安装的Web服务器。在Linux系统,IRIS支持Apache Web Server和Nginx。
生产环境中, 推荐将Web Server和IRIS安装在不同的硬件服务器上。但是, **如果是要将Web服务器和IRIS安装在同一台服务器,那么最好最好先装好Web Server, 再安装IRIS。**
在执行IRIS的安装脚本时,会提示用户是否需要连接那么先装Apache Web Server和Nginx是正确的顺序, 这样安装IRIS的时候可以将IRIS的Web服务组件,IRIS_WebGateway安装到Apache Web Server的安装目录,并生成相应的配置文件。
```sh
# 修改httpd状态的常用命令
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
#设置开机启动
sudo systemctl enable httpd.service #设置开机启动
```
> 如果启动httpd显示错误“httpd: Could not reliably determine the server's fully qualified domain name”,您需要修改httpd.conf文件, 添加ServerName, 比如设为ServerName localhost:80
**到这里, 您已经基本完成了安装IRIS的准备工作,下面是IRIS的安装步骤。**
### 加载IRIS安装软件
```sh
# 解压安装文件
[root@hmsCentOS7 ~]# mkdir /tmp/iriskit
[root@hmsCentOS7 ~]# chmod og+rx /tmp/iriskit
[root@hmsCentOS7 ~]# umask 022
[root@hmsCentOS7 ~]# gunzip -c IRIS-2022.1.0.140.0-lnxrh7x64.tar.gz | (cd /tmp/iriskit; tar xf -)
[root@hmsCentOS7 iriskit]# cd /tmp/iriskit/IRIS-2022.1.0.140.0-lnxrh7x64/
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]# ls
LICENSE NOTICE cplatname dist docs irisinstall irisinstall_client irisinstall_silent kitlist lgpl.txt package tools
```
> tar -zxvf *.tar.gz是centos上常用的解压命令。上面使用的gunzip来着文档,据说是更通用,适合无法用tar来操作.gz文件的linux系统环境。
###安装依赖的软件包
建议执行IRIS安装脚本前先检查需要的软件包。
```sh
# 查看安装需要的软件包
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]# ./irisinstall --prechecker
Your system type is 'Red Hat Enterprise Linux (x64)'.
Checking Requirements ...
Requirement for openssl version 1.0.2 is satisfied.
Requirement for zlib version 1.2.7 is satisfied.
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]#
```
除此以外,以下软件包是按情况可选的:
- snmpd: 如果您需要使用SNMP来监控IRIS
- jre或者jdk : 如果您需要IRIS服务器使用JDBC连接其他数据库
- unixODBC: 如果您需要IRIS服务器使用ODBC连接其他数据库
- policycoreutils-python, policycoreutils-devel, settroubleshoot-server : 如果您需要使用SELinux管理IRIS文件的读写。
它们只是IRIS工作时需要的软件包,IRIS的安装并不依赖或者检查它们。
###创建iris用户
安装iris需要root用户或者拥有root权限的sudoer。然而,按照Linux的常规做法,出于安全的考虑,IRIS的管理和运行应该拥有自己的用户和用户组。在安装过程中, 您会被要求提供以下的内容:
- What user should be the owner of this instance?
- What group should be allowed to start and stop?
"owner of instance"和“group to start and stop"可以是一个用户和它的用户组。比如您创建了一个irisowner的用户, 它默认的用户组irisowner可以作为“group start to stop"。当然您也可以专门创建一个用户组, 比如irisadmin, 将您的管理员tom, jerry, mickey等等加入irisadmin。
在标准的安装步骤下, 用户组irisowner和用户组irisadmin权限相同, 因此最简单的方式就是使用irisowner用户和irisowner用户组。
```sh
# 创建iris owner
useradd irisowner
# 创建您的管理员团队
[root@hmsCentOS7 mail]# useradd -N tom
[root@hmsCentOS7 mail]# useradd -N jerry
[root@hmsCentOS7 mail]# useradd -N iscbackup
[root@hmsCentOS7 mail]# gpasswd irisowner -a tom
Adding user tom to group irisowner
[root@hmsCentOS7 mail]# gpasswd irisowner -a jerry
Adding user jerry to group irisowner
[root@hmsCentOS7 mail]# gpasswd irisowner -a iscbackup
Adding user iscbackup to group irisowner
[root@hmsCentOS7 mail]# cat /etc/group | grep irisowner
irisowner:x:1000:tom,jerry,iscbackup
[root@hmsCentOS7 mail]#
```
*如果需要,您可以把tom, jerry等用户加入sudoer列表。*
**实际上, 在后面安装脚本的执行过程中, 还有2个重要的用户被创建出来, 他们是:**
- **irisusr**: 所有iris进程使用这个user运行。它还用来访问数据库和journal。在一个安全的系统里,irisusr组里就只有一个用户irisusr, 也不要添加其他的user。
- **iscagent**: 用于运行镜像使用的iscagent进程
IRIS用户和管理员不要动这两个用户。
###执行IRIS安装脚本
安装脚本会设置user, group,和安装后文件的权限,您需要在按照前检查umask, 确认设置为022。
**执行标准的安装流程**
```bash
# 开始安装步骤
[root@hmsCentOS7 iriskit]# cd /tmp/iriskit/IRIS-2022.1.0.140.0-lnxrh7x64/
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]# ls
LICENSE NOTICE cplatname dist docs irisinstall irisinstall_client irisinstall_silent kitlist lgpl.txt package tools
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]# ./irisinstall
Your system type is 'Red Hat Enterprise Linux (x64)'.
Currently defined instances:
Enter instance name: iris
Do you want to create InterSystems IRIS instance 'iris' ?
Enter a destination directory for the new instance.
Directory: /isc/iris
------------------------------------------------------------------
NOTE: Users should not attempt to access InterSystems IRIS while
the installation is in progress.
------------------------------------------------------------------
Select installation type.
1) Development - Install InterSystems IRIS server and all language bindings
2) Server only - Install InterSystems IRIS server
3) Custom
Setup type ? 1
How restrictive do you want the initial Security settings to be?
"Minimal" is the least restrictive, "Locked Down" is the most secure.
1) Minimal
2) Normal
3) Locked Down
Initial Security settings ? 2
What user should be the owner of this instance? irisowner
An InterSystems IRIS account will also be created for user irisowner.
Install will create the following InterSystems IRIS accounts for you:
_SYSTEM, Admin, SuperUser, irisowner and CSPSystem.
Please enter the common password for _SYSTEM, Admin, SuperUser and irisowner:
Re-enter the password to confirm it:
Please enter the password for CSPSystem:
Re-enter the password to confirm it:
What group should be allowed to start and stop
this instance? irisowner
Do you want to install IRIS Unicode support ?
InterSystems IRIS did not detect a license key file
Do you want to enter a license key ?
Please review the installation options:
------------------------------------------------------------------
Instance name: iris
Destination directory: /isc/iris
InterSystems IRIS version to install: 2022.1.0.140.0
Installation type: Development
Unicode support: Y
Initial Security settings: Normal
User who owns instance: irisowner
Group allowed to start and stop instance: irisowner
Effective group for InterSystems IRIS processes: irisusr
Effective user for InterSystems IRIS SuperServer: irisusr
SuperServer port: 1972
WebServer port: 52773
JDBC Gateway port: 53773
Web Gateway: using built-in web server
Not installing IntegratedML
------------------------------------------------------------------
Confirm InterSystems IRIS installation ?
Starting installation
Starting up InterSystems IRIS for loading...
../bin/irisinstall -s . -B -c c -C /isc/iris/iris.cpf*iris -W 1 -g2
Starting Control Process
Allocated 238MB shared memory
32MB global buffers, 80MB routine buffers
Creating a WIJ file to hold 32 megabytes of data
IRIS startup successful.
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
System locale setting is 'en_US.UTF-8'
This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2022 by InterSystems Corporation
Any other use is a violation of your license agreement
^^/isc/iris/mgr/>
^^/isc/iris/mgr/>
Start of IRIS initialization
Loading system routines
Updating system TEMP and LOCALDATA databases
Installing National Language support
Setting IRISTEMP default collation to IRIS standard (5)
Loading system classes
Updating Security database
Loading system source code
Building system indices
Updating Audit database
Updating Journal directory
Updating User database
Updating Interoperability databases
Scheduling inventory scan
IRIS initialization complete
See the iboot.log file for a record of the installation.
Starting up InterSystems IRIS...
Once this completes, users may access InterSystems IRIS
Starting IRIS
Using 'iris.cpf' configuration file
Starting Control Process
Global buffer setting requires attention. Auto-selected 25% of total memory.
Allocated 463MB shared memory
243MB global buffers, 80MB routine buffers
Creating a WIJ file to hold 99 megabytes of data
This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2022 by InterSystems Corporation
Any other use is a violation of your license agreement
1 alert(s) during startup. See messages.log for details.
You can point your browser to http://hmsCentOS7:52773/csp/sys/UtilHome.csp
to access the management portal.
Installation completed successfully
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]#
```
**执行customer安装IRIS+WebGateway**
如果要在本机安装WebGateway, 需要在执行安装脚本的过程中,当被问到:“Select installation type.”时选择Customer, 而不是Development。这样后面就脚本将在Web Server上加载IRIS专用的动态连接库,并创建和Web Server连接的IRIS Web网关。
在此之前, 您还需要配置安装semanage来保证可以配置SELinux。安装脚本会检查,如果没有发现semanag, 会提示您停止继续安装。
```sh
# 安装semanage, 确认命令可以工作。省略输出
[root@hmsCentOS7 ~]# yum install policycoreutils-devel
[root@hmsCentOS7 ~]# yum instll setroubleshoot-server
[root@hmsCentOS7 ~]# yum install setroubleshoot-server
[root@hmsCentOS7 ~]# semanage -h
...
[root@hmsCentOS7 ~]#
```
假设你已经创建了一个/isc/iris2的目录,然后就可以安装了。注意下面使用的superserver和web端口是51773和52774。这是默认的第2个IRIS实例的端口号,您也可以输入其他端口号或者在安装后在维护页面修改这些端口。
```sh
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]# ./irisinstall
Your system type is 'Red Hat Enterprise Linux (x64)'.
Currently defined instances:
IRIS instance 'IRIS'
directory: /isc/iris
versionid: 2022.1.0.140.0
datadir: /isc/iris
conf file: iris.cpf (SuperServer port = 1972, WebServer = 52773)
status: down, last used Fri Apr 8 13:32:47 2022
product: InterSystems IRIS
Enter instance name: iris2
Do you want to create InterSystems IRIS instance 'iris2' ?
Enter a destination directory for the new instance.
Directory: /isc/iris2
------------------------------------------------------------------
NOTE: Users should not attempt to access InterSystems IRIS while
the installation is in progress.
------------------------------------------------------------------
Select installation type.
1) Development - Install InterSystems IRIS server and all language bindings
2) Server only - Install InterSystems IRIS server
3) Custom
Setup type ? 3
How restrictive do you want the initial Security settings to be?
"Minimal" is the least restrictive, "Locked Down" is the most secure.
1) Minimal
2) Normal
3) Locked Down
Initial Security settings ? 2
What user should be the owner of this instance? irisowner
An InterSystems IRIS account will also be created for user irisowner.
Install will create the following InterSystems IRIS accounts for you:
_SYSTEM, Admin, SuperUser, irisowner and CSPSystem.
Please enter the common password for _SYSTEM, Admin, SuperUser and irisowner:
Re-enter the password to confirm it:
Please enter the password for CSPSystem:
Re-enter the password to confirm it:
What group should be allowed to start and stop
this instance? irisowner
Do you want to configure additional security options ?
Do you want to install IRIS Unicode support ?
Enter the SuperServer port number :
Enter the WebServer port number :
Do you want to configure the Web Gateway to use an existing web server ? yes
Specify the WebServer type. Choose "None" if you want to configure
your WebServer manually.
1) Apache
2) None
WebServer type ? 1
Enter user name used by Apache server to run its worker processes :
Please enter location of Apache configuration file [/etc/httpd/conf/httpd.conf]:
// /etc/httpd/conf.d/isc.conf
Please enter location of Apache executable file :
Apache version 2.4 is detected.
Apache httpd server will be restarted during the install.
Please enter destination directory for Web Gateway files [/opt/webgateway]:
InterSystems IRIS did not detect a license key file
Do you want to enter a license key ?
Do you want to install IntegratedML (this feature requires additional 1166MB of disk space) ?
Please review the installation options:
------------------------------------------------------------------
Instance name: iris2
Destination directory: /isc/iris2
InterSystems IRIS version to install: 2022.1.0.140.0
Installation type: Custom
Unicode support: Y
Initial Security settings: Normal
User who owns instance: irisowner
Group allowed to start and stop instance: irisowner
Effective group for InterSystems IRIS processes: irisusr
Effective user for InterSystems IRIS SuperServer: irisusr
SuperServer port: 51773
WebServer port: 52774
JDBC Gateway port: 53773
Web Gateway: installed into /opt/webgateway
Apache web server will be configured for Web Gateway
Not installing IntegratedML
------------------------------------------------------------------
Confirm InterSystems IRIS installation ? yes
Starting installation
Updating Apache configuration file ...
- /etc/httpd/conf/httpd.conf
Starting up InterSystems IRIS for loading...
../bin/irisinstall -s . -B -c c -C /isc/iris2/iris.cpf*iris2 -W 1 -g2
Starting Control Process
Allocated 238MB shared memory
32MB global buffers, 80MB routine buffers
Creating a WIJ file to hold 32 megabytes of data
IRIS startup successful.
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
System locale setting is 'en_US.UTF-8'
This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2022 by InterSystems Corporation
Any other use is a violation of your license agreement
^^/isc/iris2/mgr/>
^^/isc/iris2/mgr/>
Start of IRIS initialization
Loading system routines
Updating system TEMP and LOCALDATA databases
Installing National Language support
Setting IRISTEMP default collation to IRIS standard (5)
Loading system classes
Updating Security database
Loading system source code
Building system indices
Updating Audit database
Updating Journal directory
Updating User database
Updating Interoperability databases
Scheduling inventory scan
IRIS initialization complete
See the iboot.log file for a record of the installation.
Starting up InterSystems IRIS...
Once this completes, users may access InterSystems IRIS
Starting IRIS2
Using 'iris.cpf' configuration file
Starting Control Process
Global buffer setting requires attention. Auto-selected 25% of total memory.
Allocated 463MB shared memory
243MB global buffers, 80MB routine buffers
Creating a WIJ file to hold 99 megabytes of data
This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2022 by InterSystems Corporation
Any other use is a violation of your license agreement
1 alert(s) during startup. See messages.log for details.
You can point your browser to http://hmsCentOS7:52774/csp/sys/UtilHome.csp
to access the management portal.
Installation completed successfully
[root@hmsCentOS7 IRIS-2022.1.0.140.0-lnxrh7x64]#
```
上面步骤中当提示:”Please enter location of Apache configuration file [/etc/httpd/conf/httpd.conf]: “ 的时候我使用了默认选项/etc/httpd/conf/httpd.conf, IRIS安装脚本回修改httpd.conf文件, 加入连接IRIS的配置。这里更好的做法是先在/etc/httpd/conf.d里创建一个单独的配置文件,比如isc.conf, 在回答上面的提示是输入**/etc/httpd/conf.d/isc.conf**。很遗憾您需要自己手工先创建这个文件,安装脚本不回替您创建。
### 安装后的检查
**检查安装日志**
查看上面的安装日志,确认没有错误发生。
**查看新创建的用户irisusr和iscagent**
```sh
[root@hmsCentOS7 ~]# id irisusr
uid=1001(irisusr) gid=1001(irisusr) groups=1001(irisusr)
[root@hmsCentOS7 ~]# id iscagent
uid=1002(iscagent) gid=1002(iscagent) groups=1002(iscagent)
[root@hmsCentOS7 ~]#
```
**查看文件系统权限**
```sh
[root@hmsCentOS7 ~]# ls -l /isc
total 8
drwxr-xr-x. 2 root root 6 Apr 1 23:57 data
drwxrwxr-x. 14 irisowner irisusr 4096 Apr 6 14:28 iris
drwxr-xr-x. 3 root root 1024 Apr 1 23:57 jrnpri
drwxr-xr-x. 3 root root 1024 Apr 1 23:57 jrnsec
[root@hmsCentOS7 ~]# ls -l /isc/iris
total 112
-r--r--r--. 1 irisowner irisusr 11358 Apr 6 14:28 LICENSE
-r--r--r--. 1 irisowner irisusr 534 Apr 6 14:28 NOTICE
-rwxr-xr-x. 1 irisowner irisusr 4497 Mar 7 15:20 ODBCinstall
drwxrwxr-x. 2 irisowner irisusr 26 Apr 6 14:27 SNMP
-rwxrw-r--. 1 irisusr irisusr 9703 Apr 6 14:28 _LastGood_.cpf
drwxr-xr-x. 2 root irisowner 8192 Apr 6 14:28 bin
drwxrwxr-x. 7 irisowner irisusr 106 Apr 6 14:27 csp
drwxr-xr-x. 17 irisowner irisusr 214 Apr 6 14:28 dev
drwxrwxr-x. 3 irisowner irisusr 20 Apr 6 14:28 devuser
drwxr-xr-x. 3 root root 21 Apr 6 14:28 dist
drwxr-xr-x. 5 irisowner irisusr 156 Apr 6 14:28 docs
drwxr-xr-x. 5 irisowner irisusr 68 Apr 6 14:28 fop
drwxrwxr-x. 5 irisowner irisusr 41 Apr 6 14:27 httpd
-rw-rw-r--. 1 root root 9557 Apr 6 14:28 install.cpf
-rw-rw-r--. 1 irisowner irisusr 9732 Apr 6 14:28 iris.cpf
-rwxr-xr-x. 1 irisowner irisusr 9557 Apr 6 14:28 iris.cpf_20220406
-r-xr-x---. 4 irisowner irisowner 909 Apr 6 14:28 irisforce
-r-xr-x---. 4 irisowner irisowner 909 Apr 6 14:28 irisstart
-r-xr-x---. 4 irisowner irisowner 909 Apr 6 14:28 irisstop
-r--r--r--. 1 irisowner irisusr 7639 Apr 6 14:28 lgpl.txt
drwxr-xr-x. 6 irisowner irisusr 80 Apr 6 14:28 lib
drwxrwxr-x. 13 irisowner irisusr 4096 Apr 6 14:28 mgr
-rw-------. 1 root root 3299 Apr 6 14:28 parameters.isc
drwxr-xr-x. 2 irisowner irisusr 237 Apr 6 14:27 patrol
[root@hmsCentOS7 ~]# ls -l /isc/iris/mgr
total 163952
-rw-r-----. 1 irisowner irisusr 62914560 Apr 6 14:31 IRIS.DAT
-rw-rw----. 1 irisowner irisusr 104857600 Apr 6 14:36 IRIS.WIJ
drwxr-xr-x. 2 irisowner irisusr 4096 Apr 6 14:28 Locale
-rwxrw-r--. 1 irisusr irisusr 66 Apr 6 14:28 SystemMonitor.log
drwxrwxr-x. 2 irisusr irisusr 6 Apr 6 14:28 Temp
-rwxrw-r--. 1 irisusr irisusr 134 Apr 6 14:28 alerts.log
-rwxrw-r--. 1 irisusr irisusr 13759 Apr 6 14:28 ensinstall.log
drwxrwxr-x. 3 irisowner irisusr 36 Apr 6 14:28 enslib
-rwxr-xr-x. 1 irisowner irisusr 38319 Apr 6 14:28 iboot.log
-rwxrwxrwx. 1 irisowner irisusr 0 Apr 6 14:28 ilock
-rw-rw----. 1 irisowner irisusr 10 Apr 6 14:28 iris.ids
-rw-rw----. 1 irisowner irisusr 30 Apr 6 14:28 iris.lck
-rw-rw-rw-. 1 irisowner irisusr 2 Apr 6 14:28 iris.shid
-rw-rw-r--. 1 irisowner irisusr 5 Apr 6 14:28 iris.use
drwxrwxr-x. 3 irisowner irisusr 52 Apr 6 14:28 irisaudit
drwxrwxr-x. 3 irisowner irisusr 36 Apr 6 14:28 irislib
drwxrwxr-x. 3 irisowner irisusr 52 Apr 6 14:28 irislocaldata
-rw-rw----. 1 irisowner irisusr 933 Apr 6 14:28 irisodbc.ini
drwxrwxr-x. 3 irisowner irisusr 52 Apr 6 14:28 iristemp
drwxrwxr-x. 2 irisowner irisusr 42 Apr 6 14:28 journal
-rw-rw----. 1 irisowner irisusr 211 Apr 6 14:28 journal.log
-rw-rw-r--. 1 irisowner irisusr 14146 Apr 6 14:28 messages.log
drwxrwxr-x. 2 irisowner irisusr 6 Apr 6 14:27 python
-rw-rw-rw-. 1 irisowner irisusr 55 Apr 6 14:28 startup.last
drwxrwxr-x. 2 irisowner irisusr 6 Apr 6 14:28 stream
drwxrwxr-x. 3 irisowner irisusr 52 Apr 6 14:28 user
[root@hmsCentOS7 ~]#
```
**修改文件系统权限**
将/isc/data, /isc/jrnpri, /isc/jrnsec文件系统的user和group,以及权限修改到下面的样子
```sh
[root@hmsCentOS7 ~]# chown irisowner:irisusr /isc/data /isc/jrnpri /isc/jrnsec
[root@hmsCentOS7 ~]# chmod 775 /isc/data /isc/jrnpri /isc/jrnsec
[root@hmsCentOS7 ~]# ls -l /isc
total 8
drwxrwxr-x. 2 irisowner irisusr 6 Apr 1 23:57 data
drwxrwxr-x. 14 irisowner irisusr 4096 Apr 6 14:28 iris
drwxrwxr-x. 3 irisowner irisusr 1024 Apr 1 23:57 jrnpri
drwxrwxr-x. 3 irisowner irisusr 1024 Apr 1 23:57 jrnsec
[root@hmsCentOS7 ~]#
```
**打开防火墙IRIS的TCP端口**
IRIS系统使用以下TCP端口:
- superserver port: 默认是1972
- web port: 默认是52773
- mirror port: 默认是2188
- license server port: 默认是4001, (很少使用)
```sh
[root@hmsCentOS7 iris]# firewall-cmd --permanent --add-port=1972/tcp
success
[root@hmsCentOS7 iris]# firewall-cmd --permanent --add-port=52773/tcp
success
[root@hmsCentOS7 iris]# firewall-cmd --permanent --add-port=2188/tcp
success
[root@hmsCentOS7 iris]# firewall-cmd --list-port
1972/tcp 2188/tcp 52773/tcp
[root@hmsCentOS7 iris]# firewall-cmd --reload
success
[root@hmsCentOS7 iris]#
```
**访问系统管理界面**
通过SMP(System Management Portal)的url, 您可以访问IRIS。
http://host-ipaddr:52773/csp/sys/UtilHome.csp
用户名使用superuser, 密码为您安装创建的密码。
**激活IRIS License**
到管理界面的“系统 > 软件许可颁发 > 软件许可授权码”,加载在本机保存的IRIS许可。
注意弹出窗口的文件选项默认是.key文件。所以您上传文件到Linux服务器前最好把文件改为iris.key。另外,文件和文件夹一定要可以被irisowner访问。如果放在/root文件夹,或者不运行other用户访问,您要么在选文件的窗口无法找到这个文件,要么无法成功激活。
**创建数据库**
到 "系统 > 配置 > 本地数据库"创建数据库。查看在/isc/data里的文件夹和权限。举例:创建demo数据库到/isc/data/demo:
```sh
[root@hmsCentOS7 isc]# ls -Rl /isc/data
/isc/data:
total 0
drwxrwxr-x. 3 irisusr irisusr 52 Apr 6 15:37 demo
/isc/data/demo:
total 1028
-rw-rw----. 1 irisusr irisusr 1048576 Apr 6 15:38 IRIS.DAT
-rw-rw----. 1 irisowner irisusr 30 Apr 6 15:37 iris.lck
drwxrwxr-x. 2 irisusr irisusr 6 Apr 6 15:37 stream
/isc/data/demo/stream:
total 0
[root@hmsCentOS7 isc]#
```
**设置Journal文件夹**
到“系统 > 配置 > Journal 设置”设置journal的主备路径到/isc/jrnprm和/isc/jrnsec。
查看两个路径里的文件权限是660(rw-rw----)
```sh
[root@hmsCentOS7 opt]# ls -l /isc/jrnpri
total 272
-rw-rw----. 1 irisowner irisusr 262144 Apr 6 15:29 20220406.002
-rw-rw----. 1 irisowner irisusr 30 Apr 6 15:29 iris.lck
drwx------. 2 irisowner irisusr 12288 Apr 1 23:57 lost+found
[root@hmsCentOS7 opt]# ls -l /isc/jrnsec
total 15
-rw-rw----. 1 irisowner irisusr 30 Apr 6 15:29 iris.lck
drwx------. 2 irisowner irisusr 12288 Apr 1 23:57 lost+found
[root@hmsCentOS7 opt]#
```
**启动ISCAgent**
如果需要配置镜像,服务器需要人工启动ISCAgent
```bash
# 启动iscagent服务
systemctl start ISCAgent.service
# 设置iscagent
systemctl enable ISCAgent.service
```
**SELinux配置**(Optional)
如果您上面执行的是“**执行customer安装以安装WebGateway**”,那么这里您需要配置SELinux。
SELinux会限制httpd对系统其它文件的访问权限,比如说//usr/sbin/httpd无法访问IRIS的WebGateway, 它工作在/opt/webgateway/bin目录。你需要做以下几步来保证SELinux不再限制对IRIS文件的访问:
- 允许httpd读写WebGateway文件
```sh
# httpd_sys_content_t – set on directories that Apache is allowed access to,
# httpd_sys_rw_content_t – set on directories that Apache is allowed read/write access # httpd_sys_script_exec_t – used for directories that contain executable scripts.
[root@hmsCentOS7 conf]# ls -Z /opt/webgateway/conf
-rw-------. apache root unconfined_u:object_r:httpd_sys_content_t:s0 CSP.ini
-rw-------. apache root unconfined_u:object_r:httpd_sys_content_t:s0 CSPRT.ini
[root@hmsCentOS7 conf]# semanage fcontext -a -t httpd_sys_rw_content_t /opt/webgateway/conf/CSP.ini
[root@hmsCentOS7 conf]# restorecon -v /opt/webgateway/conf/CSP.ini
restorecon reset /opt/webgateway/conf/CSP.ini context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0
[root@hmsCentOS7 conf]# semanage fcontext -a -t httpd_sys_rw_content_t /opt/webgateway/conf/CSPRT.ini
[root@hmsCentOS7 conf]# restorecon -v /opt/webgateway/conf/CSPRT.ini
restorecon reset /opt/webgateway/conf/CSPRT.ini context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0
[root@hmsCentOS7 conf]# ls -Z
-rw-------. apache root unconfined_u:object_r:httpd_sys_rw_content_t:s0 CSP.ini
-rw-------. apache root unconfined_u:object_r:httpd_sys_rw_content_t:s0 CSPRT.ini
[root@hmsCentOS7 conf]#
[root@hmsCentOS7 webgateway]# semanage fcontext -a -t httpd_sys_rw_content_t /opt/webgateway/logs/CSP.log
[root@hmsCentOS7 webgateway]# restorecon -v /opt/webgateway/logs/CSP.log
restorecon reset /opt/webgateway/logs/CSP.log context unconfined_u:object_r:httpd_sys_content_t:s0->unconfined_u:object_r:httpd_sys_rw_content_t:s0
[root@hmsCentOS7 webgateway]#
```
- 允许httpd读写IRIS的Web Application文件,假设文件目录是/isc/web, -R是recursively
```sh
semanage fcontext -a -t httpd_sys_rw_content_t "/isc/web(/.*)?"
restorecon -Rv /isc/web/
```
- 运行httpd到IRIS的连接, (最新版本也许不需要手工配置了)
```sh
# 默认的superserver端口为1972, 上面的iris2使用的是51773
[root@hmsCentOS7 ~]# semanage port -a -t http_port_t -p tcp 51773
ValueError: Port tcp/51773 already defined
[root@hmsCentOS7 ~]# semanage port -a -t http_port_t -p tcp 1972
[root@hmsCentOS7 ~]# semanage port -l | grep http_port
http_port_t tcp 1972, 51773, 80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t tcp 5988
[root@hmsCentOS7 ~]# setsebool -P httpd_can_network_connect 1
[root@hmsCentOS7 ~]#
```
到这里, 您的IRIS安装过程已经结束了。后面的实施工作可能包括:
- IRIS配置
- 镜像配置
- WebGateway配置
我会在其他文章中介绍上述内容。
另外, 请注意重启(reboot)在安装过程中十分重要: 通常的情况是,至少有一些配置在第一次重启时并不存在。这可能包括被挂载的卷、/etc/fstab中的错误、启动时不启动的服务、在没有重载服务的情况下进行的配置修改等等。
一旦你认为服务器已经完成,并验证所有的配置都符合预期,而且应用程序仍在工作,那么重新启动服务器是非常明智的。如果不这样做,也不测试集群(例如,一次重启一个节点),可能意味着在第一次重启或HA事件中出现灾难。
*The End*