![]() The driver will then automatically reconnect to the current leader. If the driver connects to a follower (non-leader), it would not be able to perform any write operations on it, so the follower will reject the connection and redirect to the current leader. If no connection can be made to any of the configured endpoints, the driver will bail out by throwing an exception. The driver will by default try to connect to the first endpoint in the endpoints array, and only try the following servers if no connection can be established. We only use the same machine here for demonstration purposes.) ( Please note that, in reality, the ArangoDB instances should be set up on different physical machines. For example, if the active failover ArangoDB instances run on 127.0.0.1 on ports 8529, 8539, and 8549, the example configuration would be: php To make use of the new active failover option in ArangoDB 3.3, the PHP driver now allows setting up multiple endpoints. ![]() $connection->test() // should return true if connection works $connection = new Connection($connectionOptions) 'autoload.php' ĬonnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529',ĬonnectionOptions::OPTION_AUTH_USER => 'root',ĬonnectionOptions::OPTION_AUTH_PASSWD => '' following can be omitted when composer.json is used to set up the project ![]() To connect to an ArangoDB server that is running on localhost or on a remote server, simply set the OPTION_ENDPOINT item in the ConnectionOptions and connect: php one combination of IP address and port number. Historically, ArangoDB-PHP has been able to connect to a single ArangoDB endpoint, i.e. It requires ArangoDB-PHP 3.3.2 or higher, and an ArangoDB server version of 3.3.4 or higher. This article is about setting up active failover for ArangoDB-PHP, the PHP client driver for ArangoDB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |