Using an Internal Package Repository使用内部的库

This topic describes how to create an internal package repository and direct hosts in your Cloudera Manager deployment to use that repository. You can create a permanent or temporary repository.
本主题描述如何在Cloudera Manager部署中创建内部包存储库和直接主机以使用该存储库。您可以创建永久或临时存储库。

After completing these steps, you can install a specific version of Cloudera Manager or install Cloudera Manager on hosts that are not connected to the Internet.
完成这些步骤后,您可以安装特定版本的Cloudera Manager或在未连接到Internet的主机上安装Cloudera Manager。

Continue reading:

Creating a Permanent Internal Repository
创建永久性的内部存储库

Install a Web Server安装web服务

The repository is typically hosted using HTTP on a host inside your network. If you already have a web server in your organization, you can move the repository directory, which will include both the RPMs and the repodata/ subdirectory, to a location hosted by the web server. An easy web server to install is the Apache HTTPD. If you are able to use an existing web server, then note the URL and skip to Downloading the Tarball and Publishing Repository Files.

存储库通常通过网络内主机上的HTTP进行访问。如果有现成的Web服务器,则可以移动存储库目录,该目录将包括RPM和repodata 以及子目录到Web服务器。最简单的方法就是安装Apache HTTPD。如果您能够使用现有的Web服务器,请记下该URL并跳至Downloading the Tarball and Publishing Repository Files.

Install Apache HTTP Server安装apache web服务

You may need to respond to some prompts to confirm you want to complete the installation.您可能需要响应某些提示以确认您要完成安装

OSCommand
RHEL compatiblesudo yum install httpd
SLESsudo zypper install httpd
Ubuntusudo apt-get install httpd

Starting Apache HTTPD

OSCommand
RHEL compatiblesudo service httpd start
centos7:systemctl start httpd
SLESsudo service apache2 start
Ubuntusudo service apache2 start

Downloading the Tarball and Publishing Repository Files
下载tar打包的文件和库文件

  1. Download the tarball for your OS distribution from the repo-as-tarball archive:下载适用于您的操作系统分发的tar包和repo-tar包
    • cloudera Manager 5: https://archive.cloudera.com/cm5/repo-as-tarball/
    • CDH 5: https://archive.cloudera.com/cdh5/repo-as-tarball/          For Cloudera Navigator data encryption components, go to the download page for each component, select your OS version, and click Download:对于Cloudera Navigator数据加密组件,请转到每个组件的下载页面,选择您的操作系统版本,然后单击下载:
  2. Unpack the tarball, move the files to the web server directory, and modify file permissions. For example, you might use the following commands:(解压缩tarball,将文件移动到Web服务器目录,然后修改文件权限。例如,您可以使用以下命令)                                                                      tar xvfz cm5.14.0-centos7.tar.gz                                                                sudo mv cm /var/www/html                                                                      sudo chmod -R ugo+rX /var/www/html/cm                                            After moving files and changing permissions, visit http://<web_server>/cm to verify that you see an index of files. If you do not see anything, your web server may have been configured to not show indexes.移动文件和更改权限后,请访问 web服务器/cm这个目录,验证您是否看到了文件索引。如果您没有看到任何内容,则您的Web服务器可能已配置为不显示索引。

Creating a Temporary Internal Repository

临时的内部库一般没用,就不翻译,需要的自己看

You can quickly create a temporary remote repository to deploy a package once. It is convenient to perform this on the same host that runs Cloudera Manager, or a gateway role. In this example, Python SimpleHTTPServer is used from a directory of your choosing.

  1. Download the tarball for your OS distribution from the repo-as-tarball archive:
    • Cloudera Manager 5: https://archive.cloudera.com/cm5/repo-as-tarball/
    • CDH 5: https://archive.cloudera.com/cdh5/repo-as-tarball/
    For Cloudera Navigator data encryption components, go to the download page for each component, select your OS version, and click Download:
  2. Unpack the tarball and modify file permissions. For example:cd /tmp tar xvfz cm5.14.0-centos7.tar.gz sudo chmod -R ugo+rX /tmp/cm
  3. Determine a port that your system is not listening on (for example, port 8900).
  4. Start a Python SimpleHTTPServer in the current directory:python -m SimpleHTTPServer 8900Serving HTTP on 0.0.0.0 port 8900 …
  5. Confirm you can get to this hosted package repository by going to http://<web_server>:8900/cm in your browser. You should see links for the hosted files.

Modifying Clients to Use the Internal Repository修改客户端的配置以便于使用我们自己内网建的永久的库

Having established the repository, modify the client configuration to use it:
我们在上面建立repo库,通过修改客户端配置来使用它:

OSProcedure
RHEL compatibleCreate /etc/yum.repos.d/cloudera-repo.repo files on cluster hosts with the following content, where <web_server> is the hostname of the web server:在集群主机里面创建 /etc/yum.repos.d/cloudera-repo.repo文件,输入下面的内容,web_server是你的web服务器的主机名
[cloudera-repo]
name=cloudera-repobase
url=http://<web_server>/cm/5
enabled=1
gpgcheck=0
SLESUse the zypper utility to update client system repo information by issuing the following command:zypper addrepo http://<web_server>/cm <alias>
UbuntuCreate /etc/apt/sources.list.d/cloudera-repo.list files on all cluster hosts with the following content, where <web_server> is the hostname of the web server:deb http://<web_server>/cm <codename> <components>You can find the <codename> and <components> variables in the ./conf/distributions file in the repository.After creating the .list file, run the following command:sudo apt-get update

原文:https://www.cloudera.com/documentation/enterprise/5/latest/topics/cm_ig_create_local_package_repo.html

翻译和实践来自网络生活,转载请注明出处。


3 thoughts on “Using an Internal Package Repository使用内部的库

发表评论

电子邮件地址不会被公开。 必填项已用*标注