{"id":796,"date":"2013-10-08T08:11:25","date_gmt":"2013-10-08T08:11:25","guid":{"rendered":"http:\/\/blog.zhukunqian.com\/?p=796"},"modified":"2013-10-08T08:16:22","modified_gmt":"2013-10-08T08:16:22","slug":"voltdb%e5%ae%89%e8%a3%85%e5%8f%8a%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/blog.zhukunqian.com\/?p=796","title":{"rendered":"voltdb\u5b89\u88c5\u53ca\u4f7f\u7528"},"content":{"rendered":"<p>1\u3001\u4e0b\u8f7dvoltdb\u540e\u76f4\u63a5\u89e3\u538b\uff1a<\/p>\n<pre>$ tar -zxvf LINUX-voltdb-ent-3.6.tar.gz<\/pre>\n<p>2\u3001\u4e24\u70b9\u6ce8\u610f\u4e8b\u9879\uff0c\u5207\u8bb0\u5207\u8bb0\uff1a<\/p>\n<pre class=\"brush: bash; gutter: true\">1.1.\r\n\r\nDisable Swapping\r\n\r\nSwapping is an operating system feature that optimizes memory usage when running multiple processes. However, memory is a critical component of the VoltDB server process. Any contention for memory, including swapping, will have a very negative impact on performance and functionality.\r\n\r\nWe recommend using dedicated servers and disabling swapping when running the VoltDB database server process. Use the swapoff command to disable swapping on Linux systems. If swapping cannot be disabled for any reason, you can reduce the likelihood of VoltDB being swapped out by setting the kernel parameter vm.swappiness to zero.<\/pre>\n<p>voltdb\u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u5e38\u9a7b\u5185\u5b58\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u4ea4\u6362\u5206\u533a(\u865a\u62df\u5185\u5b58)\u5b8c\u5168\u5173\u95ed\u3002\u53ef\u4ee5\u4f7f\u7528swapoff\u547d\u4ee4\u5173\u95ed\uff0c\u5982\u679c\u65e0\u6cd5\u4f7f\u7528swapoff\u547d\u4ee4\uff0c\u5219\u5c06\u5185\u6838\u53c2\u6570<code>vm.swappiness<\/code>\u4fee\u6539\u4e3a0\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">1.2.\r\n\r\nTurn off TCP segmentation offload and generic receive offload if cluster stability is a problem.\r\n\r\nThere is an issue where, under certain conditions, the use of TCP segmentation offload (TSO) and generic receive offload (GRO) can cause nodes to randomly drop out of a cluster. The symptoms of this problem are that nodes timeout \u2014 that is, the rest of the cluster thinks they have failed \u2014 although the node is still running and no other network issues (such as a network partition) are the cause.\r\n\r\nDisabling TSO and GRO is recommended for any VoltDB clusters that experience such instability. The commands to disable offloading are the following, where N is replaced by the number of the ethernet card:\r\n\r\nethtool -K ethN tso off\r\nethtool -K ethN gro off\r\n\r\nNote that these commands disable offloading temporarily. You must issue these commands every time the node reboots.<\/pre>\n<p>\u8fd9\u4e2a\u662f\u4f7f\u7528\u96c6\u7fa4\u65f6\u9700\u8981\u6ce8\u610f\u7684\u4e8b\u9879\u3002<\/p>\n<p>3\u3001\u5982\u679c\u662f\u65e7\u7248\u672c\u5347\u7ea7\u9700\u8981\u6309\u4ee5\u4e0b\u987a\u5e8f\u6267\u884c\uff1a<\/p>\n<pre class=\"brush: bash; gutter: true\">The process for upgrading VoltDB for a running database is as follows:\r\n\r\n    Place the database in admin mode using the @Pause system procedure (or VoltDB Enterprise Manager).\r\n\r\n    Perform a manual snapshot of the database (using @SnapShotSave).\r\n\r\n    Shutdown the database (using @Shutdown).\r\n\r\n    Upgrade VoltDB.\r\n\r\n    Recompile the application catalog using the new version of VoltDB.\r\n\r\n    Restart the database using the create option, the new catalog, and starting in admin mode (specified in the deployment file).\r\n\r\n    Restore the snapshot created in Step #2 (using voltadmin restore).\r\n\r\n    Return the database to normal operations (using voltadmin resume).<\/pre>\n<p>4\u3001\u5c06voltdb\u6dfb\u52a0\u81f3\u73af\u5883\u53d8\u91cf\u4e2d.<\/p>\n<pre class=\"brush: bash; gutter: true\">JAVA_HOME=\/opt\/jdk1.7.0_40\r\nVOLTDB_HOME=\/opt\/voltdb-3.5.0.1\r\nPATH=$PATH:$HOME\/bin:$JAVA_HOME\/bin:$VOLTDB_HOME\/bin\r\n\r\nexport JAVA_HOME VOLTDB_HOME PATH<\/pre>\n<p>5\u3001\u4ee5\u4e0b\u5f00\u59cb\u5b66\u4e60\u4f7f\u7528\u7b80\u5355\u7684voltdb\u547d\u4ee4\u3002<\/p>\n<p>\u5148\u521b\u5efa\u4e00\u4e2a\u6307\u5b9a\u76ee\u5f55\uff1ahelloworld<\/p>\n<p>\u5b9a\u4e49\u8868\u7ed3\u6784:<\/p>\n<pre class=\"brush: bash; gutter: true\">CREATE TABLE HELLOWORLD (\r\n   HELLO VARCHAR(15),\r\n   WORLD VARCHAR(15),\r\n   DIALECT VARCHAR(15) NOT NULL,\r\n   PRIMARY KEY (DIALECT)\r\n);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4e0b\u8f7dvoltdb\u540e\u76f4\u63a5\u89e3\u538b\uff1a $ tar -zxvf LINUX-voltd &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/blog.zhukunqian.com\/?p=796\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts\/796"}],"collection":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=796"}],"version-history":[{"count":3,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts\/796\/revisions"}],"predecessor-version":[{"id":798,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=\/wp\/v2\/posts\/796\/revisions\/798"}],"wp:attachment":[{"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhukunqian.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}