#topicpath ----- #contents *How to restart COSMOS [#aa835fe1] **script [#h3d0a9d7] #pre{{ ${COSMOS3}/aste/nro/sbin/cos3_cntl [start|stop|restart] [all|ssh] [start|stop|restart] start : start stop : stop restart : restart (stop, then start) [all|ssh] all : COSMOS3 on all control computers at the ASTE site (for ASTE) ssh : COSMOS3 on a local computer and site connections (for remote sites) (not specified) : COSMOS3 on a local computer (for all sites) }} **example [#x40baef9] ***ASTE site [#ke876406] -restart of COSMOS3 on all control computers at the ASTE site (asteobs@aste-1s) #pre{{ /opt/sudo/bin/sudo /cosmos3/aste/nro/sbin/cos3_cntl restart all }} -restart of COSMOS3 on a local computer(asteobs@aste-xx) #pre{{ /opt/sudo/bin/sudo /cosmos3/aste/nro/sbin/cos3_cntl restart }} -If you want to start or stop only, please change "restart" to "start" or "stop", respectively. ***SPdA, MTK, NRO [#f48511ec] -restart of COSMOS3 (asteobs@aste-[at3|mt2|w]) #pre{{ /opt/sudo/bin/sudo ${COSMOS3}/aste/nro/sbin/cos3_cntl restart }} -restart of COSMOS3 and site connections (asteobs@aste-[at3|mt2|w]) #pre{{ /opt/sudo/bin/sudo ${COSMOS3}/aste/nro/sbin/cos3_cntl restart ssh }} -If you want to start or stop only, please change "restart" to "start" or "stop", respectively. *Backup [#k41dfe1a] -[[Backup>./Backup]] *Autolog [#n75c690a] -[[autolog>./autolog]] *etc [#i0b7c3aa] -[[etc>./etc]] * How to change cosmos routing [#wa408483] -aste-rt1の接続先をaste-w → aste-mt2に変更する場合の作業例 - 必要なもの: aste-rt1のroot権限、root@aste-rt1のrsa key -- rsa keyは /root/.ssh/id_rsa.pub か /.ssh/id_rsa.pub -- なければ作成 #pre{{ root@aste-rt1% ssh-keygen -t rsa ※パスフレーズは設定しないこと }} - 初めて使う接続ルートの場合は、下準備(STEP1, STEP2)が必要 - 既存のルートに切り替える場合(例えばaste-w経由に戻す場合)はSTEP3からでok。 ** step 1 : ssh接続の確認 [#e7a2d065] #pre{{ asteobs@aste-rt1% su root@aste-rt1% /opt/OpenSSH/bin/ssh -v sshcos3@aste-mt2 OpenSSH_4.5p1, OpenSSL 0.9.6c 21 dec 2001 debug1: Reading configuration data /etc/openssh/ssh_config debug1: Connecting to aste-mt2 [133.40.220.72] port 22. debug1: Connection established. (中略) debug1: Remote: Forced command: /home/cosmos3/aste/nro/sbin/dmsh debug1: Authentication succeeded (publickey). debug1: channel 0: new [client-session] debug1: Entering interactive session. }} - パスワードを聞かれることなく、上記の表示が出ればok。だんまりになって操作できない状態になるが、気にせずCTRL+C ** step 2 : 上記sshでパスワード入力を求められた場合、上流サイトにrsa keyを登録する [#me2a489b] #pre{{ asteos@aste-rt1% su root@aste-rt1% /opt/OpenSSH/bin/ssh sshcos3@aste-mt2 "cat >> .ssh/authorized_keys" < ~/.ssh/id_rsa.pub (パスワード入力) root@aste-rt1% /opt/OpenSSH/bin/ssh sshcos3@aste-mt2 }} - 今度はパスワード入力を求められることなく、aste-mt2にログインできるはず。aste-mt2側で、ポートフォワードを許可するための諸設定を行う。 #pre{{ sshcos3@aste-mt2% vi .ssh/authorized_keys (最終行を編集) 編集前: ssh-rsa ABAD...(略)...aaeJA= root@aste-ht1 編集後(改行なし): command="/home/cosmos3/aste/nro/sbin/dmsh",permitopen="aste-mt2:9303",permitopen="aste-mt2:9402", permitopen="aste-mt2:9412",permitopen="aste-mt2:9401",permitopen="aste-mt2:9103", permitopen="aste-mt2:9421",permitopen="localhost:55555",permitopen="localhost:8080", permitopen="localhost:3306",permitopen="aste-2c:22" ssh-rsa ABAD...(略)...aaeJA= root@aste-ht1 }} ** step3: aste-rt1のcosmos起動スクリプトの編集 [#fe38cdcf] #pre{{ asteobs@aste-rt1% su astecntl astecntl@aste-rt1% vi /home/cosmos3/aste/rc3.d/S98ssh_cosmos (スクリプト冒頭部を変更) 変更前: UPPER_SITE=aste-w ANT_SITE=${UPPER_SITE} (or ANT_SITE=aste-w) 変更後: UPPER_SITE=aste-mt2 ANT_SITE=${UPPER_SITE} (or ANT_SITE=aste-mt2) }} ** step3: aste-rt1のcosmos3再起動 [#p1a5d06f] #pre{{ asteobs@aste-rt1% sudo $COSMOS3/aste/nro/sbin/cos3_cntl stop asteobs@aste-rt1% sudo $COSMOS3/aste/nro/sbin/cos3_cntl start }} - 5分くらい待つと、再起動が完了("pget"コマンドがエラーにならなければok) -- 2014年現在、aste-rt1はID=7を使用しており、pgetの表示外となる。"pget16"で確認できる。[aste-comp 00579] - 設定が上手く行っているかどうかは、$COSMOS3/aste/log/4/messを監視していると判定できる。 -- sshコマンドのエラーや、"SSH_INFO_SERVER: SSH_INFO_SERVER: Command not found"などの表示が合った場合はrsaキー登録が上手く行っていない。 *[[COSMOSの動作解析]] [#j2008ebf]