トップ «前の日記(2010/03/10 (水) ) 最新 次の日記(2010/03/12 (金) )» 編集

HsbtDiary


2010/03/11 (木) [長年日記]

mongodump と mongorestore でポート指定

mongodump と mongorestore で --help してみると

$ mongodump --help
options:
  --help                   produce help message
  -h [ --host ] arg        mongo host to connect to ("left,right" for pairs)
  -d [ --db ] arg          database to use
  -c [ --collection ] arg  collection to use (some commands)
  -u [ --username ] arg    username
  -p [ --password ] arg    password
  --dbpath arg             directly access mongod data files in this path, 
                           instead of connecting to a mongod instance
  --directoryperdb         if dbpath specified, each db is in a separate 
                           directory
  -v [ --verbose ]         be more verbose (include multiple times for more 
                           verbosity e.g. -vvvvv)
  -o [ --out ] arg (=dump) output directory

という感じでポート指定に関する記述が無いんだけど、同一PCで複数の mongod プロセスを走らせている時とかにポートを指定できないのは困る。

そんな時は強引に

$ mongodump -h localhost:27018

とかするとポート指定でダンプやリストアをすることができる。mongoimport/mongoexport も同じかな。後で試してみる。

世界遺産100(28)

ワイン特集ということで文化遺産中心の特集。ちょっと物足りないかなー。