简体   繁体   English

无法使用org.mariadb.jdbc.Driver进行Gerrit安装失败

[英]Gerrit Setup Fails With org.mariadb.jdbc.Driver not available

I have a RHEL 7 machine that I am trying to setup with Gerrit. 我有一台尝试使用Gerrit设置的RHEL 7计算机。 I downloaded gerrit-2.14.6.war into /home/gerrit2. 我将gerrit-2.14.6.war下载到/ home / gerrit2。 I logged into MariaDB and created a gerrit2 user (with password) and created a 'reviewdb' database. 我登录了MariaDB,并创建了一个gerrit2用户(带有密码)并创建了一个'reviewdb'数据库。

I then logged in as the gerrit2 user and executed java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit . 然后,我以gerrit2用户身份登录并执行java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit I answered the questions and it installs successfully. 我回答了问题,安装成功。 I then executed bin/gerrit.sh start and it started successfully. 然后,我执行bin/gerrit.sh start并成功启动。

So, my shop is really weird. 所以,我的商店真的很奇怪。 We have Windows machine that is our machine at our desk but all of our development is on Linux and the servers are off in another building. 我们的办公桌旁是Windows机器,但我们所有的开发都是在Linux上进行的,而服务器则在另一栋大楼里。 I typically access these machines using something like MobaXterm (or PuTTY, basically SSH). 我通常使用MobaXterm(或PuTTY,基本上是SSH)之类的东西来访问这些机器。 My shop does not have a DNS server and they have administratively locked down my hosts file so I cannot add a IP address and hostname to the hosts file on my Windows machine. 我的商店没有DNS服务器,并且他们已在管理上锁定了我的主机文件,因此我无法在Windows计算机上的主机文件中添加IP地址和主机名。 So, when I opened my web browser, I typed in the IP address of the machine to access it. 因此,当我打开Web浏览器时,我输入了机器的IP地址来访问它。 I was able to successfully do this and then I clicked on Sign In. 我能够成功完成此操作,然后单击“登录”。 I entered my username but it barfed an error at me saying that the account did not exist or something like that. 我输入了我的用户名,但它拒绝了我一个错误,说该帐户不存在或类似名称。 I clicked "Back" in the web browser and it barfed another error stating it could not find the webpage. 我在网络浏览器中单击“上一步”,然后拒绝另一个错误,指出找不到该网页。 That is when I noticed that my web browser was trying to find the webpage based off the hostname of the machine rather than the IP address. 那是当我注意到我的Web浏览器试图根据机器的主机名而不是IP地址查找网页时。

I looked in /home/gerrit2/gerrit/etc/gerrit.config and found the canonicalURL property is set to http://hostname.of.the.server:8080 . 我查看了/home/gerrit2/gerrit/etc/gerrit.config,发现canonicalURL属性设置为http://hostname.of.the.server:8080 I changed that to http://123.123.123.123:8080 and restarted the Gerrit service and now the service will not start. 我将其更改为http://123.123.123.123:8080并重新启动了Gerrit服务,现在该服务将无法启动。 This leads me to believe that there are other hooks in Gerrit that need to be changed as well. 这使我相信Gerrit中还有其他挂钩也需要更改。

Instead of trying to figure out where all of the hooks are, I decided to just blow alway the whole installation and rebuild again from scratch. 我没有试图弄清所有挂钩的位置,而是决定始终将整个安装过程全部销毁,然后从头开始重新构建。 I did a rm -rf /home/gerrit2/gerrit and then performed java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit again. 我做了一个rm -rf /home/gerrit2/gerrit ,然后再次执行java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit But, now, it goes all the way to the end and then barfs this error: 但是,现在,它一直进行到最后,然后阻止此错误:

fatal: Driver class org.mariadb.jdbc.Driver not available fatal: Cannot connect to SQL database

This makes no sense to me since I did not touch the Java stuff at all. 这对我来说毫无意义,因为我根本没有接触过Java的东西。 Why is it all of the sudden complaining about this now even though it worked earlier? 为什么即使现在更早就对此突然抱怨呢? I have tried finding this by doing find /usr/lib/jvm -type f -print | xargs grep -i maria 我已经尝试通过find /usr/lib/jvm -type f -print | xargs grep -i maria找到这个find /usr/lib/jvm -type f -print | xargs grep -i maria find /usr/lib/jvm -type f -print | xargs grep -i maria but there were no matches. find /usr/lib/jvm -type f -print | xargs grep -i maria但没有匹配。

Any ideas what I did to break this and how to fix it? 有什么想法可以解决这个问题以及如何解决吗?

当询问您是否要安装MariaDB Connector / J时,如果您单击Y会很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM