# HG changeset patch # User Yaroslav Zhuravlev # Date 1434038766 -10800 # Node ID f93a5aadad2c7c7cdcf56fb00ef9994c5da7c30d # Parent 1a16dce51bceb2dfedd73f5f8041362790387edf Translated the stream upstream module into Russian. diff --git a/xml/ru/GNUmakefile b/xml/ru/GNUmakefile --- a/xml/ru/GNUmakefile +++ b/xml/ru/GNUmakefile @@ -88,6 +88,7 @@ REFS = \ stream/ngx_stream_limit_conn_module \ stream/ngx_stream_proxy_module \ stream/ngx_stream_ssl_module \ + stream/ngx_stream_upstream_module \ TOP = \ download \ diff --git a/xml/ru/docs/index.xml b/xml/ru/docs/index.xml --- a/xml/ru/docs/index.xml +++ b/xml/ru/docs/index.xml @@ -511,8 +511,8 @@ ngx_stream_ssl_module - -ngx_stream_upstream_module [en] + +ngx_stream_upstream_module diff --git a/xml/en/docs/stream/ngx_stream_upstream_module.xml b/xml/ru/docs/stream/ngx_stream_upstream_module.xml copy from xml/en/docs/stream/ngx_stream_upstream_module.xml copy to xml/ru/docs/stream/ngx_stream_upstream_module.xml --- a/xml/en/docs/stream/ngx_stream_upstream_module.xml +++ b/xml/ru/docs/stream/ngx_stream_upstream_module.xml @@ -6,24 +6,24 @@ -
-The ngx_stream_upstream_module module (1.9.0) -is used to define groups of servers that can be referenced -by the -directive. +Модуль ngx_stream_upstream_module (1.9.0) +позволяет описывать группы серверов, +которые могут использоваться в директиве +.
-
+
@@ -46,9 +46,9 @@ server { -Dynamically configurable group, -available as part of our -commercial subscription: +Динамически настраиваемая группа, +доступна как часть +коммерческой подписки: resolver 10.0.0.1; @@ -76,22 +76,22 @@ server {
-
+
-name +название stream -Defines a group of servers. -Servers can listen on different ports. -In addition, servers listening on TCP and UNIX-domain sockets -can be mixed. +Описывает группу серверов. +Серверы могут слушать на разных портах. +Кроме того, можно одновременно использовать серверы, +слушающие на TCP- и UNIX-сокетах. -Example: +Пример: upstream backend { server backend1.example.com:12345 weight=5; @@ -105,129 +105,128 @@ upstream backend { -By default, connections are distributed between the servers using a -weighted round-robin balancing method. -In the above example, each 7 connections will be distributed as follows: -5 connections go to backend1.example.com:12345 -and one connection to each of the second and third servers. -If an error occurs during communication with a server, the connection will -be passed to the next server, and so on until all of the functioning -servers will be tried. -If communication with all servers fails, the connection will be closed. +По умолчанию соединения распределяются по серверам циклически +(в режиме round-robin) с учётом весов серверов. +В вышеприведённом примере каждые 7 соединений будут распределены так: +5 соединений на backend1.example.com:12345 +и по одному соединению на второй и третий серверы. +Если при попытке работы с сервером происходит ошибка, то соединение +передаётся следующему серверу, и так далее до тех пор, пока не будут опробованы +все работающие серверы. +Если связь с серверами не удалась, соединение будет закрыто. -address [parameters] +адрес [параметры] upstream -Defines the address and other parameters -of a server. -The address can be specified as a domain name or IP address -with an obligatory port, or as a UNIX-domain socket path -specified after the “unix:” prefix. -A domain name that resolves to several IP addresses defines -multiple servers at once. +Задаёт адрес и другие параметры +сервера. +Адрес может быть указан в виде доменного имени или IP-адреса, +и обязательного порта, или в виде пути UNIX-сокета, который +указывается после префикса “unix:”. +Доменное имя, которому соответствует несколько IP-адресов, +задаёт сразу несколько серверов. -The following parameters can be defined: +Могут быть заданы следующие параметры: -weight=number +weight=число -sets the weight of the server, by default, 1. +задаёт вес сервера, по умолчанию 1. -max_fails=number +max_fails=число -sets the number of unsuccessful attempts to communicate with the server -that should happen in the duration set by the fail_timeout -parameter to consider the server unavailable for a duration also set by the -fail_timeout parameter. -By default, the number of unsuccessful attempts is set to 1. -The zero value disables the accounting of attempts. -Here, an unsuccessful attempt is an error or timeout -while establishing a connection with the server. +задаёт число неудачных попыток работы с сервером, которые должны произойти +в течение времени, заданного параметром fail_timeout, +чтобы сервер считался недоступным на период времени, также заданный +параметром fail_timeout. +По умолчанию число попыток устанавливается равным 1. +Нулевое значение отключает учёт попыток. +В данном случае неудачной попыткой считается ошибка или таймаут +при установке соединения с сервером. -fail_timeout=time +fail_timeout=время -sets +задаёт -the time during which the specified number of unsuccessful attempts to -communicate with the server should happen to consider the server unavailable; +время, в течение которого должно произойти заданное число неудачных +попыток работы с сервером для того, чтобы сервер считался недоступным; -and the period of time the server will be considered unavailable. +и время, в течение которого сервер будет считаться недоступным. -By default, the parameter is set to 10 seconds. +По умолчанию параметр равен 10 секундам. backup -marks the server as a backup server. -Connections to the backup server will be passed -when the primary servers are unavailable. +помечает сервер как запасной сервер. +На него будут передаваться соединения в случае, +если не работают основные серверы. down -marks the server as permanently unavailable. +помечает сервер как постоянно недоступный. -Additionally, -the following parameters are available as part of our -commercial subscription: +Кроме того, +следующие параметры доступны как часть +коммерческой подписки: -max_conns=number +max_conns=число -limits the maximum number of simultaneous connections to the -proxied server. -Default value is zero, meaning there is no limit. +ограничивает максимальное число одновременных +соединений к проксируемому серверу. +Значение по умолчанию равно 0 и означает, что ограничения нет. resolve -monitors changes of the IP addresses -that correspond to a domain name of the server, -and automatically modifies the upstream configuration -without the need of restarting nginx. -The server group must reside in the shared memory. +отслеживает изменения IP-адресов, соответствующих доменному имени сервера, +и автоматически изменяет конфигурацию группы +без необходимости перезапуска nginx. +Группа должна находиться в зоне разделяемой памяти. -In order for this parameter to work, -the directive -must be specified in the - block. -Example: +Для работы этого параметра +директива +должна быть задана в блоке +. +Пример: stream { resolver 10.0.0.1; @@ -243,31 +242,32 @@ stream { -service=name +service=имя -enables resolving of DNS -SRV -records and sets the service name (1.9.13). -In order for this parameter to work, it is necessary to specify -the parameter for the server -and specify a hostname without a port number. +включает преобразование +SRV-записей +DNS и задаёт имя сервиса (1.9.13). +Для работы параметра необходимо указать +параметр для сервера +и не указывать порт сервера. -If the service name does not contain a dot (“.”), then -the RFC-compliant name -is constructed -and the TCP protocol is added to the service prefix. -For example, to look up the -_http._tcp.backend.example.com SRV record, -it is necessary to specify the directive: +Если имя сервиса не содержит точку (“.”), то +имя составляется в соответствии с +RFC +и в префикс службы добавляется протокол TCP. +Например, для получения +SRV-записи _http._tcp.backend.example.com +необходимо указать директиву: server backend.example.com service=http resolve; -If the service name contains one or more dots, then the name is constructed -by joining the service prefix and the server name. -For example, to look up the _http._tcp.backend.example.com -and server1.backend.example.com SRV records, -it is necessary to specify the directives: +Если имя сервиса содержит одну и более точек, то имя составляется +при помощи соединения префикса службы и имени сервера. +Например, для получения SRV-записей +_http._tcp.backend.example.comserver1.backend.example.com +необходимо указать директивы: server backend.example.com service=_http._tcp resolve; server example.com service=server1.backend resolve; @@ -275,26 +275,27 @@ server example.com service=server1.backe -Highest-priority SRV records -(records with the same lowest-number priority value) -are resolved as primary servers, -the rest of SRV records are resolved as backup servers. -If the parameter is specified for the server, -high-priority SRV records are resolved as backup servers, -the rest of SRV records are ignored. +SRV-записи с наивысшим приоритетом +(записи с одинаковым наименьшим значением приоритета) +преобразуются в основные серверы, +остальные SRV-записи преобразуются в запасные серверы. +Если в конфигурации сервера указан параметр , +высокоприоритетные SRV-записи преобразуются в запасные серверы, +остальные SRV-записи игнорируются. -slow_start=time +slow_start=время -sets the time during which the server will recover its weight -from zero to a nominal value, when unhealthy server becomes -healthy, -or when the server becomes available after a period of time -it was considered unavailable. -Default value is zero, i.e. slow start is disabled. +задаёт время, в течение которого вес сервера +восстановится от нуля до своего номинального значения в ситуации, когда +неработоспособный (unhealthy) сервер вновь становится работоспособным +(healthy) +или когда сервер становится доступным по прошествии времени, +в течение которого он считался недоступным. +Значение по умолчанию равно нулю и означает, что медленный старт выключен. @@ -302,9 +303,9 @@ Default value is zero, i.e. slow start i -If there is only a single server in a group, max_fails, -fail_timeout and slow_start parameters -are ignored, and such a server will never be considered unavailable. +Если в группе только один сервер, параметры max_fails, +fail_timeout и slow_start +игнорируются и такой сервер никогда не будет считаться недоступным. @@ -312,26 +313,26 @@ are ignored, and such a server will neve -name [size] +имя [размер] upstream -Defines the name and size of the shared -memory zone that keeps the group’s configuration and run-time state that are -shared between worker processes. -Several groups may share the same zone. -In this case, it is enough to specify the zone size only once. +Задаёт имя и размер зоны разделяемой памяти, +в которой хранятся конфигурация группы и её рабочее состояние, +разделяемые между рабочими процессами. +В одной и той же зоне могут быть сразу несколько групп. +В этом случае достаточно указать размер только один раз. -Additionally, -as part of our commercial subscription, -such groups allow changing the group membership -or modifying the settings of a particular server -without the need of restarting nginx. -The configuration is accessible via a special location -handled by +Дополнительно, как часть +коммерческой подписки, +в таких группах для изменения состава группы +или настроек отдельных серверов +нет необходимости перезапускать nginx. +Конфигурация доступна через специальный location, +в котором указана директива . @@ -339,36 +340,36 @@ handled by -file +файл upstream 1.9.7 -Specifies a file that keeps the state -of the dynamically configurable group. -The state is currently limited to the list of servers with their parameters. -The file is read when parsing the configuration and is updated each time -the upstream configuration is -changed. -Changing the file content directly should be avoided. -The directive cannot be used -along with the directive. +Задаёт файл, в котором хранится состояние +динамически настраиваемой группы. +В данный момент состояние ограничено списком серверов с их параметрами. +Файл читается при парсинге конфигурации и обновляется каждый раз при +изменении +конфигурации группы. +Изменение содержимого файла напрямую не рекомендуется. +Директиву нельзя использовать +совместно с директивой . -Changes made during -configuration reload -or binary upgrade -can be lost. +Изменения, совершённые в момент +перезагрузки конфигурации +или обновления бинарного файла, +могут быть потеряны. -This directive is available as part of our -commercial subscription. +Эта директива доступна как часть +коммерческой подписки. @@ -376,33 +377,34 @@ This directive is available as part of o -key [consistent] +ключ [consistent] upstream -Specifies a load balancing method for a server group -where client-server mapping is based on the hashed key value. -Currently, the only supported value for the key -is the client remote address specified as $remote_addr. -Note that adding or removing a server from the group -may result in remapping most of the keys to different servers. -The method is compatible with the -Cache::Memcached -Perl library. +Задаёт метод балансировки нагрузки для группы, при котором +соответствие клиента серверу определяется при помощи +хэшированного значения ключа. +В настоящий момент единственно возможным значением для ключа +является удалённый адрес клиента, +указываемый как $remote_addr. +Следует отметить, что любое добавление или удаление серверов в группе +может привести к перераспределению большинства ключей на другие серверы. +Метод совместим с библиотекой Perl +Cache::Memcached. -If the consistent parameter is specified, -the ketama -consistent hashing method will be used instead. -The method ensures that only a few keys -will be remapped to different servers -when a server is added to or removed from the group. -This helps to achieve a higher cache hit ratio for caching servers. -The method is compatible with the +Если задан параметр consistent, то вместо +вышеописанного метода будет использоваться метод консистентного хэширования +ketama. +Метод гарантирует, что при добавлении сервера в группу или его удалении +на другие серверы будет перераспределено минимальное число ключей. +Применение метода для кэширующих серверов обеспечивает +больший процент попаданий в кэш. +Метод совместим с библиотекой Perl Cache::Memcached::Fast -Perl library with the ketama_points parameter set to 160. +при значении параметра ketama_points равным 160. @@ -414,12 +416,11 @@ Perl library with the ketama_poin upstream -Specifies that a server group should use a load balancing method -where a connection -is passed to the server with the least number of active connections, -taking into account weights of servers. -If there are several such servers, they are tried in turn using a -weighted round-robin balancing method. +Задаёт для группы метод балансировки нагрузки, при котором соединение +передаётся серверу с наименьшим числом активных соединений, +с учётом весов серверов. +Если подходит сразу несколько серверов, они выбираются циклически +(в режиме round-robin) с учётом их весов. @@ -433,26 +434,26 @@ weighted round-robin balancing method. upstream -Specifies that a group should use a load balancing method where a connection -is passed to the server with the least average time and -least number of active connections, taking into account weights of servers. -If there are several such servers, they are tried in turn using a -weighted round-robin balancing method. +Задаёт для группы метод балансировки нагрузки, при котором соединение +передаётся серверу с наименьшими средним временем ответа и +числом активных соединений с учётом весов серверов. +Если подходит сразу несколько серверов, то они выбираются циклически +(в режиме round-robin) с учётом их весов. -If the connect parameter is specified, -time to connect to the upstream server is used. -If the first_byte parameter is specified, -time to receive the first byte of data is used. -If the last_byte is specified, -time to receive the last byte of data is used. +Если указан параметр connect, +то учитывается время соединения с сервером группы. +Если указан параметр first_byte, +то учитывается время получения первого байта данных. +Если указан параметр last_byte, +то учитывается время получения ответа. -This directive is available as part of our -commercial subscription. +Эта директива доступна как часть +коммерческой подписки. @@ -460,114 +461,113 @@ This directive is available as part of o -[parameters] +[параметры] server -Enables periodic health checks of the servers in a -group. +Активирует периодические проверки работоспособности серверов в +группе. -The following optional parameters are supported: +Могут быть заданы следующие необязательные параметры: -interval=time +interval=время -sets the interval between two consecutive health checks, -by default, 5 seconds; +задаёт интервал между двумя последовательными проверками, +по умолчанию 5 секунд; -fails=number +fails=число -sets the number of consecutive failed health checks of a particular server -after which this server will be considered unhealthy, -by default, 1; +задаёт число последовательных неуспешных проверок для определённого сервера, +после которых сервер будет считаться неработоспособным, +по умолчанию 1; -passes=number +passes=число -sets the number of consecutive passed health checks of a particular server -after which the server will be considered healthy, -by default, 1; +задаёт число последовательных успешных проверок для определённого сервера, +после которых сервер будет считаться работоспособным, +по умолчанию 1; -match=name +match=имя -specifies the match block configuring the tests that a -successful connection should pass in order for a health check to pass. -By default, -only the ability to establish a TCP connection with the server is checked; +указывает на блок match с условиями, которым должно +удовлетворять соединение, чтобы результат проверки считался успешным; +по умолчанию проверяется лишь возможность установки TCP-соединения с сервером; -port=number +port=число -defines the port used when connecting to a server -to perform a health check (1.9.7); -by default, equals the port; +задаёт порт, используемый при подключении к серверу +для проверки его работоспособности (1.9.7); +по умолчанию совпадает с портом сервера. udp -specifies that the UDP protocol should be used for -health checks instead of the default TCP protocol (1.9.13); -requires a match block with the -send and expect -parameters. +указывает, что для проверки работоспособности будет использоваться протокол +UDP +вместо протокола TCP, используемого по умолчанию (1.9.13); +тебует наличия блока match с параметрами +send и expect. -For example, +В примере server { proxy_pass backend; health_check; } -will check the ability to establish a TCP connection to each server -in the backend group every five seconds. -When a connection to the server cannot be established, -the health check will fail, and the server will -be considered unhealthy. -Client connections are not passed to unhealthy servers. +для каждого сервера группы backend +с интервалом в 5 секунд проверяется возможность установки TCP-соединения. +Если соединение с сервером не может быть установлено, +проверка считается неуспешной и сервер +признаётся неработоспособным. +На неработоспособные серверы клиентские соединения передаваться не будут. -Health checks can also be configured to test data obtained from the server. -Tests are configured separately using the directive -and referenced in the match parameter. +Проверки работоспособности могут тестировать данные, полученные от сервера. +Тесты настраиваются отдельно при помощи директивы +и указываются в параметре match. -The server group must reside in the shared memory. +Группа должна находиться в зоне разделяемой памяти. -If several health checks are defined for the same group of servers, -a single failure of any check will make the corresponding server be -considered unhealthy. +Если для группы задано несколько проверок, +то при любой неуспешной проверке соответствующий сервер будет +считаться неработоспособным. -This directive is available as part of our -commercial subscription. +Эта директива доступна как часть +коммерческой подписки. @@ -575,21 +575,21 @@ This directive is available as part of o -timeout +время 5s stream server -Overrides the +Переопределяет значение -value for health checks. +для проверок работоспособности. -This directive is available as part of our -commercial subscription. +Эта директива доступна как часть +коммерческой подписки. @@ -597,70 +597,73 @@ This directive is available as part of o -name +имя stream -Defines the named test set used to verify server responses to health checks. +Задаёт именованный набор тестов для для анализа ответов сервера +на запросы проверки работоспособности. -The following parameters can be configured: +Могут быть заданы следующие параметры: -send string; +send строка; -sends a string to the server; +отправляет строку на сервер; -expect string | +expect стока | ~ regex; -a literal string (1.9.12) or a regular expression -that the data obtained from the server should match. -The regular expression is specified with the preceding -“~*” modifier (for case-insensitive matching), or the -“~” modifier (for case-sensitive matching). +текстовая строка (1.9.12) или регулярное выражение, +которым должны соответствовать данные, полученные с сервера. +Регулярное выражение задаётся либо с модификатором +“~*” (для поиска совпадения без учёта регистра символов), +либо с модификатором “~” (с учётом регистра). -Both send and expect parameters -can contain hexadecimal literals with the prefix “\x” -followed by two hex digits, for example, “\x80” (1.9.12). +Параметры send и expect +могут содержать строки в шестнадцатеричном виде +с префиксом “\x” +и последующими двумя шестнадцатеричными цифрами, +например “\x80” (1.9.12). -Health check is passed if: +Проверка работоспособности считается успешной, если -the TCP connection was successfully established; +TCP-соединение успешно установлено; -the string from the send parameter, -if specified, was sent; +строка из параметра send +была отправлена (если была задана); -the data obtained from the server matched the string or regular expression -from the expect parameter, if specified; +данные, полученные от сервера, совпали со строкой или регулярным выражением +из параметра expect (если был задан); -the time elapsed does not exceed the value specified -in the directive. +истёкшее время не превышает значение, указанное +в директиве . -Example: +Пример: upstream backend { zone upstream_backend 10m; @@ -682,16 +685,16 @@ server { -Only the first - -bytes of data obtained from the server are examined. +Проверяются лишь первые байты данных +, +полученные от сервера. -This directive is available as part of our -commercial subscription. +Эта директива доступна как часть +коммерческой подписки.