安装方式:磁盘安装

安装版本:0.5.4

参考文档:https://registry-project.readthedocs.io/en/latest/install.html#centos-redhat

  1. 下载压缩包并解压

    wget https://github.com/hortonworks/registry/releases/download/0.5.4/hortonworks-registry-0.5.4.tar.gz
       
    [[email protected] local]# ls -al hortonworks/
    total 36
    drwx------   8 root root    140 Mar 18 16:12 .
    drwxr-xr-x. 22 root root    285 Mar 18 15:55 ..
    drwx------   2 root root     54 Mar 18 15:55 bin
    drwxrwxrwx   4  502 games    92 Aug 30  2018 bootstrap
    drwx------   2 root root    251 Mar 18 16:11 conf
    drwx------   3 root root     29 Mar 18 15:55 examples
    drwx------   2 root root  12288 Mar 18 16:04 libs
    -rw-r--r--   1  502 games 11325 Jan 17  2017 LICENSE.txt
    drwx------   2 root root     66 Mar 18 16:12 logs
    -rw-r--r--   1  502 games   728 Apr 25  2017 NOTICE.txt
    -rw-r--r--   1  502 games  2063 Aug 30  2018 README.md
    [[email protected] local]#
    
  2. 准备mysql驱动

    cp mysql-connector-java-*.jar libs
    cp mysql-connector-java-*.jar bootstrap/lib
    
  3. 配置conf/registry.yaml

    ...
    storageProviderConfiguration:
     providerClass:"com.hortonworks.registries.storage.impl.jdbc.JdbcStorageManager"
       properties:
         db.type: "mysql"
         queryTimeoutInSecs: 30
         db.properties:
           dataSourceClassName: "com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
           dataSource.url: "jdbc:mysql://localhost/schema_registry"
           dataSource.user:"registry_user"
           dataSource.password: "registry_password"
    
  4. 初始化

    $REGISTRY_HOME/bootstrap/boostrap-storage.sh create
    $REGISTRY_HOME/bootstrap/boostrap-storage.sh migrate
    $REGISTRY_HOME/bootstrap/boostrap-storage.sh validate
    
  5. 启动

    sudo ./bin/registry start
    
  6. 验证

    由于9090端口被prometheus占用,此处我改成了19090和19091端口

    [[email protected] hortonworks]# curl 127.0.0.1:19091
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
      <title>Metrics</title>
    </head>
    <body>
      <h1>Operational Menu</h1>
      <ul>
        <li><a href="/metrics?pretty=true">Metrics</a></li>
        <li><a href="/ping">Ping</a></li>
        <li><a href="/threads">Threads</a></li>
        <li><a href="/healthcheck?pretty=true">Healthcheck</a></li>
        <li><a href="/pprof">CPU Profile</a></li>
        <li><a href="/pprof?state=blocked">CPU Contention</a></li>
      </ul>
    </body>
    </html>