1

ストックmongodbを備えたdebian開発サーバーがあります。php 5.4 および pecl mongodb ドライバー v1.4.3。PHP Cliを使用して簡単な接続を作成しようとしましたが、例外が発生しました:

php -r "MongoLog::setLevel(MongoLog::ALL); MongoLog::setModule(MongoLog::ALL); new MongoClient('mongodb://127.0.0.1:27017', array());"

以下の出力:

PHP Notice:  PARSE   INFO: Parsing mongodb://127.0.0.1:27017 in Command line code on line 1
PHP Notice:  PARSE   INFO: - Found node: 127.0.0.1:27017 in Command line code on line 1
PHP Notice:  PARSE   INFO: - Connection type: STANDALONE in Command line code on line 1
PHP Notice:  CON     INFO: mongo_get_read_write_connection: finding a STANDALONE connection in Command line code on line 1
PHP Notice:  CON     INFO: connection_create: creating new connection for 127.0.0.1:27017 in Command line code on line 1
PHP Notice:  CON     INFO: stream_connect: Not establishing SSL for 127.0.0.1:27017 in Command line code on line 1
PHP Notice:  CON     INFO: get_server_flags: start in Command line code on line 1
PHP Notice:  CON     FINE: send_packet: read from header: 36 in Command line code on line 1
PHP Notice:  CON     FINE: send_packet: data_size: 73 in Command line code on line 1
PHP Notice:  CON     FINE: get_server_flags: can't find maxBsonObjectSize, defaulting to 4194304 in Command line code on line 1
PHP Notice:  CON     FINE: get_server_flags: can't find maxMessageSizeBytes, defaulting to 8388608 in Command line code on line 1
PHP Notice:  CON     INFO: get_server_flags: found server type: UNKNOWN? in Command line code on line 1
PHP Notice:  CON     INFO: is_ping: pinging 127.0.0.1:27017;-;.;29554 in Command line code on line 1
PHP Notice:  CON     FINE: send_packet: read from header: 36 in Command line code on line 1
PHP Notice:  CON     FINE: send_packet: data_size: 69 in Command line code on line 1
PHP Notice:  CON     INFO: is_ping: last pinged at 1376577544; time: 0ms in Command line code on line 1
PHP Notice:  REPLSET FINE: finding candidate servers in Command line code on line 1
PHP Notice:  REPLSET FINE: - all servers in Command line code on line 1
PHP Notice:  REPLSET FINE: filter_connections: adding connections: in Command line code on line 1
PHP Notice:  REPLSET FINE: filter_connections: done in Command line code on line 1
PHP Notice:  REPLSET FINE: limiting by seeded/discovered servers in Command line code on line 1
PHP Notice:  REPLSET FINE: limiting by seeded/discovered servers: done in Command line code on line 1
PHP Notice:  REPLSET FINE: limiting by credentials in Command line code on line 1
    PHP Notice:  REPLSET FINE: limiting by credentials: done in Command line code on line 1
PHP Fatal error:  Uncaught exception 'MongoConnectionException' with message 'No candidate servers found' in Command line code:1
Stack trace:
#0 Command line code(1): MongoClient->__construct('mongodb://127.0...', Array)
#1 {main}
  thrown in Command line code on line 1

回避策を見つけました - ドライバのバージョンを 1.3.6 にダウングレードします。しかし、それは解決策ではありません。

4

2 に答える 2

2

見てみましょう: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

10世代版のmongodbをインストールしたら解決しました。

于 2013-08-29T08:19:29.313 に答える