This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
在 Amazon Web Services (AWS) 上安装 Citrix ADM 代理
Citrix Application Delivery Management (Citrix ADM) 代理可充当 Citrix ADM 与数据中心或云中发现的实例之间的中介。
必备条件
要使用 Amazon GUI 在 Amazon Web Services (AWS) 虚拟私有云 (VPC) 中启动 Citrix ADM 代理 AMI,您需要:
-
AWS 帐户
-
AWS 虚拟专用云 (VPC)
-
IAM 帐户
注意
在置备 ADM 代理虚拟机之前,Citrix 建议创建安全组、虚拟专用网络、密钥对、子网和其他实体。因此,在预配过程中可以使用网络信息。
要使 Citrix ADM 代理与 Citrix ADM 和 Citrix ADC 实例进行通信,请确保建议的端口处于打开状态。有关 Citrix ADM 代理端口要求的完整详细信息,请参阅 端口。
要在 AWS 上安装 Citrix ADM 代理,请执行以下操作:
-
使用 AWS 凭证登录到 AWS Marketplace。
-
在搜索字段中,键入 Citrix ADM 代理 以搜索 Citrix ADM 代理 AMI,然后单击 转到 。
-
在搜索结果页面上,单击可用列表中的 ADM 外部代理 AMI 。
-
在 ADM 外部代理 AMI 页面上,单击 继续订阅 。
-
订阅成功后,单击 继续配置。
-
在 配置此软件 页面上:
-
从 “ 配送” 选项列表中选 择 AMI。
-
从 “软件版本” 列表中选择最新的 Citrix ADM 代理 版本 。
-
从区域列表中选择您的 区域 。
-
点击 继续启动
-
-
在 启动此软件 页面上,您有两个选项可以注册 Citrix ADM 代理:
-
从网站启动
-
使用 EC2 启动
-
从网站启动
要从网站启动,请选择:
-
EC2 实例类型列表中的 EC2 实例类型
-
VPC 设 置列表中的 VPC 。单击 在 EC2 中创建 VPC ,为您的软件创建 VPC。
-
子网 设置列表中的子网 。在您选 择 VPC 后,单击在 EC2 中创建子网以创建子网。
-
安全组设 置列表中的防火墙安全组 。单击 基于卖家设置创建新 建以创建安全组。
-
用于确保 “密钥对 设置” 列表中的访问安全性的密钥对 。单击 EC2 中的创建密钥对 ,为您的软件创建密钥对。
-
点击 启动
-
从网站启动成功。
注意
部署过程可能需要大约 10-15 分钟。部署成功完成后,您可以在 AWS 账户上查看 Citrix ADM 代理虚拟机。
-
部署代理后,为 Citrix ADM 代理分配名称。
-
代理启动并运行后,请为 Citrix ADM 代理分配弹性 IP 地址。
注意
弹性 IP 地址使 Citrix ADM 代理能够与 Citrix ADM 通信。但是,如果已将 NAT Gateway 配置为将流量路由到 Internet,则可能不需要弹性 IP 地址。
-
使用 SSH 客户端,使用公有 IP 地址登录到 Citrix ADM 代理。
注意:
您可以使用以下方法之一登录到 Citrix ADM 代理:
-
用
nsrecover
作用户名和 AWS 实例 ID 作为密码。 -
用
nsroot
作用户名和有效的密钥对作为密码。
-
-
输入以下命令以调用部署屏幕: 部署类型 .py
-
按照中的说明在 Citrix ADM 中的 设置代理 页面中输入复制和保存的 服务 URL 和激活代码入门 。代理使用服务 URL 查找服务,并使用激活代码向服务注册。
代理注册成功后,代理重新启动以完成安装过程。
代理重新启动后,访问 Citrix ADM,然后在 设置代理 页面的 “已 发现代 理” 下,验证代理的状态。
使用 EC2 启动
要使用 EC2 启动,请从选择操作列表中 选择通过 EC2启动 ,然后单击 启 动。
-
在 选择实例类型 页面上,选择实例,然后单击 下一步:配置实例详细信息。
-
在 配置实例详细信息 页面上,指定所需的参数。
在 “ 高级详细信息 ” 部分下,您可以通过在 用户数据字段中指定身份验证详细信息或脚本来启用 零接触代理。
-
身份验证详细信息 - 按照 入门 中的说明,指定从 Citrix ADM 的设置代理页面复制的服务 URL 和激活码。请按以下格式输入详细信息。
registeragent -serviceurl <apigatewayurl> -activationcode <activationcodevalue> <!--NeedCopy-->
Agent 在启动期间使用此信息向 ADM 服务自动注册。
-
脚本 -将代理自动注册脚本指定为用户数据。以下是示例脚本:
#!/var/python/bin/python2.7 import os import requests import json import time import re import logging import logging.handlers import boto3 ''' Overview of the Script: The script helps to register an ADM agent with ADM. Pass it in userdata to make ADM agent in AWS to autoregister on bootup. The workflow is as follows 1) Fetch the ADM service API credentials (ID and secret) from AWS secret store (NOTE: you have to assign IAM role to the ADM Agent that will give permission to fetch secrets from AWS secret store) 2) Login to ADM service with credentials fetched in step 1 3) Call ADM service to fetch credentials (serviceURL and token) for agent registration 4) Calls registration by using the credentials fetched in step 3 ''' ''' These are the placeholders which you need to replace according to your setup configurations aws_secret_id: Id of the AWS secret where you have stored ADM Credentials The secrets value should be in the following json format { "adm_user_id_key": "YOUR_ID", " adm_user_secret_key": "YOUR_SECRET"} ''' aws_secret_id = "<AWS_secret_id>" adm_ip_or_hostname = "<YOUR_ADM_POP>.adm.cloud.com" ''' Set up a specific logger with your desired output level and log file name ''' log_file_name_local = os.path.basename(\_\_file\_\_) LOG_FILENAME = '/var/log/' + 'bootstrap' + '.log' LOG_MAX_BYTE = 50\*1024\*1024 LOG_BACKUP_COUNT = 20 logger = logging.getLogger(\_\_name\_\_) logger.setLevel(logging.DEBUG) logger_handler = logging.handlers.RotatingFileHandler(LOG_FILENAME, maxBytes=LOG_MAX_BYTE, backupCount=LOG_BACKUP_COUNT) logger_fortmater = logging.Formatter(fmt='%(asctime)-2s:%(funcName)30s:%(lineno)4d: [%(levelname)s] %(message)s', datefmt="%Y-%m-%d %H:%M:%S") logger_handler.setFormatter(logger_fortmater) logger.addHandler(logger_handler) class APIHandlerException(Exception): def \_\_init\_\_(self, error_code, message): self.error_code = error_code self.message = message def \_\_str\_\_(self): return self.message + ". Error code '" + str(self.error_code) + "'" def parse_response(response, url, print_response=True): if not response.ok: if "reboot" in url: logger.debug('No response for url: reboot') resp = {"errorcode": "500", "message": "Error while reading response."} return resp if print_response: logger.debug('Response text for %s is %s' % (url, response.text)) response = json.loads(response.text) logger.debug("ErrorCode - " + str(response['errorcode']) + ". Message -" + str(response['message'])) raise APIHandlerException(response['errorcode'], str(response['message'])) elif response.text: if print_response: logger.debug('Response text for %s is %s' % (url, response.text)) result = json.loads(response.text) if 'errorcode' in result and result['errorcode'] > 0: raise APIHandlerException(result['errorcode'], str(result['message'])) return result def _request(method, url, data=None, headers=None, retry=3, print_response=True): try: response = requests.request(method, url, data=data, headers=headers) result = parse_response(response, url, print_response=print_response) return result except [requests.exceptions.ConnectionError, requests.exceptions.ConnectTimeout]: if retry > 0: return _request(method, url, data, headers, retry-1, print_response=print_response) else: raise APIHandlerException(503, 'ConnectionError') except requests.exceptions.RequestException as e: logger.debug(str(e)) raise APIHandlerException(500, str(e)) except APIHandlerException as e: logger.debug("URL: %s, Error: %s, Message: %s" % (url, e.error_code, e.message)) raise e except Exception as e: raise APIHandlerException(500, str(e)) try: '''Get the AWS Region''' client = boto3.client('s3') my_region = client.meta.region_name logger.debug("The rgion is %s" % (my_region)) '''Creating a Boto cleint session''' session = boto3.session.Session() client = session.client( service_name='secretsmanager', region_name=my_region ) '''Getting the values stored in the secret with id: <aws_secret_id>''' get_id_value_response = client.get_secret_value( SecretId = aws_secret_id ) adm_user_id = json.loads(get_id_value_response["SecretString"])["adm_user_id_key"] adm_user_secret = json.loads(get_id_value_response["SecretString"])["adm_user_secret_key"] except Exception as e: logger.debug("Fetching of ADM credentials from AWS secret failed with error: %s" % (str(e))) raise e ''' Initializing common ADM API handlers ''' mas_common_headers = { 'Content-Type': "application/json", 'Accept-type': "application/json", 'Connection': "keep-alive", 'isCloud': "true" } ''' API to login to the ADM and fetch the Session ID and Tenant ID ''' url = "https://" + str(adm_ip_or_hostname) + "/nitro/v1/config/login" payload = 'object={"login":{"ID":"' + adm_user_id + '","Secret":"' + adm_user_secret + '"}}' try: response = _request("POST", url, data=payload, headers=mas_common_headers) sessionid = response["login"][0]["sessionid"] tenant_id = response["login"][0]["tenant_name"] except Exception as e: logger.debug("Login call to the ADM failed with error: %s" % (str(e))) raise e ''' API to fetch the service URL and Token to be used for registering the agent with the ADM ''' mas_common_headers['Cookie'] = 'SESSID=' + str(sessionid) url = "https://" + str(adm_ip_or_hostname) + "/nitro/v1/config/trust_preauthtoken/" + tenant_id +"?customer="+ tenant_id logger.debug("Fetching Service URL and Token.") try: response = _request("GET", url, data=None, headers=mas_common_headers) service_name = response["trust_preauthtoken"][0]["service_name"] token = response["trust_preauthtoken"][0]["token"] api_gateway_url = response["trust_preauthtoken"][0]["api_gateway_url"] except Exception as e: logger.debug("Fetching of the Service URL Passed with error. %s" % (str(e))) raise e ''' Running the register agent command using the values we retrieved earlier ''' try: registeragent_command = "registeragent -serviceurl "+api_gateway_url+" -activationcode "+service_name+";"+token file_run_command = "/var/python/bin/python2.7 /mps/register_agent_cloud.py "+registeragent_command logger.debug("Executing registeragent command: %s" % (file_run_command)) os.system(file_run_command) except Exception as e: logger.debug("Agent Registeration failed with error: %s" % (str(e))) raise e <!--NeedCopy-->
此脚本从 AWS secret 管理器获取身份验证详细信息,然后运行
deployment.py
脚本以将代理注册到 ADM 服务。
注意
虽然您可以自动分配公有 IP 地址,但也可以分配弹性 IP 地址。如果未配置 NAT Gateway,则需要分配弹性 IP 地址。
如果此步骤中未设置弹性 IP 地址,您仍然可以在 EC2 控制台上进行设置。您可以创建一个新的弹性 IP 地址,然后使用实例 ID 或 ENI-ID 将其与 ADM Agent 关联。
单击 添加存储空间。
-
-
在 添加存储 页面上,配置实例的存储设备设置,然后单击 下一步:添加标签。
-
在 添加标签 页面上,定义实例的标签,然后单击 下一步:配置安全组。
-
在 配置安全组 页面上,添加允许特定流量进入实例的规则,然后单击 查看并启动。
-
在 查看实例启动 页面上,查看实例设置,然后单击 启动。
-
在 选择现有密钥对或创建新密钥对对 话框中,创建密钥对。您还可以从现有密钥对中进行选择。
接受确认,然后单击 启动实例。
部署过程可能需要大约 10-15 分钟。部署成功完成后,您可以在 AWS 账户上查看 Citrix ADM 代理虚拟机。
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select Do Not Agree to exit.