Support Questions

Find answers, ask questions, and share your expertise

Problems Setting up a Local Repository

avatar

Hello,

I have gone through the instructions to set up a local repository, but when I try to go to the base URL link on my browser it either times out or gives a 404 Not Found.

I'm thinking I must have missed a step somewhere or am simply typing the wrong URL. I would appreciate any help.

My httpd server is running:

[root@mo-e6f9afb24 /]# /usr/local/apache/bin/apachectl start
httpd (pid 5074) already running

I created the directory /var/www/html/hdp that has the HDP repo (installed using the .repo file, also tried it with the tarball just in case) and had the ambari outside of this folder

Here was the response from my reposync and createrepo - Does this look right? The Ambari and HDP-UTILS responses were the same

[root@xxxxxxx hdp]# reposync -r HDP-2.4.2.0/
[root@xxxxxxx hdp]# createrepo /var/www/html/hdp/HDP-2.4.2.0/
Spawning worker 0 with 8 pkgs
Workers Finished
Gathering worker results

Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

To see if my local repositories are there, I have used the base URL http://<; my server's FQDN >/hdp/HDP-2.4.2.0.

I have tried a few different things in terms of file structure, including the step of creating a centos folder inside hdp and including this in the base URL.

Is it possible that someone may see a mistake that I've made? Or an idea to troubleshoot the repository to find the issue?

I would really appreciate any help.

1 ACCEPTED SOLUTION

avatar

@Savanna Endicott

I performed follwong stpes and my repo is woring fine

yum install yum-utils createrepo -y

yum install yum-plugin-priorities

yum repolist

cd /var/www/html

mkdir -p ambari/<OS>

cd ambari/<OS>

For OS 7

Wget -nv

http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0 -O /etc/yum.repos.d/ambari.repo

To sync ambari repo

reposync -r Updates-ambari-2.2.1.0

Once repo sync is done

Configure local yum file on following path /etc/yum.repos.d/ambari.repo

cat /etc/yum.repos.d/ambari.repo

#VERSION_NUMBER=2.2.1.0-161

[Updates-ambari-2.2.1.0]

name=ambari-2.2.1.0 - Updates

baseurl=http://xxx.xxx.xxx.xxx:80122/repo/centos7/Updates-ambari-2.2.1.0

gpgcheck=0

enabled=0

In this we start the repo on 8012 port. For this we need to do changes in httpd.conf

And then restart the service.

You then try to browse the repo with following URL

http://xxx.xxx.xxx.xxx:8012/repo

Run the createrepo command to create repo . On the /var/www/html/centos7/Updates-ambari-2.2.1.0/

Finally local repo is created for ambari server.

For HDP 2.3

Wget -nv

http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.4.0/hdp.repo -O /etc/yum.repos.d/HDP.repo

reposync - HDP-2.3

cat /etc/yum.repos.d/HDP.repo

#VERSION_NUMBER=2.2.1.0-161

[HDP-2.3]

name=ambari-2.2.1.0 - Updates

baseurl=http://xxx.xxx.xxx.xxx:8012/repo/centos7/HDP2.3/HDP-2.3.4.0

gpgcheck=0

enabled=0

Run the createrepo command to create repo . On the /var/www/html/centos7/HDP2.3/HDP-2.3.4.0

Createrepo -v .

And to see if my local repositories are there, I have used http://<; my server's FQDN :8012/repo.

I use 8012 port for my repo server.

For your case try to open the url on

http://<; my server's FQDN >/repo

View solution in original post

2 REPLIES 2

avatar

@Savanna Endicott

I performed follwong stpes and my repo is woring fine

yum install yum-utils createrepo -y

yum install yum-plugin-priorities

yum repolist

cd /var/www/html

mkdir -p ambari/<OS>

cd ambari/<OS>

For OS 7

Wget -nv

http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0 -O /etc/yum.repos.d/ambari.repo

To sync ambari repo

reposync -r Updates-ambari-2.2.1.0

Once repo sync is done

Configure local yum file on following path /etc/yum.repos.d/ambari.repo

cat /etc/yum.repos.d/ambari.repo

#VERSION_NUMBER=2.2.1.0-161

[Updates-ambari-2.2.1.0]

name=ambari-2.2.1.0 - Updates

baseurl=http://xxx.xxx.xxx.xxx:80122/repo/centos7/Updates-ambari-2.2.1.0

gpgcheck=0

enabled=0

In this we start the repo on 8012 port. For this we need to do changes in httpd.conf

And then restart the service.

You then try to browse the repo with following URL

http://xxx.xxx.xxx.xxx:8012/repo

Run the createrepo command to create repo . On the /var/www/html/centos7/Updates-ambari-2.2.1.0/

Finally local repo is created for ambari server.

For HDP 2.3

Wget -nv

http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.4.0/hdp.repo -O /etc/yum.repos.d/HDP.repo

reposync - HDP-2.3

cat /etc/yum.repos.d/HDP.repo

#VERSION_NUMBER=2.2.1.0-161

[HDP-2.3]

name=ambari-2.2.1.0 - Updates

baseurl=http://xxx.xxx.xxx.xxx:8012/repo/centos7/HDP2.3/HDP-2.3.4.0

gpgcheck=0

enabled=0

Run the createrepo command to create repo . On the /var/www/html/centos7/HDP2.3/HDP-2.3.4.0

Createrepo -v .

And to see if my local repositories are there, I have used http://<; my server's FQDN :8012/repo.

I use 8012 port for my repo server.

For your case try to open the url on

http://<; my server's FQDN >/repo

avatar

@Ashnee SharmaThe changes to httpd.conf fixed everything, I'm now able to access the local repository 🙂 I also changed ServerName to be <FQDN>:8012. Thank you very much for your help!