I have simple setup with two mongo db nodes (Node A and B). These nodes are also running apache server having php rest api code.
Below are the two scenarios and 2nd is giving problems.
Scenario 1:
1) Node A is mongodb primary and Node B mongodb secondary.
2) REST request sent to Node A, sucessfully processed.
Scenario 2:
1) Node A is mongodb primary and Node B mongodb secondary.
2) REST request sent to Node B, request is processed intermittently.
Scenario 2 logs:
PHP Notice: REPLSET INFO: pick server: random element 0 in /var/www/html/api/lib/mongo.php on line 396
PHP Notice: REPLSET INFO: - connection: type: SECONDARY, socket: 42, ping: 0, hash: secondary.host:27017;-;.;27676 in /var/www/html/api/lib/test.php on line 396
PHP Notice: IO FINE: getting reply in /var/www/html/api/lib/test.php on line 396
PHP Notice: IO FINE: getting cursor header in /var/www/html/api/lib/test.php on line 396
PHP Notice: CON FINE: No timeout changes for secondary.host:27017;-;.;27676 in /var/www/html/api/lib/test.php on line 396
PHP Notice: IO FINE: getting cursor body in /var/www/html/api/lib/test.php on line 396
PHP Notice: CON FINE: No timeout changes for secondary.host:27017;-;.;27676 in /var/www/html/api/lib/test.php on line 396
PHP Notice: CON FINE: mongo_connection_destroy: Destroying connection object for secondary.host:27017;-;.;27676 in /var/www/html/api/lib/test.php on line 396
PHP Notice: CON FINE: mongo_connection_destroy: Closing socket for secondary.host:27017;-;.;27676. in /var/www/html/api/lib/test.php on line 396
PHP Fatal error: Uncaught exception 'MongoCursorException' with message 'secondary.host:27017: not master and slaveOk=false'
For scenario 2, it should always select node A but sometimes it choose node B and fails.
PHP code :
$this->mongo = new \MongoClient ( $list_of_servers, array ('replicaSet' => 'rs0') );
Do I have to make some configuration changes? How to fix this issue?
Thanks
Other information :
MongoDB Version -> 3.0.6
PHP MongoDB Driver -> 1.6.9
PHP version -> 5.3.3
OS -> RedHat
Related
what is the cause of the error?
following my error messages :
ErrorException with message 'streamselect(): unable to select [4]: Interrupted system call (maxfd=9)'
[root#localhost ]# E
Exit: Ctrl+D
PHP Notice: fwrite(): send of 1270 bytes failed with errno=32 Broken pipe in /laravel_path/vendor/psy/psysh/src/Psy/ExecutionLoop/ForkingLoop.php on line 83
I'm trying to connect to a SFTP server with the following command:
<?php
ssh2_connect("my-host.com", 443, array("client_to_server" => array("mac" => "hmac-sha2-256,hmac-sha2-512,umac-64#openssh.com")));
But I get the following error message:
PHP Warning: ssh2_connect(): Error starting up SSH connection(-5): Unable to exchange encryption keys in Command line code on line 1
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. ssh2_connect() Command line code:1
PHP Warning: ssh2_connect(): Unable to connect to my-host.com in Command line code on line 1
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. ssh2_connect() Command line code:1
And when I check the logs of my SFTP server, I can see:
2016-08-17 15:32:43,104 mod_sftp/0.9.9[10701]: no shared client-to-server MAC algorithm found (client sent 'hmcom', server sent 'hmac-sha2-256,hmac-sha2-512,umac-64#openssh.com')
Could you help me?
Ben
I have debian dev server with stock mongodb; php 5.4 and pecl mongodb drivers v1.4.3.
I tried to create simple conntection using PHP Cli and got exception:
php -r "MongoLog::setLevel(MongoLog::ALL); MongoLog::setModule(MongoLog::ALL); new MongoClient('mongodb://127.0.0.1:27017', array());"
the output below:
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
I have found workaround - is downgrade dirver version to 1.3.6; but it is not a solution.
Take a look at: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
I solved my problem after installing 10-gen version mongodb.
Had the same problem today, downgraded to the 1.3.6 version of mongo driver in pecl "worked" for me... System: Debian Squeeze
This does the job for you:
pecl uninstall mongo
pecl install mongo-1.3.6
I have Moodle 2.3.3+ and after I press "continue" in "extension check page" in the installation the server will stop and when i try to access any domain on the server this message will come up:
The connection was reset
and after 3-5 minutes the server will response again and the installation will continue to the "admin registration" and when i press "submit" the server will crash again without saving the admin information.
Server Specifications:
Dedicated Server
Intel® Core™ i7-920 Quadcore
RAM 24 GB DDR3 RAM
Apache/2.2.16 (Debian)
PHP/5.3.3-7
PHP Log:
PHP Notice: Undefined variable: CFG in /var/www/clients/client1/web4/web/index.php on line 32
PHP Notice: Trying to get property of non-object in /var/www/clients/client1/web4/web/index.php on line 32
PHP Warning: require_once(/course/lib.php): failed to open stream: No such file or directory in /var/www/clients/client1/web4/web/index.php on line 32
PHP Fatal error: require_once(): Failed opening required '/course/lib.php'(include_path='.:/usr/share/php:/usr/share/pear') in /var/www/clients/client1/web4/web/index.php on line 32
any ideas why is that happening?
find i m trying to convert sequence of images into a video. and for that i canme to know about the ffmpeg class.
the only wrapper class that i found is phpvideotoolkit but i m not able to work with it.
i installed phpvideotoolkit on xampp on my windows 2008 server . but it is throwing alor of errors
This example shows you how to extract a specific frame from a movie.
Notice: Undefined property: PHPVideoToolkit::$_tmb_directory in C:\xampp\htdocs\phpvideo\phpvideotoolkit.php5.php on line 869
Notice: Undefined offset: 0 in C:\xampp\htdocs\phpvideo\phpvideotoolkit.php5.php on line 877
PHPVideoToolkit Error: Execute error. Output for file "C:\xampp\htdocs\phpvideo\examples\working\to-be-processed\MOV00007.3gp" was not found. No images were generated.
Notice: Undefined property: PHPVideoToolkit::$_tmb_directory in C:\xampp\htdocs\phpvideo\phpvideotoolkit.php5.php on line 869
Notice: Undefined offset: 0 in C:\xampp\htdocs\phpvideo\phpvideotoolkit.php5.php on line 877
PHPVideoToolkit Error: Execute error. Output for file "C:\xampp\htdocs\phpvideo\examples\working\to-be-processed\Video000.3gp" was not found. No images were generated.
Notice: Undefined property: PHPVideoToolkit::$_tmb_directory in C:\xampp\htdocs\phpvideo\phpvideotoolkit.php5.php on line 869
Notice: Undefined offset: 0 in C:\xampp\htdocs\phpvideo\phpvideotoolkit.php5.php on line 877
PHPVideoToolkit Error: Execute error. Output for file "C:\xampp\htdocs\phpvideo\examples\working\to-be-processed\cat.mpeg" was not found. No images were generated.
example
PHPVideoToolkit Error: Execute error. Output for file "C:\xampp\htdocs\phpvideo\examples\working\tmp\1336156630-4fa421d69357d\tmp_%d.jpg" was not found. Please check server write permissions and/or available codecs compiled with FFmpeg. You can check the encode decode availability by inspecting the output array from PHPVideoToolkit::getFFmpegInfo().
i m trying to make it work since last many hours but no luck
Also, for this code :
$srcFile = "test-mpeg.mpg";
$ffmpegObj = new ffmpeg_movie($srcFile);
i am gettign error that it cant file the file. i believe its something to do with permissions but i m not able to figure out
fpoen , fwrite , file_put_contents all are working fine without any permissions problems.
can anyone please guide me in the write direction. what do i need to do to make this phpvideotoolkit work