﻿{"id":863,"date":"2022-12-01T18:36:37","date_gmt":"2022-12-01T10:36:37","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=863"},"modified":"2022-12-12T15:44:26","modified_gmt":"2022-12-12T07:44:26","slug":"centos7%e5%ae%89%e8%a3%85sonarqube7-8","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=863","title":{"rendered":"Centos7\u5b89\u88c5Sonarqube7.8"},"content":{"rendered":"<p>\u80fd\u8fd0\u884c\u5728JDK8\u548cMySQL\u73af\u5883\u4e0b\u7684\u6700\u9ad8sonarqube\u7248\u672c\u662f7.8,\u7248\u672c\u57287.9\u4ee5\u4e0a\u7684\u90fd\u8981\u5b89\u88c5jdk11\u548cPostgreSQL\u4e86\u3002<\/p>\n<h1>\u4e0b\u8f7d<\/h1>\n<p>\u5230https:\/\/www.sonarqube.org\/downloads\/\u7f51\u7ad9\u4e0b\u8f7d\u5386\u53f2\u7248\u672c7.8\u7684zip\u538b\u7f29\u5305\uff0c<\/p>\n<h1>\u914d\u7f6e<\/h1>\n<h2>\u6570\u636e\u5e93\u94fe\u63a5<\/h2>\n<p>\u6253\u5f00sonar\u76ee\u5f55\u7684\/conf\/sonar.properties\u6587\u4ef6\uff0c\u627e\u5230\u5e76\u914d\u7f6e\uff1a<\/p>\n<pre class=\"lang:default mark:5-6,17 decode:true crayon-selected\"># User credentials.\n# Permissions to create tables, indices and triggers must be granted to JDBC user.\n# The schema must be created first.\nsonar.jdbc.username=\nsonar.jdbc.password=\n\n#----- Embedded Database (default)\n# H2 embedded database server listening port, defaults to 9092\n#sonar.embeddedDatabase.port=9092\n\n#----- DEPRECATED \n#----- MySQL &gt;=5.6 &amp;&amp; &lt;8.0\n# Support of MySQL is dropped in Data Center Editions and deprecated in all other editions\n# Only InnoDB storage engine is supported (not myISAM).\n# Only the bundled driver is supported. It can not be changed.\nsonar.jdbc.url=jdbc:mysql:\/\/localhost:3306\/sonar?useUnicode=true&amp;characterEncoding=utf8&amp;rewriteBatchedStatements=true&amp;useConfigs=maxPerformance&amp;useSSL=false\n<\/pre>\n<p>\u8bf7\u5728\u542f\u52a8\u524d\u63d0\u524d\u521b\u5efa\u597d\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u3002<\/p>\n<h2>\u521b\u5efa\u7528\u6237 Sonarqube\u5e76\u8bbe\u4e3a\u542f\u52a8\u8d26\u6237<\/h2>\n<pre class=\"lang:default decode:true\"># \u521b\u5efa\u7528\u6237\nuseradd sonar\n# \u914d\u7f6e\u5bc6\u7801\npasswd sonar\n# \u5c06\u76ee\u5f55\u6743\u9650\u7ed9\u4e88\u8be5\u7528\u6237\nchown -R sonar:sonar \/home\/sonarqube-7.8<\/pre>\n<p>\u7f16\u8f91sonar\u5b89\u88c5\u76ee\u5f55\u7684\/bin\/linux-x86-64\/sonar.sh\u6587\u4ef6\uff0c\u4fee\u6539\u7528\u6237\u4e3asonar<\/p>\n<pre class=\"lang:default mark:9 decode:true \"># If specified, the Wrapper will be run as the specified user.\n# IMPORTANT - Make sure that the user has the required privileges to write\n#  the PID file and wrapper.log files.  Failure to be able to write the log\n#  file will cause the Wrapper to exit without any way to write out an error\n#  message.\n# NOTE - This will set the user which is used to run the Wrapper as well as\n#  the JVM and is not useful in situations where a privileged resource or\n#  port needs to be allocated prior to the user being changed.\nRUN_AS_USER=sonar<\/pre>\n<h1>\u542f\u52a8Sonarqube<\/h1>\n<p>\u76f4\u63a5\u6267\u884c \/home\/sonarqube-7.8\/bin\/linux-x86-64\/sonar.sh console \u5c31\u53ef\u4ee5\u542f\u52a8 Sonarqube \uff0c\u5e76\u4e14\u76f4\u89c2\u7684\u770b\u5230\u542f\u52a8\u65e5\u5fd7\uff0c\u5efa\u8bae\u8c03\u8bd5\u671f\u95f4\u4f7f\u7528\u8be5\u547d\u4ee4\u542f\u52a8\u3002<\/p>\n<p>\u7b49\u8c03\u8bd5\u7ed3\u675f\uff0c\u542f\u52a8\u5b8c\u5168\u6ca1\u95ee\u9898\u4e86\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528 .\/sonar.sh console &amp; \u6765\u5b9e\u73b0\u540e\u53f0\u8fd0\u884c\uff0c\u6216\u8005\u76f4\u63a5 .\/sonar.sh start \u6765\u5feb\u901f\u542f\u52a8\u3002<\/p>\n<h3>\u67e5\u770b\u65e5\u5fd7<\/h3>\n<p>Sonarqube \u7684\u65e5\u5fd7\u76ee\u5f55\u4f4d\u4e8e \/home\/sonarqube-7.8\/log\/ \u76ee\u5f55\uff0c\u5206\u522b\u6709\uff1a<\/p>\n<ul>\n<li>access.log \u8bbf\u95ee\u6743\u9650\u76f8\u5173\u65e5\u5fd7<\/li>\n<li>ce.log \u4e0d\u77e5\u9053\u5565\u65e5\u5fd7\uff0c\u5e94\u8be5\u6ca1\u7528<\/li>\n<li>sonar.log \u4e3b\u4f53\u65e5\u5fd7\uff0c\u4f7f\u7528 console \u547d\u4ee4\u542f\u52a8\u8f93\u51fa\u7684\u65e5\u5fd7\u6765\u81ea\u8be5\u6587\u4ef6<\/li>\n<li>es.log \u4f9d\u8d56\u7684 Elasticsearch \u542f\u52a8\u65f6\u8f93\u51fa\u7684\u65e5\u5fd7<\/li>\n<li>web.log \u4e3b\u4f53 Web \u9879\u76ee\u8f93\u51fa\u7684\u65e5\u5fd7<\/li>\n<\/ul>\n<p>\u5728\u914d\u7f6e Sonarqube \u65f6\uff0c\u96c6\u4e2d\u5173\u6ce8 es.log \u548c web.log \u5373\u53ef\u3002<\/p>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">sonarQube\u5b89\u88c5\u4e2d\u6587\u63d2\u4ef6<\/h2>\n\n\n\n<p>\u8bbf\u95ee\u4e2d\u6587\u63d2\u4ef6\u7684\u7f51\u5740\u5e76\u67e5\u770b\u5bf9\u5e94sonar\u7248\u672c\u7684\u4e2d\u6587\u63d2\u4ef6\u7248\u672c\uff1a<a href=\"https:\/\/github.com\/xuhuisheng\/sonar-l10n-zh\">https:\/\/github.com\/xuhuisheng\/sonar-l10n-zh<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"784\" height=\"927\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-7.png\" alt=\"\" class=\"wp-image-920\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-7.png 784w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-7-254x300.png 254w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-7-768x908.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/a><\/figure>\n\n\n\n<p>\u5bf9\u5e94sonar7.8\u7684\u662f\u8fd9\u4e2a\u94fe\u63a5\uff1ahttps:\/\/github.com\/xuhuisheng\/sonar-l10n-zh\/releases\/tag\/sonar-l10n-zh-plugin-1.28<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u5bf9\u5e94\u7684jar\u6587\u4ef6\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"446\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-8.png\" alt=\"\" class=\"wp-image-921\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-8.png 641w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2022\/12\/image-8-300x209.png 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/a><\/figure>\n\n\n\n<p>\u7136\u540e\u5c06jar\u5305\u4e0a\u4f20\u5230\u81ea\u5df1sonar\u9879\u76ee\u5b89\u88c5\u7684extensions\/plugins\/\u4e0b\uff0c\u5e76\u91cd\u542fsonarqube\u5373\u53ef\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5176\u4ed6<\/h2>\n\n\n\n<p>sonar\u7684\u9ed8\u8ba4\u7aef\u53e3\u662f9000\uff0c\u9ed8\u8ba4\u8d26\u53f7\u548c\u5bc6\u7801\u662fadmin\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80fd\u8fd0\u884c\u5728JDK8\u548cMySQL\u73af\u5883\u4e0b\u7684\u6700\u9ad8sonarqube\u7248\u672c\u662f7.8,\u7248\u672c\u57287.9\u4ee5\u4e0a\u7684\u90fd\u8981\u5b89\u88c5jdk11\u548c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-863","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=863"}],"version-history":[{"count":4,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/863\/revisions"}],"predecessor-version":[{"id":933,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/863\/revisions\/933"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=863"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}