MySQL数据库之如何搭建基于ldap和mysql的gerrit服务
小标 2018-08-17 来源 : 阅读 2315 评论 0

摘要:本文主要向大家介绍了MySQL数据库之如何搭建基于ldap和mysql的gerrit服务 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。

本文主要向大家介绍了MySQL数据库之如何搭建基于ldap和mysql的gerrit服务 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。

一.搭建数据库以及配置数据库

 

1.使用yum install mysql-server安装mysql

2.mysqladmin -u root password archermind(第一次设置密码).设置密码

3.修改 vi /etc/my.cnf

增加[client]项以及修改[mysqld]项.具体如下所示:

 

 [client]

#password       = your_password

port            = 3306

socket          = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

default-character-set=utf8

 

[mysqld]

default-storage-engine = innodb-----这一行要加上

character-set-server=utf8-----这一行要加上

collation-server=utf8_general_ci-----这一行要加上

 

4.启动mysql服务

service mysqld start

 

5.新建数据库

(1).输入mysql -uroot –p(密码为archermind)

(2).create database gerritdb;

(3).grant all on gerritdb.* to 'root'@'localhost' identified by 'archermind';

(4).flush privileges;

 

(5).ALTER DATABASE gerritym charset=utf8;

(6). flush privileges;


 二. 搭建gerrit

gerrit-2.11.war包可以在网上找到共享的包

(1).搭建的命令如下所示:

[root@svnnj01 gerrit]# java -jar gerrit-2.11.war init -d review_site

Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore

 

*** Gerrit Code Review 2.11

***

 

 

*** Git Repositories

***

 

Location of Git repositories   [git]:

 

*** SQL Database

***

 

Database server type           [mysql]:

Server hostname                [localhost]:

Server port                    [(mysql default)]:

Database name                  [gerritdb]:

Database username              [root]:

Change root's password         [y/N]? y

root's password                :

              confirm password :

ec

*** Index

***

 

Type                           [LUCENE/?]:

 

The index must be rebuilt before starting Gerrit:

  java -jar gerrit.war reindex -d site_path

 

*** User Authentication

***

 

Authentication method          [LDAP/?]:

LDAP server                    ldap://192.168.100.101:389:

LDAP username                  cn=domainldap.OU=IT.OU=archermind.DC=archermind.DC=com:

Change cn=domainldap.OU=IT.OU=archermind.DC=archermind.DC=com's password [y/N]?

Account BaseDN                 DC=archermind.DC=com:

Group BaseDN                   DC=archermind.DC=com:

 

*** Review Labels

***

 

Install Verified label         [y/N]?

 

*** Email Delivery

***

 

SMTP server hostname           [localhost]:

SMTP server port               [(default)]:

SMTP encryption                [NONE/?]:

SMTP username                  :

 

*** Container Process

***

 

Run as                         [root]:

Java runtime                   [/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre]:

Upgrade /data1/gerrit/review_site/bin/gerrit.war [Y/n]?

Copying gerrit-2.11.war to /data1/gerrit/review_site/bin/gerrit.war

 

*** SSH Daemon

***

 

Listen on address              [*]:

Listen on port                 [29418]:

 

*** HTTP Daemon

***

 

Behind reverse proxy           [y/N]?

Use SSL (https://)             [y/N]?

Listen on address              [*]:

Listen on port                 [8080]:

Canonical URL                  [//localhost:8080/]:

 

*** Plugins

***

 

Installing plugins.

Install plugin download-commands version v2.11 [y/N]?

Install plugin reviewnotes version v2.11 [y/N]?

Install plugin singleusergroup version v2.11 [y/N]?

Install plugin replication version v2.11 [y/N]?

Install plugin commit-message-length-validator version v2.11 [y/N]?

Initializing plugins.

No plugins found with init steps.

 

 

Initialized /data1/gerrit/review_site

 

(2).

修改 /data1/gerrit/review_site/etc/gerrit.config中的内容.如下所示:

[gerrit]

        basePath = git

        canonicalWebUrl = //10.20.70.135:8080/

[database]

        type = mysql

        hostname = localhost

        database = gerritdb

        username = root

[index]

        type = LUCENE

[auth]

        type = LDAP

[ldap]

        server = ldap://192.168.100.101:389

        username = cn=domainldap.OU=IT.OU=archermind.DC=archermind.DC=com

        accountBase = DC=archermind.DC=com

        groupBase = DC=archermind.DC=com

        accountPattern = (sAMAccountName=${username})

        accountFullName = displayName

[sendemail]

        smtpServer = smtp.archermind.com

        smtpServerPort = 25

        smtpUser = mailman

[container]

        user = root

        javaHome = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre

[sshd]

        listenAddress = *:29418

[httpd]

        listenUrl = //*:8080/

[cache]

        directory = cache

 

(3).重启gerrit

/work/gerrit/review_site/bin/gerrit.sh restart

     

三. 网页访问gerrit

//192.168.100.198:8080

 

四. 登录后页面

本文由职坐标整理并发布,希望对同学们学习MySQL有所帮助,更多内容请关注职坐标数据库MySQL数据库频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程