{"id":254210,"date":"2015-03-31T20:10:01","date_gmt":"2015-03-31T16:10:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=254210"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=254210","title":{"rendered":"Tarantool 1.6 \u2014 \u0434\u0430\u0432\u0430\u0439 \u043d\u0430\u0447\u043d\u0435\u043c"},"content":{"rendered":"<p> \t\t\t\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e NoSQL \u0431\u0430\u0437\u0435 \u2014 <a href=\"http:\/\/habrahabr.ru\/company\/mailru\/blog\/252065\/\">\u00abTarantool 1.6 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043b\u0438\u0446\u0430\u00bb<\/a>. \u0423\u0432\u0435\u0440\u0435\u043d, \u0432 \u0441\u0432\u043e\u0438\u0445 \u043a\u0440\u0443\u0433\u0430\u0445 \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0438 \u0443\u0436\u0435 \u0437\u0430\u0432\u043e\u0451\u0432\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c. \u0423\u0432\u0435\u0440\u0435\u043d \u0442\u0430\u043a \u0436\u0435 \u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0435 <s>\u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435,<\/s> <s>\u0440\u0443\u043a\u0438 \u043d\u0435 \u0434\u043e\u0448\u043b\u0438<\/s>, \u043a\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Tarantool \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0445 \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c. \u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0432\u0435\u0440\u0441\u0438\u0438 Tarantool 1.6.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>Install<\/h4>\n<p>  \u041d\u0430 <a href=\"http:\/\/tarantool.org\">\u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u0414\u043b\u044f Ubuntu \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">wget http:\/\/tarantool.org\/dist\/public.key sudo apt-key add .\/public.key release=`lsb_release -c -s`  cat &gt; \/etc\/apt\/sources.list.d\/tarantool.list &lt;&lt;- EOF deb http:\/\/tarantool.org\/dist\/master\/ubuntu\/ $release main deb-src http:\/\/tarantool.org\/dist\/master\/ubuntu\/ $release main EOF  sudo apt-get update sudo apt-get install tarantool <\/code><\/pre>\n<p>  <\/p>\n<h4>Hello world!<\/h4>\n<p>  Tarantool \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Lua \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (Lua 5.1 \u043d\u0430 \u0431\u0430\u0437\u0435 on LuaJIT 2.0). \u042f\u0437\u044b\u043a lua \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/zserge.wordpress.com\/2012\/02\/23\/lua-%D0%B7%D0%B0-60-%D0%BC%D0%B8%D0%BD%D1%83%D1%82\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438\u043b\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0432 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/184538\/\">\u00abLua \u0437\u0430 15 \u043c\u0438\u043d\u0443\u0442\u00bb<\/a>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Tarantool \u043a\u0430\u043a Lua \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440.<\/p>\n<pre><code class=\"bash\">$ \/usr\/bin\/tarantool \/usr\/bin\/tarantool: version 1.6.4-509-ga4af00e type 'help' for interactive help tarantool&gt; 2 + 3 --- - 5 ... tarantool&gt; print ('Ola lua!') Ola lua! --- ... <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Lua. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 init.lua \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Tarantool \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 &#8216;Hello world&#8217;. <\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a tarantool \u2014 <a href=\"http:\/\/tarantool.org\/doc\/book\/box\/index.html#packages-of-the-box-library\">box<\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e box.cfg (\u0432 lua {&#8230;} \u2014 \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430) \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<pre><code class=\"lua\">box.cfg {     listen = 3311,     logger = 'tarantool.log', }  <\/code><\/pre>\n<p>  Tarantool \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043f\u043e\u0440\u0442 3311 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 tarantool.log:<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e hello()  <\/p>\n<pre><code class=\"lua\">local function hello()     print ('Hello world!) end  hello() <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0432\u0438\u0434\u0438\u043c:<\/p>\n<pre><code class=\"lua\">$ tarantool init.lua  Hello world! <\/code><\/pre>\n<p>  <\/p>\n<h4>Data Base<\/h4>\n<p>  \u0412 tarantool \u043a\u043e\u0440\u0442\u0435\u0436\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u0445 (space) \u2014 \u043d\u0435\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 space \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 (primary) \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 \u043d\u0435\u043c (\u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044f\u043c \u0437\u0430\u043f\u0438\u0441\u0438), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432:<\/p>\n<pre><code class=\"lua\">s = box.schema.space.create('test') p = s:create_index('primary', {type = 'tree', parts = {1, 'NUM'}}) <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c test \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0432\u0438\u0434\u0430 {key, number}:<\/p>\n<pre><code class=\"lua\">for i = 1, 10 do     s:insert({i, i}) end  <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 s \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 box.space.test. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<pre><code class=\"lua\">box.space.test:insert({i, i}) <\/code><\/pre>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 tarantool:<\/p>\n<pre><code class=\"bash\">$ tarantool init.lua  Hello world! main\/101\/init.lua F&gt; Space 'test' already exists <\/code><\/pre>\n<p>  Tarantool \u0445\u0440\u0430\u043d\u0438\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u043b\u044f \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438 Tarantool \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043d\u0438\u043c\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 (snapshot) \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 (xlog). \u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 Tarantool \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0439\u043b\u043e\u0432 .snap (\u0441\u043d\u0438\u043c\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f) \u0438 .xlog (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0430\u0448 test space \u0443\u0436\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0431\u0430\u0437\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c .snap \u0438 .xlog \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u0438\u043b\u0438 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430.<\/p>\n<pre><code class=\"lua\">s =  box.space.test if not s then     s = box.schema.space.create('test')     p = s:create_index('primary', {type = 'tree', parts = {1, 'NUM'}})     for i = 1, 10 do         s:insert({i, i})     end end <\/code><\/pre>\n<p>  \u0411\u044b\u043b\u043e \u0431\u044b \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u043b\u0438 \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u0448\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c Tarantool. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430. \u0412\u043e\u043e\u0431\u0449\u0435, \u0432 lua \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u043a\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c require.<\/p>\n<pre><code class=\"lua\">local console = require('console') console.listen(127.0.0.1:3312) <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Tarantool \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 3312 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0442\u0438\u043b\u0438\u0442 nc\/telnet \u0438 rlwrap (\u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b). \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432\u0448\u0438\u0441\u044c, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Tarantool. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 test:<\/p>\n<pre><code class=\"bash\">$ rlwrap nc 0 3312 Tarantool 1.6.4-509-ga4af00e (Lua console)                      type 'help' for interactive help                                box.space.test:select() --- - - [1, 1]   - [2, 2]   - [3, 3]   - [4, 4]   - [5, 5]   - [6, 6]   - [7, 7]   - [8, 8]   - [9, 9]   - [10, 10] ... box.space.test:get(6) --- - [6, 6] ... <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e Tarantool:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">box.cfg<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">box.cfg --- - snapshot_count: 6   too_long_threshold: 0.5   slab_alloc_factor: 2   slab_alloc_maximal: 1048576   background: false   logger: tarantool.log   slab_alloc_arena: 1   sophia:     page_size: 131072     threads: 5     node_size: 134217728     memory_limit: 0   listen: '3311'   logger_nonblock: true   snap_dir: .   coredump: false   sophia_dir: .   wal_mode: write   slab_alloc_minimal: 64   panic_on_snap_error: true   panic_on_wal_error: true   rows_per_wal: 500000   wal_dir: .   log_level: 5   readahead: 16320   snapshot_period: 0   wal_dir_rescan_delay: 0.1 ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u043e\u0437\u0434\u0430\u0432 space \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443: \u0432 \u0437\u0430\u043f\u0438\u0441\u044f\u0445 \u0441 \u043a\u043b\u044e\u0447\u043e\u043c &gt; 5 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u0447\u0438c\u043b\u0430 \u043d\u0430 10.<br \/>  \u0414\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"http:\/\/tarantool.org\/doc\/book\/box\/box_index.html\">box.index<\/a>.<\/p>\n<pre><code class=\"lua\">for k,v in box.space.test.index.primary:pairs(5, {iterator = box.index.GT}) do    s:update(v[1], {{'=', 2, v[2] + 10}}) end <\/code><\/pre>\n<p>  box.space.index.primary \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c test \u0438 \u0435\u0433\u043e primary \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c.<br \/>  pairs() \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f k \u0432 \u0446\u0438\u043a\u043b\u0435) \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 v), \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430(5) \u2014 \u0441\u0442\u0430\u0440\u0442\u0430 \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0438\u043f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<br \/>  iterator = box.index.GT \u2014 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440 GT (greater) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e.<br \/>  update() \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0431\u0430\u0437\u0435, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 (v[1]), <br \/>  {&#8216; = &#8216;, 2, v[2] + 10} \u2014 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 (&#8216;=&#8217;) \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 v[2] + 10.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e space:<\/p>\n<pre><code class=\"bash\">box.space.test:select() --- - - [1, 1]   - [2, 2]   - [3, 3]   - [4, 4]   - [5, 5]   - [6, 16]   - [7, 17]   - [8, 18]   - [9, 19]   - [10, 20] ... <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e init.lua \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">-- \u041f\u0440\u0438\u043c\u0435\u0440 init c\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f tarantool  -- \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 -- \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 local console = require('console')  -- \u0421\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u044c console.listen('127.0.0.1:3312')  -- \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f tarantool box.cfg {     listen = 3311,     logger = 'tarantool.log', }  local function hello()     print ('Hello world!') end  -- \u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 hello hello()  -- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 space, \u0435\u0441\u043b\u0438 \u043e\u043d \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 s =  box.space.test if not s then     s = box.schema.space.create('test')     -- \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441     p = s:create_index('primary', {type = 'tree', parts = {1, 'NUM'}})     for i = 1, 10 do         s:insert({i, i})     end end  -- \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u043c \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u044f\u0445, \u0433\u0434\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0431\u043e\u043b\u044c\u0448\u0435 5 for k,v in box.space.test.index.primary:pairs(5, {iterator = box.index.GT}) do    s:update(v[1], {{'=', 2, v[2] + 10}}) end  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c Tarantool, \u0437\u043d\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438, \u043d\u0443\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u0435\u0434\u044c \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u0441\u0435\u0433\u043e Tarantool \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0435\u0449\u0435 \u0438 lua application server. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/tarantool\/http\">http \u0441\u0435\u0440\u0432\u0435\u0440<\/a> \u0438 <a href=\"https:\/\/github.com\/tarantool\/queue\">\u043e\u0447\u0435\u0440\u0435\u0434\u0438<\/a>. \u041d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0441\u0434\u0435\u043b\u0430\u043d \u2014 \u0441\u0432\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f Tarantool \u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438.<\/p>\n<p>  \u0415\u0449\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e Tarantool (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0442\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435:<br \/>  <a href=\"http:\/\/habrahabr.ru\/company\/mailru\/blog\/192076\/\">\u00ab\u0418\u0437\u0443\u0447\u0430\u0435\u043c Tarantool + Lua\u00bb<\/a>,<br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/133435\/\">\u00ab\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Tarantool\u00bb<\/a>.<\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Tarantool \u043d\u0430 <a href=\"http:\/\/try.tarantool.org\/\">try.tarantool.org<\/a>. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/254533\/\"> http:\/\/habrahabr.ru\/post\/254533\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> \t\t\t\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e NoSQL \u0431\u0430\u0437\u0435 \u2014 <a href=\"http:\/\/habrahabr.ru\/company\/mailru\/blog\/252065\/\">\u00abTarantool 1.6 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043b\u0438\u0446\u0430\u00bb<\/a>. \u0423\u0432\u0435\u0440\u0435\u043d, \u0432 \u0441\u0432\u043e\u0438\u0445 \u043a\u0440\u0443\u0433\u0430\u0445 \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0438 \u0443\u0436\u0435 \u0437\u0430\u0432\u043e\u0451\u0432\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c. \u0423\u0432\u0435\u0440\u0435\u043d \u0442\u0430\u043a \u0436\u0435 \u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0435 <s>\u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435,<\/s> <s>\u0440\u0443\u043a\u0438 \u043d\u0435 \u0434\u043e\u0448\u043b\u0438<\/s>, \u043a\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c Tarantool \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0449\u0438\u0445 \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c. \u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0432\u0435\u0440\u0441\u0438\u0438 Tarantool 1.6.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-254210","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=254210"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254210\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}