diff --git a/doc/user/configuration-reference.xml b/doc/user/configuration-reference.xml index ca291be9745290de728b7c81c88f3626f8682242..78735c9797f9cc8216113ff0cfda40c1b254dbe6 100644 --- a/doc/user/configuration-reference.xml +++ b/doc/user/configuration-reference.xml @@ -104,14 +104,14 @@ box.cfg{ print('Starting ',arg[1])</programlisting> and suppose the command line is <code>~/tarantool/src/tarantool script.lua ARG</code>. Then the screen might look like this:<programlisting> -<prompt>$</prompt> <userinput>export PRIMARY_PORT=3303</userinput> +<prompt>$</prompt> <userinput>export PRIMARY_PORT=3301</userinput> <prompt>$</prompt> <userinput>~/tarantool/src/tarantool script.lua ARG</userinput> 2014-07-02 10:19:29.078 ... version 1.6.0-1471-g663694c 2014-07-02 10:19:29.078 ... log level 5 2014-07-02 10:19:29.078 ... mapping 107374184 bytes for a shared arena... 2014-07-02 10:19:29.086 ... initialized 2014-07-02 10:19:29.101 ... recovery start -2014-07-02 10:19:29.107 ... bound to primary port tcp://0.0.0.0:3303 +2014-07-02 10:19:29.107 ... bound to primary port tcp://0.0.0.0:3301 2014-07-02 10:19:29.108 ... I am primary Starting ARG 2014-07-02 10:19:29.108 ... entering the event loop</programlisting> @@ -224,7 +224,7 @@ Starting ARG Note: a replica also binds to this port, and accepts connections, but these connections can only serve reads until the replica becomes a master. - A typical value is 3303.</entry> + A typical value is 3301.</entry> </row> <row> @@ -266,11 +266,11 @@ Starting ARG ordinarily <command>ps</command> shows the Tarantool server process thus: </para> <programlisting>kostja@shmita:~$ ps -a -o command | grep box -tarantool: primary pri: 3303 adm: 33135</programlisting> +tarantool: primary pri: 3301 adm: 3313</programlisting> <para>But if the configuration file contains custom_proc_title=sessions then the output looks like:</para> <programlisting>kostja@shmita:~$ ps -a -o command | grep box -tarantool: primary@sessions pri: 3303 adm: 3313</programlisting> +tarantool: primary@sessions pri: 3301 adm: 3313</programlisting> </entry> </row> diff --git a/doc/user/connectors.xml b/doc/user/connectors.xml index 44e2617814447bcbbe983ac3dbbf7b75caae1186..d4bb4c6b5e810135a631399490828c1723fe589f 100644 --- a/doc/user/connectors.xml +++ b/doc/user/connectors.xml @@ -113,10 +113,10 @@ And that is why APIs exist for drivers for C, Perl, Python, PHP, Ruby, and so on the necessary file <filename>tp.h</filename>, and the default library path contains the directory where Tarantool library files were placed at installation time. Before trying to run, check that the server - (tarantool) is running on localhost (127.0.0.1) and its primary port is the default (3303) and + (tarantool) is running on localhost (127.0.0.1) and its primary port is the default (3301) and space[513]'s primary key type is numeric (space[513].index[0].key_field[1].type = "NUM"). To run, say <code>./example</code>. - The program will open a socket connection with the tarantool server at localhost:3303, + The program will open a socket connection with the tarantool server at localhost:3301, then format a buffer for sending an INSERT request, then send the request, then check if the server returned an error, then — if all is well — print "Insert succeeded". If the row already exists, the program will print <quote>Duplicate key exists in unique index 0</quote>. @@ -136,10 +136,10 @@ int main() struct sockaddr_in sock; /* the usual socket address info */ if ((fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) <= 0) /* open the socket. abort if failure */ exit(1); - memset(&sock, 0, sizeof(sock)); /* connect to localhost:3303 */ + memset(&sock, 0, sizeof(sock)); /* connect to localhost:3301 */ sock.sin_family = AF_INET; sock.sin_addr.s_addr = inet_addr("127.0.0.1"); - sock.sin_port = htons(3303); + sock.sin_port = htons(3301); if (connect(fd, (struct sockaddr *)&sock, sizeof(sock)) < 0) /* connect, abort if failure */ exit(1); const int greeting_buffer_size = 128; /* handle the server's greeting */ @@ -219,14 +219,14 @@ sudo cpan install DR::Tarantool <para> Here is a complete Perl program that inserts [99999,'BB'] into space[0] via the Perl API. Before trying to run, check that the server - (tarantool) is running on localhost (127.0.0.1) and its primary port is the default (3303) and + (tarantool) is running on localhost (127.0.0.1) and its primary port is the default (3301) and space[0]'s primary key type is numeric (space[0].index[0].key_field[1].type = "NUM" in configuration file). To run, paste the code into a file named example.pl and say <code>perl example.pl</code>. The program will connect using an application-specific definition of the space. The program will open a socket connection - with the tarantool server at localhost:3303, then send an INSERT request, + with the tarantool server at localhost:3301, then send an INSERT request, then — if all is well — end without displaying any messages. - If tarantool is not running on localhost with primary port = 3303, the program will print + If tarantool is not running on localhost with primary port = 3301, the program will print <quote>Connection refused</quote>. </para> <para> @@ -237,7 +237,7 @@ use DR::Tarantool ':all'; my $tnt = tarantool host => '127.0.0.1', # look for tarantool on localhost - port => 3303, # assume tarantool primary port = default + port => 3301, # assume tarantool primary port = default spaces => { 0 => { # definition of space[0] ... name => 't0', # space[0] name = 't0' @@ -295,18 +295,18 @@ export PHP_INI_SCAN_DIR=~/tarantool-php/test/share <para> Here is a complete PHP program that inserts [99999,'BB'] into space[0] via the PHP API. Before trying to run, check that the server - (tarantool) is running on localhost (127.0.0.1) and its primary port is the default (3303) and + (tarantool) is running on localhost (127.0.0.1) and its primary port is the default (3301) and space[0]'s primary key type is numeric (space[0].index[0].key_field[1].type = "NUM" in configuration file). To run, paste the code into a file named example.php and say <code>php example.php</code>. The program will open a socket connection - with the tarantool server at localhost:3303, then send an INSERT request, + with the tarantool server at localhost:3301, then send an INSERT request, then — if all is well — print "Insert succeeded". If the tuple already exists, the program will print <quote>Duplicate key exists in unique index 0</quote>. </para> <para> <programlisting> <?php -$tarantool = new Tarantool("localhost", 3303, 33015); +$tarantool = new Tarantool("localhost", 3301, 3313); try { $tarantool->insert(0, array(99999, "BB"), TARANTOOL_FLAGS_ADD); print "Insert succeeded\n"; @@ -334,10 +334,10 @@ catch (Exception $e) { or <userinput><code>pip install tarantool --user</code></userinput> to install in <filename>~</filename> i.e. user's default directory. The program is assuming that the server (tarantool) is running on localhost (127.0.0.1) and its primary port is - the default (3303) and space99's primary key type is string (box.space.space99.index['primary'].key_field[1].type = "STR") + the default (3301) and space99's primary key type is string (box.space.space99.index['primary'].key_field[1].type = "STR") and user 'guest' has permission to read and write on space99. An administrator could fulfill all those conditions by starting the tarantool server and executing these requests:<programlisting> -box.cfg{primary_port = 3303} +box.cfg{primary_port = 3301} box.schema.create_space('space99') box.space.space99:create_index('primary',{parts = {1,'STR'}}) box.schema.user.grant('guest', 'read', 'space', '_space') @@ -350,7 +350,7 @@ box.schema.user.grant('guest', 'read,write', 'space', 'space99')</programlisting #!/usr/bin/python from tarantool import Connection -c = Connection("127.0.0.1", 3303) +c = Connection("127.0.0.1", 3301) result = c.insert("space99",('First Tuple','Value', 'Value')) print result </programlisting> diff --git a/doc/user/databases.xml b/doc/user/databases.xml index 57477de80f947a7de44b30630dc137a8e5fad50d..888f4a3fffee7ab4e5819bf2f3e1ae7ade70a5bd 100644 --- a/doc/user/databases.xml +++ b/doc/user/databases.xml @@ -2091,7 +2091,7 @@ session.delimiter('')! connection object named <code>box.net.self</code>. Its purpose is to make polymorphic use of the <code>box.net.box</code> API easier. Therefore - <code>conn = box.net.box.new('localhost', 3303)</code> can + <code>conn = box.net.box.new('localhost', 3301)</code> can be replaced by <code>conn = box.net.box.self</code>. However, there is an important difference between the embedded connection and a remote one. With the embedded connection, @@ -2106,7 +2106,7 @@ session.delimiter('')! Returns: (type = userdata) conn object). </para> <para> - Example: <code>conn = box.net.box.new('localhost', 3303)</code>. + Example: <code>conn = box.net.box.new('localhost', 3301)</code>. </para> </listitem> </varlistentry> @@ -2250,7 +2250,7 @@ session.delimiter('')! This example will work with the sandbox configuration described in the preface. That is, there is a space named tester with a numeric primary key. Assume that the database is nearly empty. - Assume that the tarantool server is running on localhost 127.0.0.1:3303. + Assume that the tarantool server is running on localhost 127.0.0.1:3301. <programlisting> <prompt>tarantool></prompt><userinput> ta = {}</userinput> --- @@ -2262,14 +2262,14 @@ session.delimiter('')! <prompt> -></prompt><userinput> table.insert(ta, 'self:ping() succeeded')</userinput> <prompt> -></prompt><userinput> table.insert(ta, ' (no surprise -- self connection is pre-established)')</userinput> <prompt> -></prompt><userinput> end</userinput> -<prompt> -></prompt><userinput> if box.cfg.primary_port == 3303 then</userinput> -<prompt> -></prompt><userinput> table.insert(ta,'The local server primary port number = 3303')</userinput> +<prompt> -></prompt><userinput> if box.cfg.primary_port == 3301 then</userinput> +<prompt> -></prompt><userinput> table.insert(ta,'The local server primary port number = 3301')</userinput> <prompt> -></prompt><userinput> else</userinput> -<prompt> -></prompt><userinput> table.insert(ta, 'The local server primary port number is not 3303')</userinput> -<prompt> -></prompt><userinput> table.insert(ta, '( (maybe box.cfg{...primary_port=3303...} was not stated)')</userinput> +<prompt> -></prompt><userinput> table.insert(ta, 'The local server primary port number is not 3301')</userinput> +<prompt> -></prompt><userinput> table.insert(ta, '( (maybe box.cfg{...primary_port=3301...} was not stated)')</userinput> <prompt> -></prompt><userinput> table.insert(ta, '( (so connect will fail)')</userinput> <prompt> -></prompt><userinput> end</userinput> -<prompt> -></prompt><userinput> conn = box.net.box.new('127.0.0.1', 3303)</userinput> +<prompt> -></prompt><userinput> conn = box.net.box.new('127.0.0.1', 3301)</userinput> <prompt> -></prompt><userinput> conn:delete(box.space.tester.id, 800)</userinput> <prompt> -></prompt><userinput> table.insert(ta, 'conn:delete done on tester.')</userinput> <prompt> -></prompt><userinput> conn:insert(box.space.tester.id, {800, 'data'})</userinput> @@ -2297,7 +2297,7 @@ session.delimiter('')! --- - - self:ping() succeeded - ' (no surprise -- self connection is pre-established)' - - The local server primary port number = 3303 = default + - The local server primary port number = 3301 = default - conn:delete done on tester. - conn:insert done on tester, index 0 - ' primary key value = 800.' diff --git a/doc/user/language-reference.xml b/doc/user/language-reference.xml index d1050ca013d65ebdbd63b6b13bb3e2fb5903efe5..c7832dca4806af3ad10299df556acd4fbe81bbfe 100644 --- a/doc/user/language-reference.xml +++ b/doc/user/language-reference.xml @@ -22,7 +22,7 @@ (also called the "binary protocol"), and provides full data access. </para> <para> - The default value of the port is <literal>3303</literal>, + The default value of the port is <literal>3301</literal>, as defined in the <olink targetptr="primary_port"/> configuration option. </para></listitem> diff --git a/doc/user/server-administration.xml b/doc/user/server-administration.xml index e65cf2744569b7916137199e04bfe3ac6164078b..30626a51e579e0015bf57549587d11d0cf7a8f96 100644 --- a/doc/user/server-administration.xml +++ b/doc/user/server-administration.xml @@ -161,7 +161,7 @@ Here is an example of an interactive-mode tarantool client session: <programlisting> <prompt>$ </prompt>tarantool [ tarantool will display an introductory message including version number here ] -tarantool> box.cfg{admin_port=3313, primary_port=3303} +tarantool> box.cfg{admin_port=3313, primary_port=3301} [ tarantool will display configuration information here ] tarantool> s = box.schema.create_space('tester') [ tarantool may display an in-progress message here ] @@ -189,10 +189,10 @@ Explanatory notes about what tarantool displayed in the above example: </para> <para> * Many requests return typed objects. - In the case of "box.cfg{admin_port=3313, primary_port=3303}", + In the case of "box.cfg{admin_port=3313, primary_port=3301}", this result is displayed on the screen. If the request had assigned the result to a variable, for example - "c = box.cfg{admin_port=3313, primary_port=3303}", then + "c = box.cfg{admin_port=3313, primary_port=3301}", then the result would not have been displayed on the screen. </para> <para>