本地yum源建立

Posted 灬魑魅魍魉灬

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了本地yum源建立相关的知识,希望对你有一定的参考价值。

一、openstack(ocata)本地yum源的建立:

1、配置yum缓存:

vi  /etc/yum.conf 
把yum.conf配置改为:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1

2、指定Ocata镜像源

yum install -y epel-release
yum list all|grep openstack
yum install centos-release-openstack-ocata.noarch -y

3、安装所有ocata版的软件包:

vi openstack_yum.sh
#!/bin/bash
yum installl -y createrepo yum-plugin-priorities 
yum install ntp rabbitmq-server memcached python-memcached -y
yum install python-openstackclient openstack-selinux mariadb mariadb-server python2-Pymysql -y
yum install openstack-keystone httpd mod_wsgi -y 
yum -y install openstack-glance python-glanceclient -y
yum install -y openstack-nova-api openstack-nova-placement-api openstack-novaconductor openstack-nova-console openstack-nova-novncproxy openstack-novascheduler python-novaclient 
yum install -y openstack-nova-compute sysfsutils
yum install -y openstack-neutron openstack-neutron-ml2 python-neutronclient 
yum install -y ebtables openstack-neutron-openvswitch ipset
yum install -y openstack-dashboard
yum install -y openstack-cinder targetcli python-oslo-db MySQL-python lvm2 python-keystone
yum install -y openstack-swift-proxy python-swiftclient python-keystoneauth-token python-keystonemiddleware memcached
yum install -y xfsprogs rsync 
yum install -y openstack-swift-account openstack-swift-container openstack-swift-object
yum install -y openstack-heat-api openstack-heat-api-cfn openstack-heatengine python-heatclient
yum install -y mongodb-server mongodb
yum install -y openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm python-ceilometerclient
yum install -y openstack-ceilometer-compute python-ceilometerclient pythonpecan
yum install -y openstack-trove python-troveclient
yum install -y openstack-sahara python-saharaclient
./openstack_yum.sh 

3、复制下载过来的软件包:

 mkdir /opt/ocata_yum
cp -R /var/cache/yum/x86_64/7/ /opt/ocata_yum/
yum install createrepo
createrepo /opt/ocata_yum/

4、安装nginx:

1、安装依赖包:
yum install -y pcre pcre-devel openssl openssl-devel gcc wget
groupadd -r nginx
useradd -r -g nginx -s /bin/false -M nginx
2、安装nginx:
cd /usr/loca/src
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre
make && make install
3、配置nginx.conf
技术分享
user  nginx;
worker_processes  1;
events {    
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    charset utf-8;

    log_format  main  $remote_addr - $remote_user [$time_local] "$request" 
                      $status $body_bytes_sent "$http_referer" 
                      "$http_user_agent" "$http_x_forwarded_for";
    sendfile        on;
    gzip  on;
    include vhosts/*.conf;
}
nginx.conf
mkdir /usr/local/nginx/conf/vhosts/ 
vi /usr/local/nginx/conf/vhosts/ocata.conf
技术分享
server {
    listen 80;
    server_name localhost;
    index index.html index.php index.htm;

    access_log  /var/log/nginx/access.log main;
    error_log  /var/log/nginx/error.log;

    location /{
    root /opt/;
    autoindex on;
    autoindex_exact_size  off;
    autoindex_localtime on;
    }
}
ocata.conf
4、启动nginx
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx
echo "
/usr/local/nginx/sbin/nginx" >> /etc/rc.local

 5、配置使用yum源的机器:

配置yum源:
vi /etc/yum.repos.d/openstack_ocata.repo 
[ocata]
name=ocata_rpm
baseurl=http://192.168.71.21/ocata_yum/
enabled=1
gpgcheck=0
[updates]
name=kevin update
baseurl=http://192.168.71.21/ocata_yum/
gpgcheck=0
enabled=1
mv CentOS-Base.repo CentOS-Base.repo.bak
yum clean all
yum makecache

 








以上是关于本地yum源建立的主要内容,如果未能解决你的问题,请参考以下文章

本地YUM源建立

建立CentOS 6.9 的Yum本地源

CentOS7如何建立本地阿里yum源,并安装htop文件?

安装本地YUM源

59.建立yum本地仓库

redhat5怎么配置本地yum源