RefBoxでログの再生のメモ

172.16.0.105のUbuntuでRefBoxを動かしてログを再生した場合のメモ.
rcll-get-started は,~/git/rcll-get-started にある前提.

cd ~/git/rcll-get-started
source setup.sh
rc_start

で,再生したいログに対して,rc_restore_game_reportsを実行.
今回は,ホームディレクトリ直下においてあるgame_report_2025-07-20_09_59_41.gz を対象とします.

rc_restore_game_reports ~/game_report_2025-07-20_09_59_41.gz 

rc_restore_game_reportsの中身は以下です.

function rc_restore_game_reports() {
  if [ -z "$1" ]; then
    echo "Please specify the archive to restore to the mongodb instance."
    return
  fi
  date=$(date +"%Y-%m-%d_%T")
  cp $1 $rcll_get_started_dir/compose_files/data/TMP_$date.gz
  command=$(echo mongorestore --gzip --archive=/data/db/TMP_$date.gz)
  docker exec mongodb $command
  rm $rcll_get_started_dir/compose_files/data/TMP_$date.gz
}

ん?

  cp $1 $rcll_get_started_dir/compose_files/data/TMP_$date.gz
  command=$(echo mongorestore --gzip --archive=/data/db/TMP_$date.gz)

compose_files/data の下にコピーしているのに対して,アーカイブの指定は
data/db の下になっている….
rc_dump_game_reports()の方では,

  command=$(echo mongodump -d rcll -c game_report --gzip --archive=/data/db/game_report_$date.gz)

となっていますので,これはcp の行が間違っていますね.
正しくは,以下です.

  cp $1 $rcll_get_started_dir/compose_files/data/db/TMP_$date.gz

で,今回は競技を実施する(Watch a game live)のではなくログの再生(Review a game report)なので,そのポート(8085)も手元からつながるようにします.

ssh 172.16.0.105 -L 1234:localhost:1234 -L 8080:localhost:8080 -L 8085:localhost:8085

で,その8085のサービスは,rc_start_mongodb_backend で起動します.

rc_start_mongodb_backend 

safariを開いて,localhost:8080 にアクセスし,「Review a game report」を選びます.
で,対象となるログを選べば,再生が始まります.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

*