sonar安装问题记录
1、启动时日志中提示
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
错误原因:因为安全问题elasticsearch 不让用root用户直接运行
解决方法:liunx创建新用户sonarUser,使用该用户(sonarUser)运行sonar即可。
步骤:
1、创建用户
[root@iZbp1bb2egi7w0ueys548qZ logs]# adduser sonarUser
2、设置密码,输入两次密码
[root@iZbp1bb2egi7w0ueys548qZ logs]# passwd sonarUser
3、进入到sonarqube-6.7.6目录的上一级更改sonarqube目录的用户组为sonarUser
[root@bogon local]# chown -R sonarUser:sonarUser sonarqube-6.7.
4、重新启动sonar,要使用新建的用户启动
su sonarUser ./sonar.sh restart
2、启动时提示端口占用
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to [9001]]; nested: BindException[Address already in use];
Caused by: java.net.BindException: Address already in use
原因:sonarqube需要使用9000端口,elasticsearch使用的是9001端口,但是Jenkins把9001端口占用了
解决:修改sonar.properties文件的ES端口,或者Jenkins端口修改为8082
3、修改完上面的问题后启动提示:没有权限
Caused by: java.io.IOException: Cannot run program "/usr/local/jdk1.8.0_191/jre/bin/java" (in directory "/usr/local/sonarqube-6.7.6"): error=, Permission denied
解决:修改目录权限
chmod /usr/local/jdk1..0_191/jre/bin/java
再次启动,没有报错,访问一下

4、报错:ERROR: Please provide compiled classes of your project with sonar.java.binaries property
原因:最新版本的sonarQube6.5只能扫描class文件
解决:新版本的需要在项目根目录下的sonar-project.properties文件新增属性sonar.java.binaries
指定class编译路径
# must be unique in a given SonarQube instance
sonar.projectKey=cynomys:0.0.
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=cynomys
sonar.projectVersion=0.0. # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=.
sonar.exclusions=**/test/**,**/target/** sonar.java.source=1.8
sonar.java.target=1.8 # Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.java.binaries=/root/.jenkins/workspace/e-content/e-content-controller/target/classes
5、运行一段时间后服务挂掉
查看sonar.log日志
[root@bogon logs]# tail -f sonar.log
at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:)
at org.sonar.application.App.start(App.java:)
at org.sonar.application.App.main(App.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:)
at java.lang.Thread.run(Thread.java:)
<-- Wrapper Stopped --> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.) http://wrapper.tanukisoftware.org
Copyright - Tanuki Software, Inc. All Rights Reserved. 2019.05. :: INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /usr/local/sonarqube-7.4/temp WrapperSimpleApp: Encountered an error running main: java.nio.file.AccessDeniedException: /usr/local/sonarqube-7.4/temp/conf/es/elasticsearch.yml
java.nio.file.AccessDeniedException: /usr/local/sonarqube-7.4/temp/conf/es/elasticsearch.yml
提示这个文件访问没有权限:java.nio.file.AccessDeniedException: /usr/local/sonarqube-7.4/temp/conf/es/elasticsearch.yml
原来是之前可能不小心用root启动过会创建temp目录,该目录为root用户所有,当使用自己创建的sonarUser用户启动时就会报错,
解决:
修改此目录的所属用户组
chown -R sonarUser:sonarUser /usr/local/sonarqube-7.4/temp
sonar安装问题记录的更多相关文章
- 安装jessie记录
// */ // ]]> 安装jessie记录 Table of Contents 1 引言 2 目标 3 usb安装 4 无线网卡 5 代理上网 6 rabbitvcs 7 locale ...
- Ubuntu14.04 Tomcat 安装过程记录
Ubuntu14.04 Tomcat 安装过程记录 检查java的版本 zhousp@ubuntu:~$ sudo java -version [sudo] password for zhousp: ...
- Sonar安装与使用说明
我总结的Sonar安装与使用说明,需要的可以去网盘下载. 网盘地址: http://pan.baidu.com/s/199BII
- FastDFS安装全过程记录(V5.05)
FastDFS安装全过程记录 1.安装准备 HA虚拟IP:192.168.1.208 HA软件:Keepalived 操作系统:CentOS 7 用户:root 数据目录:/data/fastdfs ...
- openvswitch 2.7 安装过程记录 总结
envswitch 2.7 安装过程记录 总结 安装思路是参考文档: http://docs.openvswitch.org/en/latest/intro/install/general/#obta ...
- CentOS 7下安装vertica记录
CentOS 7下安装vertica记录 1. 安装好centeros 并更新 Centeros安装就不说了,安装完之后联网环境下 yum update.更新下,使得那些包都是新的.(要想用中文 ...
- ubuntu 1604安装docker-ce 记录
以前在linux 内核为2.x的低版本中安装过docker,但是很多功能特性都无法使用,本次是在ubuntu 16.04上安装,记录安装过程,方便后续查阅. 一.安装前准备: 1. 安装包,允许 ap ...
- Centos 7 安装Docker-ce记录
以前尝试过在centos 6上安装Docker , 需要升级内核,支持aufs,比较麻烦:在使用过程中出现过Docker挂掉的情况,官方建议在64 位 centos 7 上运行,本文将安装步骤记录下来 ...
- findbug、p3c、checkstyle、sonar安装使用
idea插件安装方式: Preferences—>Plugins—>查找插件—>Install Preferences—>Plugins—>Install plug fr ...
随机推荐
- Android Studio 无法预览布局问题:com/android/util/PropertiesMap
应该是API版本太高,换成较低的就好了 API24,无法预览 换成22就没事了 Android Studio要比Eclipse好用很多,虽然Eclipse现在可以直接安装Android开发板,但AS界 ...
- TreeGrid
TreeGrid是树形表格,为了展示成树形,比数据表格主要增加了以下两点: 1.表格属性中设置 idField.treeField 两个属性:idField 表示用于区分上下级的主键,treeFiel ...
- 获取用户的相关请求信息, 以及包括请求头 request.environ
#在index文件中 1. print(type(request)) #看出所属库 2. from django.core.handlers.wsgi import WSGIRequest #查看WS ...
- (halcon) derivate_vector_field
derivate_vector_field: Convolve a vector field with derivatives of the Gaussian 用高斯导数卷积向量场 derivate_ ...
- 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 15—Anomaly Detection异常检测
Lecture 15 Anomaly Detection 异常检测 15.1 异常检测问题的动机 Problem Motivation 异常检测(Anomaly detection)问题是机器学习算法 ...
- Linux实战教学笔记28:企业级LNMP环境应用实践
一,LNMP应用环境 1.1 LNMP介绍 大约在2010年以前,互联网公司最常用的经典Web服务环境组合就是LAMP(即Linux,Apache,MySQL,PHP),近几年随着Nginx Web服 ...
- Stencil
[Stencil] The stencil buffer can be used as a general purpose per pixel mask for saving or discardin ...
- 【POJ1811】Prime Test
[题目大意] 若n是素数,输出“Prime”,否则输出n的最小素因子,(n<=2^54) [题解] 和bzoj3667差不多,知识这道题没那么坑. 直接上Pollord_Rho和Rabin_Mi ...
- ORACLE修改表空间方法
一.使用imp/exp.先导出源库,再创建新库把表空间创建好,然后再导入.(据说这样可以,前提是新的库里面不能有与源库相同名字的表空间.有待验证!) 二.使用脚本进行修改.据目前所了解,正长情况下需要 ...
- Python爬虫实战二之爬取百度贴吧帖子
大家好,上次我们实验了爬取了糗事百科的段子,那么这次我们来尝试一下爬取百度贴吧的帖子.与上一篇不同的是,这次我们需要用到文件的相关操作. 前言 亲爱的们,教程比较旧了,百度贴吧页面可能改版,可能代码不 ...