【Linux运维入门】安装sonar报错:JDBCError: Specified key was too long;
来源:互联网 发布:wenger淘宝 编辑:程序博客网 时间:2024/06/07 18:34
安装完SonarQ ube后,输入网址http://192.168.xx.xxx:9000 可以访问Sonar的页面。但是我却出现了一个问题:
错误一:
org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled:ActiveRecord::JDBCError: Specified key was too long; max key length is 1000 bytes: CREATE UNIQUE INDEX `rules_repo_key` ON `rules` (`plugin_rule_key`, `plugin_name`) from /usr/local/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log' from /usr/local/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up' from /usr/local/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'. ..ActiveRecord::JDBCError: Specified key was too long; max key length is 1000 bytes: CREATE UNIQUE INDEX `rules_repo_key` ON `rules` (`plugin_rule_key`, `plugin_name`)
错误原因:
Sonar在MySQL中对表建立索引时,key的长度超过1000 bytes了,由于MySQL默认使用MyISAM engine,而MyLSAM引擎会有key长度的限制,超过1000bytes就会报错,所以要将Mysql引擎修改为Innodb。
解决方式:
①. 查看是否有Innodb引擎
②. 查看是否支持动态载入动态链接库,yes表示支持。
③. 安装
查看是否安装成功。
⑤. 修改my.cnf配置文件:
default-storage-engine=INNODB# Uncomment the following if you are using InnoDB tablesinnodb_data_home_dir = /usr/local/varinnodb_data_file_path = ibdata1:10M:autoextendinnodb_log_group_home_dir = /usr/local/var# You can set .._buffer_pool_size up to 50 - 80 %# of RAM but beware of setting memory usage too highinnodb_buffer_pool_size = 256Minnodb_additional_mem_pool_size = 20M# Set .._log_file_size to 25 % of buffer pool sizeinnodb_log_file_size = 64Minnodb_log_buffer_size = 8Minnodb_flush_log_at_trx_commit = 1innodb_lock_wait_timeout = 50
然后删除刚才自动创建的数据库sonar,重启sonar。这次应该就没问题了。
但是,又报了个错:
错误二:
org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled:ActiveRecord::JDBCError: Binary logging not possible. Message: Transaction level 'READ-UNCOMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT': INSERT INTO schema_migrations (version) VALUES ('710') from /usr/local/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log' from /usr/local/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:212:in `log' from /usr/local/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:490:in `migrate' from org/jruby/RubyArray.java:1613:in `each' from /usr/local/sonarqube/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:477:in `migrate'... from file:/usr/local/sonarqube/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails/environment2.rb:25:in `load_environment' from file:/usr/local/sonarqube/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/rails_booter.rb:79:in `load_environment'
错误原因:
innodb和binlog不兼容引起的,需要将binlog修改为混合模式。
解决方式:
修改my.cnf配置文件:
#binlog_format=mixed
把注释#号去掉,重启mysql,删除sonar数据库,重启sonar即可。
这次就没问题了,访问 http://192.168.xx.xxx:9000 ,就会出现sonar的界面。
1 0
- 【Linux运维入门】安装sonar报错:JDBCError: Specified key was too long;
- Specified key was too long
- mysql报错:Specified key was too long; max key length is 767 bytes
- laravel Specified key was too long 解决方案
- hive shell执行命令报错:Specified key was too long; max key length is 767 bytes
- Hive安装好之后创建表时报错MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
- Hive部署安装时,Specified key was too long; max key length is 767 bytes
- Hive创建表时报错,Specified key was too long; max key length is 767 bytes
- Hive建表报错 Specified key was too long; max key length is 767 bytes
- 解决springboot+jpa+hibernate启动时报错:MySQLSyntaxErrorException: Specified key was too long; max key lengt
- hive create table: Specified key was too long; max
- hive创建表错误[ Specified key was too long]
- 使用hive的cli创建table报Specified key was too long; max key length is 767 bytes
- 我从utf8改成utf8mb4 就报Specified key was too long; max key length is 767 bytes
- Laravel 5.4 migrate时报错: Specified key was too long error
- Laravel 5.4 migrate时报错: Specified key was too long error
- Laravel 5.4 migrate时报错: Specified key was too long error
- Laravel migrate时报错: Syntax error or access violation: 1071 Specified key was too long
- RTMP协议实现IOS播放HEAAC思路
- [Android]调用字符串资源的几种方法
- Search in Rotated Sorted Array II
- DNS--域名系统 随笔
- centos 6.5 lamp环境搭建
- 【Linux运维入门】安装sonar报错:JDBCError: Specified key was too long;
- 添加、修改、删除列操作
- 移植rtmpdump(librtmp)到android
- ‘make: *** [ext/gd/gd.lo] 错误 1’
- 继承
- 新手学习opencv十一:运动目标(前景)检测
- list类2
- C语言宏定义和宏定义函数
- Linux下curses函数库