)
前言TongWeb 安装后命令行管理用户 cli 的初始密码为 cli123.com且首次使用必须修改否则无法执行其它命令。同时控制台默认仅允许本机浏览器访问若本机无浏览器可通过 update-console-remote-access 命令在命令行直接开启远程访问、并一并修改 thanos / security / auditor / monitor 等默认账号密码。本文记录两件事1.什么是域。2.本域默认TongWeb改 cli 密码 → 批量改其他默认账号密码并开远程。3.新建域twdomains2管理端口 9062同样流程注意指定 --port一般新建的域都有自己的管理端口在域的conf目录下的tongweb.xml里配置例如顺延着本域的9061。什么是域域分为两类相对域创建在物理 ${TongWeb_HOME}/domains 下路径变化后无需修改仍可用和绝对域指定绝对路径保存物理路径变化后需手动更新脚本。物理 TongWeb 提供创建域的脚本需在 ${TongWeb_HOME}/bin 目录下执行创建相对域以 Linux 为例创建名为 tw_domain_1 的域./domain.sh create tw_domain_1创建后在 ${TongWeb_HOME}/domains 下生成同名目录即一个逻辑 TongWeb 服务器。创建绝对域指定绝对路径 /opt/tw_domain_1./domain.sh create /opt/tw_domain_1#如需指定管理端口和应用端口可以执行下面这段./domain.sh create /opt/tw_domain_1managePort9066appPort8888备注1.启动的话可以cd到域的安装目录的bin下执行./startserverbg.sh。2.同理停止的话可以执行./forstopserver.sh 。3.创建的域不要随意改动路径如果升级版本之前域改了路径很有可能导致升级版本失败。一般域的路径记录在conf的domains.list里如下图所示本域操作用 password.sh 生成密文并写 passwordfile[rootlocalhost bin]# sh password.sh cli123.comencryptcli123.com:_TSM_hxxkxyyQ5o9TmfEwshHrQ[rootlocalhost bin]# echo AS_ADMIN_password_TSM_hxxkxyyQ5o9TmfEwshHrQ passwordfile说明passwordfile 文件属性名必须是 AS_ADMIN_password密文必须在目标 ${TongWeb_HOME}/bin 目录下生成否则解密会失败。修改 cli 密码[rootlocalhost bin]# ./commandstool.sh change-admin-password \--interactivefalse\--usercli\--newpasswordYeyehuo163.com\--passwordfilepasswordfile\cli看到提示为“Command change-admin-password executed successfully.”就说明操作成功。同步新密码到 passwordfile[rootlocalhost bin]# sh password.sh Yeyehuo163.comencryptYeyehuo163.com:_TSM_iTNyZRaYZ2iCzfN4BQNq9g[rootlocalhost bin]# echo AS_ADMIN_password_TSM_iTNyZRaYZ2iCzfN4BQNq9g passwordfile批量改其他默认账号密码并开启本域远程访问[rootlocalhost bin]# ./commandstool.sh update-console-remote-access \--interactivefalse\--usercli\--passwordfilepasswordfile\--thanosPasswordTongWeb135.com\--securityPasswordTongWeb135.com\--auditorPasswordTongWeb135.com\--monitorPasswordTongWeb135.com\remote看到下面的提示说明修改成功************************ Console accesstypeissetto: remote Password update summary - updated users:[thanos, security, auditor, monitor], ignoredusers(already changed before):[none]. ************************ Command update-console-remote-access executed successfully.新建域操作为新域 cli 配置 passwordfile 并改密码[rootlocalhost bin]# sh password.sh cli123.comencryptcli123.com:_TSM_hxxkxyyQ5o9TmfEwshHrQ[rootlocalhost bin]# echo AS_ADMIN_password_TSM_hxxkxyyQ5o9TmfEwshHrQ passwordfiledomains2[rootlocalhost bin]# ./commandstool.sh change-admin-password \--interactivefalse\--usercli\--newpasswordYeyehuo163.com\--passwordfilepasswordfiledomains2\--port9062\cli Command change-admin-password executed successfully.备注9062是新建域的管理端口可在创建域的时候指定并在域的conf的tongweb.xml里显示。同步 cli 新密码到 passwordfiledomains2[rootlocalhost bin]# sh password.sh Yeyehuo163.comencryptYeyehuo163.com:_TSM_iTNyZRaYZ2iCzfN4BQNq9g[rootlocalhost bin]# echo AS_ADMIN_password_TSM_iTNyZRaYZ2iCzfN4BQNq9g passwordfiledomains2备注由于本域已经配置了passwordfile为了避免覆盖本域的passwordfile需重新创建一个passwordfile给新建域也就是指令里的passwordfiledomains2其实就是passwordfileedomain2组合而成这个后面要用到。新域批量改默认账号密码并开远程带 --port9062[rootlocalhost bin]# ./commandstool.sh update-console-remote-access \--interactivefalse\--usercli\--passwordfilepasswordfiledomains2\--thanosPasswordTongWeb135.com\--securityPasswordTongWeb135.com\--auditorPasswordTongWeb135.com\--monitorPasswordTongWeb135.com\--port9062\remote