按照https://blog.csdn.net/Cailand/article/details/93205089
搭建环境时遇到问题
1.Gerrit mysql error: Communications link failure
fatal: DbInjector failed
fatal: Unable to determine SqlDialect
fatal: caused by com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
fatal: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
fatal: caused by java.net.ConnectException: Connection refused (Connection refused)
这个错误应该是没创建gerrit账户的数据库或者 gerrit 没有权限登录到 mysql
解决方法是创建数据库
CREATE USER 'gerrit'@'localhost' IDENTIFIED BY 'secret';
CREATE DATABASE reviewdb DEFAULT CHARACTER SET 'utf8';
GRANT ALL ON reviewdb.* TO 'gerrit'@'localhost';
FLUSH PRIVILEGES;
ALTER USER 'gerrit'@'localhost' IDENTIFIED BY 'secret' PASSWORD EXPIRE NEVER;
ALTER USER 'gerrit'@'localhost' IDENTIFIED WITH mysql_native_password BY 'secret';
FLUSH PRIVILEGES;
alter user 'gerrit'@'localhost' identified by 'secret';
use reviewdb;
CREATE TABLE account_group_by_id_aud (added_by INT DEFAULT 0 NOT NULL, removed_by INT, removed_on TIMESTAMP NULL DEFAULT NULL, group_id INT DEFAULT 0 NOT NULL, include_uuid VARCHAR(255) BINARY DEFAULT '' NOT NULL, added_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(group_id,include_uuid,added_on));
CREATE TABLE account_group_members_audit (added_by INT DEFAULT 0 NOT NULL, removed_by INT, removed_on TIMESTAMP NULL DEFAULT NULL, account_id INT DEFAULT 0 NOT NULL, group_id INT DEFAULT 0 NOT NULL, added_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(account_id,group_id,added_on));
CREATE TABLE changes (change_key VARCHAR(60) BINARY DEFAULT '' NOT NULL, created_on TIMESTAMP NOT NULL, last_updated_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, owner_account_id INT DEFAULT 0 NOT NULL, dest_project_name VARCHAR(255) BINARY DEFAULT '' NOT NULL, dest_branch_name VARCHAR(255) BINARY DEFAULT '' NOT NULL, status CHAR(1) DEFAULT ' ' NOT NULL, current_patch_set_id INT DEFAULT 0 NOT NULL, subject VARCHAR(255) BINARY DEFAULT '' NOT NULL, topic VARCHAR(255) BINARY, original_subject VARCHAR(255) BINARY, submission_id VARCHAR(255) BINARY, note_db_state TEXT, row_version INT DEFAULT 0 NOT NULL, change_id INT DEFAULT 0 NOT NULL ,PRIMARY KEY(change_id));
quit;
修改后报错
2.No appropriate protocol
The last packet successfully received from
参考https://blog.51cto.com/u_15075520/4251028
出现这种错误的大致情况如下:
1、数据库连接长时间未使用,断开连接后,再去连接出现这种情况。这种情况常见于用连接池连接数据库出现的问题
2、数据库连接的后缀参数问题
针对上述两种情况,解决方案如下
1、修改MySQL的参数,my.cnf位于/etc目录下,修改完成后,重启mysql
wait_timeout最大为31536000即1年,在my.cnf中加入:
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
2、连接数据库的时候参数问题
登录后复制
如果使用mysql版本为5.7+,驱动Driver使用的是:com.msyql.cj.jdbc.Driver
那么你必须在连接url后面添加
useSSL=false
修改后报错
3.No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
修改:
打开jdk所在目录 cd /Library/Java/JavaVirtualMachines
修改文件:vim /jdk1.8.0_291.jdk/Contents/Home/jre/lib/security/java.security
找到如下内容:
jdk.tls.disabledAlgorithms=TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves
去除 jdk.tls.disabledAlgorithms 中 SSLv3, TLSv1, TLSv1.1三项协议,然后重启项目即可
原文链接:https://blog.csdn.net/he3more/article/details/122024655
4.之后安装完成,但是安装过程中报错
javax.net.ssl.SSLException: closing inbound before receiving peer's c
因为安装完成了,也没找到这个报错的解决办法,就没管了