一、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版的软件包(下面有用python3脚本将源的文件全下载下来):
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; }
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; } }