{"id":168279,"date":"2024-11-06T11:03:18","date_gmt":"2024-11-06T03:03:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/168279\/"},"modified":"2024-11-06T11:03:19","modified_gmt":"2024-11-06T03:03:19","slug":"%e6%a2%85%e7%a7%91%e7%88%behos-opengauss%e6%95%b8%e6%93%9a%e5%ba%ab%e5%ae%89%e8%a3%9d%e4%bd%bf%e7%94%a8%ef%bc%88openeuler%e4%bc%ba%e6%9c%8d%e5%99%a8%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/168279\/","title":{"rendered":"\u6885\u79d1\u723eHOS-openGauss\u6578\u64da\u5eab\u5b89\u88dd\u4f7f\u7528\uff08openEuler\u4f3a\u670d\u5668\uff09"},"content":{"rendered":"<h1 id=\"%e6%a2%85%e7%a7%91%e7%88%behos-opengauss%e6%95%b8%e6%93%9a%e5%ba%ab%e5%ae%89%e8%a3%9d%e4%bd%bf%e7%94%a8%ef%bc%88openeuler%e4%bc%ba%e6%9c%8d%e5%99%a8%ef%bc%89-WWaFHADdOq\">\u6885\u79d1\u723eHOS-openGauss\u6578\u64da\u5eab\u5b89\u88dd\u4f7f\u7528\uff08openEuler\u4f3a\u670d\u5668\uff09<\/h1>\n<p>\u96a8\u8457\u6578\u64da\u5eab\u6280\u8853\u7684\u5feb\u901f\u767c\u5c55\uff0c\u8d8a\u4f86\u8d8a\u591a\u7684\u4f01\u696d\u9078\u64c7\u4f7f\u7528\u958b\u6e90\u6578\u64da\u5eab\u4f86\u6eff\u8db3\u5176\u696d\u52d9\u9700\u6c42\u3002\u6885\u79d1\u723eHOS-openGauss\u662f\u4e00\u6b3e\u57fa\u65bcPostgreSQL\u7684\u958b\u6e90\u6578\u64da\u5eab\uff0c\u5c08\u70ba\u4f01\u696d\u7d1a\u61c9\u7528\u800c\u8a2d\u8a08\uff0c\u5177\u6709\u9ad8\u53ef\u7528\u6027\u3001\u9ad8\u6027\u80fd\u548c\u9ad8\u64f4\u5c55\u6027\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728openEuler\u4f3a\u670d\u5668\u4e0a\u5b89\u88dd\u548c\u4f7f\u7528openGauss\u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"%e4%b8%80%e3%80%81%e7%92%b0%e5%a2%83%e6%ba%96%e5%82%99-WWaFHADdOq\">\u4e00\u3001\u74b0\u5883\u6e96\u5099<\/h2>\n<p>\u5728\u5b89\u88ddopenGauss\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u6e96\u5099\u597d\u76f8\u61c9\u7684\u74b0\u5883\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6240\u9700\u7684\u57fa\u672c\u689d\u4ef6\uff1a<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7d71\uff1aopenEuler 20.09\u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<li>CPU\uff1a\u81f3\u5c112\u6838<\/li>\n<li>\u5167\u5b58\uff1a\u81f3\u5c114GB<\/li>\n<li>\u78c1\u789f\u7a7a\u9593\uff1a\u81f3\u5c1120GB<\/li>\n<\/ul>\n<p>\u78ba\u4fdd\u4f3a\u670d\u5668\u5df2\u7d93\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\uff0c\u4e26\u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\uff1a<\/p>\n<pre><code>sudo yum update -y\nsudo yum install -y gcc gcc-c++ make cmake<\/code><\/pre>\n<h2 id=\"%e4%ba%8c%e3%80%81%e4%b8%8b%e8%bc%89opengauss-WWaFHADdOq\">\u4e8c\u3001\u4e0b\u8f09openGauss<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u5f9e\u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09openGauss\u7684\u5b89\u88dd\u5305\u3002\u53ef\u4ee5\u4f7f\u7528wget\u547d\u4ee4\u4f86\u4e0b\u8f09\uff1a<\/p>\n<pre><code>wget https:\/\/opengauss.org\/download\/openGauss-.tar.gz<\/code><\/pre>\n<p>\u8acb\u5c07\u66ff\u63db\u70ba\u6700\u65b0\u7684\u7248\u672c\u865f\u3002\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u89e3\u58d3\u7e2e\u5b89\u88dd\u5305\uff1a<\/p>\n<pre><code>tar -zxvf openGauss-.tar.gz<\/code><\/pre>\n<h2 id=\"%e4%b8%89%e3%80%81%e5%ae%89%e8%a3%9dopengauss-WWaFHADdOq\">\u4e09\u3001\u5b89\u88ddopenGauss<\/h2>\n<p>\u9032\u5165\u89e3\u58d3\u5f8c\u7684\u76ee\u9304\uff0c\u57f7\u884c\u5b89\u88dd\u8173\u672c\uff1a<\/p>\n<pre><code>cd openGauss-\nsudo .\/install.sh<\/code><\/pre>\n<p>\u5b89\u88dd\u904e\u7a0b\u4e2d\uff0c\u7cfb\u7d71\u6703\u63d0\u793a\u60a8\u8a2d\u7f6e\u6578\u64da\u5eab\u7684\u7ba1\u7406\u54e1\u5bc6\u78bc\uff0c\u8acb\u59a5\u5584\u8a18\u9304\u3002<\/p>\n<h2 id=\"%e5%9b%9b%e3%80%81%e9%85%8d%e7%bd%aeopengauss-WWaFHADdOq\">\u56db\u3001\u914d\u7f6eopenGauss<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u9700\u8981\u9032\u884c\u57fa\u672c\u7684\u914d\u7f6e\u3002\u9996\u5148\uff0c\u5275\u5efa\u6578\u64da\u5eab\u7528\u6236\u548c\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>sudo -u gaussdb gsql -d postgres -p 5432 -c \"CREATE USER myuser WITH PASSWORD 'mypassword';\"\nsudo -u gaussdb gsql -d postgres -p 5432 -c \"CREATE DATABASE mydb OWNER myuser;\"<\/code><\/pre>\n<p>\u9019\u88e1\uff0cmyuser\u662f\u65b0\u7528\u6236\u540d\uff0cmypassword\u662f\u7528\u6236\u5bc6\u78bc\uff0cmydb\u662f\u65b0\u6578\u64da\u5eab\u540d\u3002\u6839\u64da\u9700\u8981\u9032\u884c\u76f8\u61c9\u7684\u4fee\u6539\u3002<\/p>\n<h2 id=\"%e4%ba%94%e3%80%81%e5%95%9f%e5%8b%95opengauss-WWaFHADdOq\">\u4e94\u3001\u555f\u52d5openGauss<\/h2>\n<p>\u914d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u555f\u52d5openGauss\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>sudo systemctl start gaussdb<\/code><\/pre>\n<p>\u8981\u6aa2\u67e5\u6578\u64da\u5eab\u7684\u904b\u884c\u72c0\u614b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo systemctl status gaussdb<\/code><\/pre>\n<h2 id=\"%e5%85%ad%e3%80%81%e9%80%a3%e6%8e%a5opengauss-WWaFHADdOq\">\u516d\u3001\u9023\u63a5openGauss<\/h2>\n<p>\u4f7f\u7528gsql\u547d\u4ee4\u884c\u5de5\u5177\u9023\u63a5\u5230\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>gsql -d mydb -U myuser -p 5432<\/code><\/pre>\n<p>\u5982\u679c\u9023\u63a5\u6210\u529f\uff0c\u60a8\u5c07\u770b\u5230gsql\u63d0\u793a\u7b26\uff0c\u9019\u610f\u5473\u8457\u60a8\u5df2\u7d93\u6210\u529f\u9023\u63a5\u5230openGauss\u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"%e4%b8%83%e3%80%81%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c%e7%a4%ba%e4%be%8b-WWaFHADdOq\">\u4e03\u3001\u57fa\u672c\u64cd\u4f5c\u793a\u4f8b<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684SQL\u64cd\u4f5c\u793a\u4f8b\uff1a<\/p>\n<pre><code>-- \u5275\u5efa\u8868\nCREATE TABLE test_table (\n    id SERIAL PRIMARY KEY,\n    name VARCHAR(100) NOT NULL\n);\n\n-- \u63d2\u5165\u6578\u64da\nINSERT INTO test_table (name) VALUES ('Alice'), ('Bob');\n\n-- \u67e5\u8a62\u6578\u64da\nSELECT * FROM test_table;<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-WWaFHADdOq\">\u7e3d\u7d50<\/h2>\n<p>\u672c\u6587\u4ecb\u7d39\u4e86\u5982\u4f55\u5728openEuler\u4f3a\u670d\u5668\u4e0a\u5b89\u88dd\u548c\u4f7f\u7528\u6885\u79d1\u723eHOS-openGauss\u6578\u64da\u5eab\u3002\u901a\u904e\u7c21\u55ae\u7684\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u5feb\u901f\u642d\u5efa\u4e00\u500b\u9ad8\u6548\u7684\u6578\u64da\u5eab\u74b0\u5883\uff0c\u6eff\u8db3\u4f01\u696d\u7684\u6578\u64da\u5b58\u5132\u548c\u7ba1\u7406\u9700\u6c42\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u652f\u6301\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u6216<a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\u4f86\u904b\u884c\u60a8\u7684openGauss\u6578\u64da\u5eab\uff0c\u78ba\u4fdd\u696d\u52d9\u7684\u9ad8\u53ef\u7528\u6027\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728openEuler\u4f3a\u670d\u5668\u4e0a\u5b89\u88dd\u548c\u4f7f\u7528\u6885\u79d1\u723eHOS-openGauss\u6578\u64da\u5eab\uff0c\u63d0\u5347\u6578\u64da\u7ba1\u7406\u6548\u7387\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-168279","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=168279"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168279\/revisions"}],"predecessor-version":[{"id":168280,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168279\/revisions\/168280"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=168279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=168279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=168279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}