mongoDB

mongoDB

# ソース読み会 〜mongo DB〜

# ビルド (Mac OS X の場合)

1
 $ git clone https://github.com/mongodb/mongo.git
  • ビルドに Xcode と SCons が必要なのでそれらも取得。
    • Xcode は App Store からインストール。
    • SCons は homebrew, easy_install, pip から入手可能。
      • 公式ページ( http://www.scons.org )からも持ってこれる。
      • ソースからの場合は以下のように。
1
 $ python setup.py install --prefix=(インストール先)
1
2
 $ scons all --opt=off --dbg=on
 $ scons --prefix=(インストール先) install

# 実行

  • まず mongodb がファイルを保存するディレクトリを作る。
1
$ mkdir (DIR_PATH)
  • 創ったディレクトリを指定してサーバー側を実行。
1
$ mongod --dbpath (DIR_PATH)
  • 動いたのを確認したらクライアント側を実行。
1
$ mongo 

# ソース読み会1日目

  • ばっくとれーす
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 Thread [14] (Suspended : Step)  
        mongo::_execCommand() at dbcommands.cpp:1,289 0x10027cb36        
        mongo::Command::execCommand() at dbcommands.cpp:1,476
        0x10027dfd2        
        mongo::_runCommands() at dbcommands.cpp:1,551 0x10027ebaf        
        mongo::runCommands() at new_find.cpp:121 0x10057a520             
        mongo::newRunQuery() at new_find.cpp:438 0x100576ffa             
        mongo::receivedQuery() at instance.cpp:256 0x1003d2211           
        mongo::assembleResponse() at instance.cpp:424 0x1003d0e16        
        mongo::MyMessageHandler::process() at db.cpp:202 0x10001627c     
        mongo::PortMessageServer::handleIncomingMsg() at
        message_server_port.cpp:223 0x10097091d       
        boost::_bi::list1<boost::_bi::value<mongo::PortMessageServer::HandleIncomingMsgParam*>
        >::operator()<void*, void* (*)(void*), boost::_bi::list0> at
        bind.hpp:243 0x100971279   
        <...more frames...>        
  • lockしてるぽい?
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 Thread [14] (Suspended : Step)    
        mongo::Lock::DBWrite::lockDB() at d_concurrency.cpp:552
        0x100272607      
        DBWrite() at d_concurrency.cpp:601 0x100274426   
        DBWrite() at d_concurrency.cpp:602 0x1002743ad   
        mongo::WriteBatchExecutor::ExecInsertsState::_lockAndCheckImpl()
        at batch_executor.cpp:905 0x100264048    
        mongo::WriteBatchExecutor::ExecInsertsState::lockAndCheck() at
        batch_executor.cpp:936 0x100263a7f                          
        mongo::insertOne() at batch_executor.cpp:962 0x100262e7d    
        mongo::WriteBatchExecutor::execOneInsert() at
        batch_executor.cpp:989 0x100260d91         
        mongo::WriteBatchExecutor::execInserts() at
        batch_executor.cpp:828 0x10026050b       
        mongo::WriteBatchExecutor::bulkExecute() at
        batch_executor.cpp:722 0x10025f75e       
        mongo::WriteBatchExecutor::executeBatch() at
        batch_executor.cpp:244 0x10025e919        
        <...more frames...>    
  • insert record
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 mongo::MmapV1ExtentManager::recordForV1() at
 mmap_v1_extent_manager.cpp:212 0x100703d4c      
 mongo::RecordStoreV1Base::recordFor() at record_store_v1_base.cpp:103
 0x100736703       
 mongo::RecordStoreV1Base::_insertRecord() at
 record_store_v1_base.cpp:268 0x100737935  
 mongo::RecordStoreV1Base::insertRecord() at
 record_store_v1_base.cpp:249 0x100737779 
 mongo::Collection::_insertDocument() at collection.cpp:219 0x10015c68d  
 mongo::Collection::insertDocument() at collection.cpp:185 0x10015c562   
 mongo::singleInsert() at batch_executor.cpp:1,027 0x100263b1e           
 mongo::insertOne() at batch_executor.cpp:964 0x100262ef3                
 mongo::WriteBatchExecutor::execOneInsert() at batch_executor.cpp:989
 0x100260d91        
 mongo::WriteBatchExecutor::execInserts() at batch_executor.cpp:828
 0x10026050b  
 <...more frames...>
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy