Setup internal yum repositories for CentOS and RedHat Servers Part 2

  1. Setup internal yum repositories for CentOS and RedHat Servers Part 1
  2. Setup internal yum repositories for CentOS and RedHat Servers Part 2
  3. Setup internal yum repositories for CentOS and RedHat Servers Part 3
  4. Setup internal yum repositories for CentOS and RedHat Servers Part 4

Setup storage nodes

Setup RHEL6 storage node

Set hostname (example: el6repo)

vi /etc/sysconfig/network

Start apache and set to start on boot

service httpd start

chkconfig httpd on

Create base directory structure

mkdir -p /var/www/html/repo/Package_Diff

Create repo config files (see Setup Note for link to contents)

touch /var/www/html/repo/CentOS-Base.repo

touch /var/www/html/repo/Epel.repo

touch /var/www/html/repo/Redhat.repo

chmod 644 /var/www/html/repo/*.repo

Setup Note: Remember to copy the content from the appropriate files.

Path: /var/www/html/repo/CentOS-Base.repo CentOS-Base.repo

Path: /var/www/html/repo/Epel.repo Epel.repo

Path: /var/www/html/repo/Redhat.repo Redhat.repo

Create scripts directory for sync shell scripts

mkdir /root/scripts

Create repo sync files (see Setup Note for link to contents)

touch /root/scripts/sync_centos_repos.sh

touch /root/scripts/sync_epel_repos.sh

touch /root/scripts/sync_rhel_repos.sh

chmod -R 700 /root/scripts

Setup Note: Remember to copy the content from the appropriate files.

Path: /root/scripts/sync_centos_repos.sh sync_centos_repos.sh

Path: /root/scripts/sync_epel_repos.sh sync_epel_repos.sh

Path: /root/scripts/sync_rhel_repos.sh sync_rhel_repos.sh

Add cron job entries to schedule the repo sync operations

vi /etc/crontab

Insert these entries (scripts will run at 04:15, 04:30, and 04:45 on the 12th day of the month)

15 4 12 * * root /root/scripts/sync_centos_repos.sh

30 4 12 * * root /root/scripts/sync_epel_repos.sh

45 4 12 * * root /root/scripts/sync_rhel_repos.sh

Setup Note: Use any time that makes sense in your environment. The times used are in no way meaningful other than making sure all of the scripts do not start at the same time as they could consume a lot of bandwidth; choking your internet connection.

Setup firewall rules to allow http connections from any host

iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

Save the firewall configuration

service iptables save

Restart the firewall

service iptables restart

Sync the remote repositories

Perform an initial sync with the remote repository

cd /root/scripts

./sync_centos_repos.sh

./sync_epel_repos.sh

./sync_rhel_repos.sh

You must be logged in to post a comment.

Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com