AppNode受控端命令 - AppNode帮助中心

受控端命令

核心命令

在命令行中输入 appnode agent,可查看所有核心命令:

# appnode agent
NAME:
   appnode-agent - appnode agent command line tools

USAGE:
   appnode-agent  command [command options] [arguments...]

AUTHOR(S):
   AppNode Dev Team <develop@appnode.com> 

COMMANDS:
     status   status agent
     start    start agent
     stop     stop agent
     restart  restart agent
     config   config agent
     remove   remove agent
     license  license management

受控端服务管理

查看受控端运行状态

appnode agent status

示例(CentOS 6下):

# appnode agent status
appnode-agent-server (pid  2145) is running...

启动受控端

appnode agent start

示例(CentOS 6下):

# appnode agent start
Starting AppNode Agent:                                    [  OK  ]

停止受控端

appnode agent stop

示例(CentOS 6下):

# appnode agent stop
Stopping AppNode Agent:                                    [  OK  ]

重启受控端

appnode agent restart

示例(CentOS 6下):

# appnode agent restart
Stopping AppNode Agent:                                    [  OK  ]
Starting AppNode Agent:                                    [  OK  ]

受控端配置

查看受控端的所有配置

appnode agent config

示例:

# appnode agent config
agent_network         : tcp
agent_ip_addr         : 0.0.0.0
agent_port            : 9999
agent_protocol        : http
agent_domain_name     : 
agent_tls_cert        : <not set="">
agent_tls_key         : <not set="">
agent_sign_key        : ExRXPjabfcnrnTxHw2wa4rR830gPz542

各个参数的含义:

  • agent_network
    受控端网络类型,为 tcp(TCP连接)或 unix(本地 Unix Domain Socket)
  • agent_ip_addr
    受控端监听的 IP 地址,* 或 0.0.0.0 表示全部。
    IP 地址必须为本地网卡中存在的 IP 地址。
  • agent_port
    受控端监听的 TCP 端口,范围为:1~65535。
  • agent_protocol
    受控端使用的协议,为 http 或 https。
  • agent_domain_name
    受控端绑定的域名,绑定域名后只能通过绑定的域名访问受控端。
  • agent_tls_cert
    受控端 SSL 证书文件路径。
    受控端使用的协议为 https 时才有效。
  • agent_tls_key
    受控端 SSL 密钥文件路径。
    受控端使用的协议为 https 时才有效。
  • agent_sign_key
    受控端 API 签名密钥。
    请勿设置为空,否则你的服务器将可能会攻击。

查看受控端的单个配置

appnode agent config 配置项

示例,查看监听的端口:

# appnode agent config agent_port
agent_port            : 9999

修改受控端配置

appnode agent config 配置项 配置值

示例,修改绑定的域名为:1.node.appnode.com:

# appnode agent config agent_domain_name 1.node.appnode.com
# appnode agent config
agent_network         : tcp
agent_ip_addr         : 0.0.0.0
agent_port            : 9999
agent_protocol        : http
agent_domain_name     : 1.node.appnode.com
agent_tls_cert        : <not set="">
agent_tls_key         : <not set="">
agent_sign_key        : ExRXPjabfcnrnTxHw2wa4rR830gPz542

示例,取消域名绑定:

# appnode agent config agent_domain_name ""
# appnode agent config
agent_network         : tcp
agent_ip_addr         : 0.0.0.0
agent_port            : 9999
agent_protocol        : http
agent_domain_name     : 
agent_tls_cert        : <not set="">
agent_tls_key         : <not set="">
agent_sign_key        : ExRXPjabfcnrnTxHw2wa4rR830gPz542

序列号授权管理

在命令行中输入 appnode agent license,可查看所有授权管理命令(和控制中心一样):

# appnode agent license  
NAME:
   appnode-agent license - license management

USAGE:
   appnode-agent license command [command options] [arguments...]

COMMANDS:
     list    show license list
     issue   issue a new license
     update  update all license
     delete  delete a license
     bindip  set or show bind ip address
     mac     get MAC of current machine

OPTIONS:
   --help, -h  show help

显示所有序列号授权

appnode agent license list

示例:

# appnode agent license list

-------- LICENSE LIST --------

SN   : agent-free
PCODE: agent-free
PNAME: 受控端免费版 通用型
IP   : 115.29.*.*
FLG  : agent,filemgr,service,usermgr,procmgr,crond,service,scriptmgr,logmgr,iptables,backupmgr
TTL  : 604800
NUP  : 2016-09-28 12:27:45 CST
EXP  : 2016-10-04 12:27:45 CST
END  : 2106-02-07 14:28:15 CST
PMN  : Y
MAC  : 6a82113d1767e6f1116352df9e9f0f7731cb102a52204088dcc1566a75ae9044
STA  : ACTIVE

SN   : T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8
PCODE: agent-standard
PNAME: 受控端标准版 通用型
IP   : 115.29.*.*
FLG  : nginx,mysqld,php,sshd,storage,rsync,rsyncd,sysmonitor,pptpd,pureftpd,shadowsocks,memcached,smbd,redis,51sync
TTL  : 604800
NUP  : 2016-09-28 12:27:45 CST
EXP  : 2016-10-04 12:27:45 CST
END  : 2017-09-23 20:53:08 CST
PMN  : N
MAC  : 6a82113d1767e6f1116352df9e9f0f7731cb102a52204088dcc1566a75ae9044
STA  : ACTIVE

各个参数的含义:

  • SN:序列号
  • PCODE:产品代号
  • PNAME:产品名称
  • IP:授权使用的公网 IP 地址
  • FLG:可以使用的应用代号列表
  • TTL:每次更新的授权文件的过期时间
  • NUP:下次授权更新时间
  • EXP:本次授权到期时间
  • END:授权最终到期时间
  • PMN:是否终身有效
  • MAC:机器码
  • STA:授权状态

激活序列号

appnode agent license issue 序列号

示例:

# appnode agent license issue T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8

-------- ISSUE SUCCESSFULLY --------

SN   : T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8
PCODE: agent-standard
PNAME: 受控端标准版 通用型
IP   : 115.29.175.190
FLG  : nginx,mysqld,php,sshd,storage,rsync,rsyncd,sysmonitor,pptpd,pureftpd,shadowsocks,memcached,smbd,redis,51sync
TTL  : 604800
NUP  : 2016-09-28 15:14:14 CST
EXP  : 2016-10-04 15:14:14 CST
END  : 2017-09-23 20:53:08 CST
PMN  : N
MAC  : 6a82113d1767e6f1116352df9e9f0f7731cb102a52204088dcc1566a75ae9044
STA  : ACTIVE

更新授权

更新所有序列号的授权:

appnode agent license update

示例:

# appnode agent license update

updating agent-free: OK
updating T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8: OK

更新单个序列号的授权:

appnode agent license update 序列号

示例:

# appnode agent license update T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8

updating T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8: OK

删除授权

appnode agent license delete 序列号

示例:

# appnode agent license delete T*6FV-W*0VH-F*XVD-H*FPO-Q*PG8
# appnode agent license list

-------- LICENSE LIST --------

SN   : agent-free
PCODE: agent-free
PNAME: 受控端免费版 通用型
IP   : 115.29.*.*
FLG  : agent,filemgr,service,usermgr,procmgr,crond,service,scriptmgr,logmgr,iptables,backupmgr
TTL  : 604800
NUP  : 2016-09-28 15:15:11 CST
EXP  : 2016-10-04 15:15:11 CST
END  : 2106-02-07 14:28:15 CST
PMN  : Y
MAC  : 6a82113d1767e6f1116352df9e9f0f7731cb102a52204088dcc1566a75ae9044
STA  : ACTIVE

绑定授权 IP

如果你的服务器有多个公网 IP,需要在激活序列号前,先指定使用哪个公网 IP 进行授权,否则可能导致以下两个问题:

在激活序列号时可能会随机选用一个公网 IP 进行授权
在验证授权时可能会随机选用一个公网 IP 进行验证,造成授权验证失败

查看:

appnode agent license bindip

示例:

# appnode agent license bindip
BIND IP: 

上例中输出的绑定 IP 为空,表示未绑定 IP。

修改:

appnode ccenter license bindip IP地址

示例:

# appnode agent license bindip 115.29.*.*
# appnode agent license bindip
BIND IP: 115.29.*.*

请注意:此处 IP 地址必须为你的服务器网卡上存在的 IP 地址,可在受控端的“系统信息”-“网络信息”中查看。

查看机器码

appnode agent license mac

示例:

# appnode agent license mac
MAC: 6a82113d1767e6f1116352df9e9f0f7731cb102a52204088dcc1566a75ae9044

卸载

卸载受控端

appnode agent remove

示例:

# appnode agent remove

>> Preparing to remove AppNode Agent...

* Are you sure want to remove AppNode Agent? [y/N] y

......

输入卸载命令后,会提醒你是否确认卸载,请输入 y 后再再回车确认卸载。

来自:https://help.appnode.com/command/agent.html 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值