这是本文档旧的修订版!
ATK/VNL能正常运行的关键是运行atkpython程序的主机(RS)能够访问license server(LS)主机的6200端口,并且在计算过程中LS主机需要一直保持运行。因此要选择合适的主机安装运行license server服务:
选定LS主机之后,即可获取该主机的任一以太网卡的MAC地址,用于申请license。
VNL-ATK的License 必须绑定一台主机,因此在制作license时需要提供安装主机的HOSTID(即一个可用的网卡MAC地址)。针对不同的操作系统,获取的方式有以下几种:
lmxendutil -hostid
,会显示主机所有网络设备信息,即为HOSTID。可以使用lmxendutil -hostid > hostid.txt
生成hostid.txt文本文件。ifconfig
,同样显示所有网络设备的详细信息,即为HOSTID。可以使用ifconfig > hostid.txt
生成hostid.txt文本文件。ipconfig /all
同样显示网络设备信息,即为HOSTID。注意使用固定的有线网络“以太网适配器”的物理地址作为HOSTID。VNL-ATK 的license与主机某一以太网卡的MAC地址(即物理地址)绑定。网卡MAC地址是网卡联网时的唯一识别标识。
chmod +x LMXTools-v4.6.5-for-VNL-ATK-2014-Linux64.bin
,之后执行该文件./LMXTools-v4.6.5-for-VNL-ATK-2014-Linux64.bin
,即完成安装。/path/to/servertools/lmx_serv -b -l /path/to/licensefile.lic -c /path/to/servertools/lmx-serv.cfg -lf /var/log/lmxserver.log
或
/path/to/lmx_serv -b -l /path/to/licensefile.lic -c /path/to/servertools/lmx-serv.cfg -lf /var/log/lmxserver.log
注意:以上的文件路径需要替换为实际的路径。 其中:
licensefile.lic
是获得的浮动license;lmx-serv.cfg
是控制license server行为的配置文件;(详细信息见本文最后一节)lmxserver.log
文件是license server运行日志文件,指定日志文件有助于查找排除故障。如果用户有主机的超级用户权限,可以将以上命令写入/etc/rc.local(对CentOS和RedHat系统而言,其他系统略有差别),这样license server即可随主机开机启动。
lmxendutil -licstat
将网络上所有可及的6200端口上是否有License服务;lmxendutil -licstat -host 【服务器主机名或IP】
pidof lmx-serv
ps -ef | grep lmx
(结果中的lmx-serv一行)kill 进程号
/path/to/lmx-serv -b -l /path/to/license.lic
lmx-enduser-tools_v4.7.5_win64_x64.msi
文件,并按如下截图操作。license 服务默认license服务安装位置为:C:\Program Files\X-Formation\LM-X End-user Tools 4.8.7 x64。进入该安装位置,双击运行LicserverClient.jar(需Java环境支持)。
登录管理页面需要输入license server的管理员密码(用户名默认为admin),管理员的初始密码是“MyPassword123”(不含引号)。
License配置文件可以在License Server安装目录下的servertools/lmx-serv.cfg直接用文本编辑器打开,也可以在管理页面上访问: 用户可以通过编辑License Server安装目录下的servertools/lmx-serv.cfg文件控制license server的行为。
LMX license server支持灵活的配置以限制license server的使用和license的借用,详见下面示例。
# LM-X License server sample configuration file # Copyright (C) X-Formation. All rights reserved. # http://www.x-formation.com #************************************************* # lmx-serv.cfg notes: # # 1) #开头的行不执行 # 2) 用户名,主机名等区分大小写,尽量在模板基础上修改 # 3) 允许获取license的客户端通过用户名 (USER), # 计算机名(HOST)或IP地址区分 (IPADDR) #************************************************* #************************************************* # License Server使用的TCP/UDP端口. #************************************************* TCP_LISTEN_PORT = 6200 #************************************************* # 限制License Server发放license的IP地址. # 如果主机有多个网卡和IP,用户可以为IPv4和IPv6各指定一个IP地址。 # 格式 TCP_BIND_ADDRESS = <IPv4_address IPv6_address> # 例: # 集群的管理节点通常有内网eth0(IP:192.168.1.100)和 # 外网eth1(IP:202.110.100.100),如果用户只希望在集群内部使用ATK,则: # TCP_BIND_ADDRESS = 192.168.1.100 8000:8000:8000:8000:abcd:1234:12df:fd54 #************************************************* # 指定 license server 的日志文件路径(需要足够写权限) #************************************************* # 例: # LOG_FILE = c:\program files\lmx-server.log # LOG_FILE = /home/user1/lmx-serv.log #************************************************* # 日志文件的详细度 # NORMAL, EXTENDED # NORMAL:日常日志 # EXTENDED:用于调试 #************************************************* # Examples: LOG_FORMAT = NORMAL #************************************************* # 设置license文件位置。 # 用户也可以在启动license server用“-l”指定license文件位置。 #************************************************* # 例: # LICENSE_FILE = d:\server\network.lic # LICENSE_FILE = /home/user1/qw_license.lic #************************************************* # 远程管理license server的密码 #************************************************* REMOTE_ACCESS_PASSWORD = MyPassword123 #************************************************* # 允许、拒绝访问license server. # - 所有规则按顺序匹配 # - 如果没有匹配的规则,则被允许 # - 对于ALLOW_IPADDR_* and DENY_HOST_* 可以用 IPv4 and IPv6地址,也可以都设置 # - IP网段可以使用通配符* # Syntax: # ALLOW_IPADDR_ALL = <one or more IP addresses> # ALLOW_IPADDR_<feature name> = <one or more IP addresses> # DENY_IPADDR_ALL = <one or more IP addresses> # DENY_IPADDR_<feature name> = <one or more IP addresses> # ALLOW_HOST_ALL = <one or more hostnames or "localhost" for current machine> # ALLOW_HOST_<feature name> = <one or more hostnames or "localhost" for current machine> # DENY_HOST_ALL = <one or more hostnames or "localhost" for current machine> # DENY_HOST_<feature name> = <one or more hostnames or "localhost" for current machine> # ALLOW_USER_ALL = <one or more users> # ALLOW_USER_<feature name> = <one or more users> # DENY_USER_ALL = <one or more users> # DENY_USER_<feature name> = <one or more users> # #************************************************* # 例 1: # ALLOW_IPADDR_ALL = 192.168.1.* 192.168.2.* # ALLOW_USER_ALL = Administrator root # DENY_IPADDR_ALL = *.*.*.* # 这三行设置只允许来自192.168.1.* 和192.168.2.* 的 # 用户名为Administrator和root的访问license请求。其他所有访问都被拒绝。 # 所有功能都一样(ALL) #************************************************* # 允许、拒绝借用license # # Syntax: # ALLOW_BORROW_IPADDR_ALL = <one or more hosts> # ALLOW_BORROW_IPADDR_<feature name> = <one or more hosts> # DENY_BORROW_IPADDR_ALL = <one or more hosts> # DENY_BORROW_IPADDR_<feature name> = <one or more hosts> # ALLOW_BORROW_HOST_ALL = <one or more hosts> # ALLOW_BORROW_HOST_<feature name> = <one or more hosts> # DENY_BORROW_HOST_ALL = <one or more hosts> # DENY_BORROW_HOST_<feature name> = <one or more hosts> # ALLOW_BORROW_USER_ALL = <one or more users> # ALLOW_BORROW_USER_<feature name> = <one or more users> # DENY_BORROW_USER_ALL = <one or more users> # DENY_BORROW_USER_<feature name> = <one or more users> #************************************************* # 例 1:只允许daisy harry tom三个借用所有的license,IP不限,主机名 # ALLOW_BORROW_USER_ALL = daisy harry tom # DENY_BORROW_HOST_ALL = server1 machine5 # DENY_BORROW_IPADDR_ALL = 192.168.3.* 192.168.4.* # 例 2:只允许lazyjack rabbit joeuser三个用户获取 atkmaster license # ALLOW_BORROW_USER_atkmaster = lazyjack rabbit joeuser # DENY_BORROW_IPADDR_atkmaster = *.*.*.* #************************************************* # 限制用户或IP可以借用的license个数 # 格式: # LIMIT_USER_<feature name>_<limit count> = <one or more users> # LIMIT_HOST_<feature name>_<limit count> = <one or more hosts> # LIMIT_IPADDR_<feature name>_<limit count> = <one or more hosts> # (Host must be specified completely A.B.C.D or with wildcards A.*.B.*) # # Limiting of users is done by a first match rule, so if a user # belongs to more than one group specified in restrictions, the first # restriction will apply to that user. #************************************************* # 例: 限制三个用户获取至多1个atkmaster;限制两个IP段至多获取1个atkmaster # LIMIT_USER_atkmaster_1 = harry joe sam # LIMIT_IPADDR_atkmaster_1 = 192.168.2.* 192.168.4.* #************************************************* # 为用户或IP保留license数目 # # 格式: # RESERVE_USER_<feature name>_<reserve count> = <one or more users> # RESERVE_HOST_<feature name>_<reserve count> = <one or more hosts> # RESERVE_IPADDR_<feature name>_<reserve count> = <one or more hosts> # (Host must be specified completely A.B.C.D or with wildcards A.*.B.*) # #************************************************* # 例: 为三个用户保留1个master;为两个IP段的保留1个master # RESERVE_USER_atkmaster_1 = harry joe sam # RESERVE_IPADDR_atkmaster_1 = 192.168.2.* 192.168.4.* #************************************************* # Limit the number of licenses that can be borrowed to prevent # all licenses from being borrowed at the same time. # # Syntax: # BORROW_LIMIT_COUNT_ALL = <limit count> # BORROW_LIMIT_COUNT_<feature name> = <limit count> #************************************************* # Example: # BORROW_LIMIT_COUNT_f2 = 1 # BORROW_LIMIT_COUNT_ABCDEF = 5 #************************************************* # Limit the number of hours licenses can be borrowed # to prevent licenses from being borrowed for too long. # # Syntax: # BORROW_LIMIT_HOURS_ALL = <limit hours> # BORROW_LIMIT_HOURS_<feature name> = <limit hours> #************************************************* # Example: # BORROW_LIMIT_HOURS_f2 = 1 # BORROW_LIMIT_HOURS_ABCDEF = 5 #************************************************* # Specify how often to rotate the log file. # Valid values are "day," "week," or "month." # The log file rotation occurs at midnight for any of these settings. # Setting this to any value other than those given above disables log file rotation. # # Syntax: # LOGFILE_ROTATE_INTERVAL = <rotation_interval> #************************************************* # Example: # LOGFILE_ROTATE_INTERVAL = day #************************************************* # Specify licenses directly within the configuration file. # # You can specify any features from one or more license files in # this section of the configuration file to eliminate the need for # both a license file and configuration file for the license server. # The content must be specified within the __START_LICENSE__ # and __END_LICENSE__ clauses. __START_LICENSE__ # Example: # # FEATURE f1 # { # VENDOR = XYZ # ... # } __END_LICENSE__ #*************************************************