设为首页 收藏本站
查看: 998|回复: 0

[经验分享] openstack安装(liberty)--环境准备

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-8-5 09:17:35 | 显示全部楼层 |阅读模式
注:完全参考官方文档实验,仅学习记录,后续不作说明。
http://docs.openstack.org/liberty/install-guide-rdo/index.html
QQ截图20160805091704.png
使用VBOX实验,创建2个虚拟机分别用于控制和计算节点,分配2个网卡,其中一个网卡可以使用“NAT网络”,将自动生成的网卡设置为10.0.0.1,作为虚拟机网关同时以便实体机能直接访问虚拟机。另一个网卡使用桥接模式。如果使用XSHELL连接,可以使用“NAT网络”中端口映射以便访问10.0.0.X。使用“NAT网络”而不是“NAT”的好处一可以定义IP地址段,二可以上网。其他节点仅需分配一个网卡,使用“NAT网络”。
QQ截图20160805091709.png
QQ截图20160805091714.png

一.环境准备
1.1配置网卡,设置静态IP地址和DNS,VBOX中网卡需要开启混杂模式,即”允许全部“
1
2
3
4
[iyunv@controller1 ~]#vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
[iyunv@controller1 ~]#vi /etc/resolv.conf
[iyunv@compute1 ~]#vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
[iyunv@compute1 ~]#vi /etc/resolv.conf





1.2设置主机名称和HOSTS文件并PING测试
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[iyunv@controller1 ~]# hostnamectl set-hostname controller1
[iyunv@controller1 ~]# vi /etc/hosts
10.0.0.11 controller1 controller1
10.0.0.31 compute1
10.0.0.41 block1
10.0.0.51 object1  
10.0.0.52 object2
[iyunv@controller1 ~]# hostnamectl status
[iyunv@compute1 ~]#hostnamectl set-hostname compute1
[iyunv@compute1 ~]#vi /etc/hosts
10.0.0.11 controller1 controller1
10.0.0.31 compute1
10.0.0.41 block1
10.0.0.51 object1  
10.0.0.52 object2
[iyunv@compute1 ~]# hostnamectl status




1.3关闭防火墙和SELINUX
1
2
3
4
5
6
[iyunv@compute1 ~]# systemctl stop firewalld.service
[iyunv@compute1 ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[iyunv@compute1 ~]# vi /etc/selinux/config
SELINUX=disabled



1.4更新系统
1
[iyunv@compute1 ~]# yum update




2.1配置时间同步(controller1)
1
2
3
4
5
6
7
8
9
10
11
12
[iyunv@comtroller1 ~]# yum remove chrony
[iyunv@compute1 ~]# yum install ntp
[iyunv@comtroller1 ~]# vi /etc/ntp.conf
restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
server s2m.time.edu.cn
server 210.72.145.44
restrict 210.72.145.44 nomodify notrap noquery
server 127.127.0.1
fudge 127.127.0.1 stratum 10
[iyunv@comtroller1 ~]# systemctl start ntpd.service
[iyunv@comtroller1 ~]# systemctl enable ntpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.




2.2配置节点时间同步(compute1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[iyunv@compute1 ~]# yum remove chrony
[iyunv@compute1 ~]# yum install ntp
[iyunv@compute1 ~]# vi /etc/ntp.conf
server controller1
restrict controller1 nomodify notrap noquery
server 127.127.0.1
fudge 127.127.0.1 stratum 10
[iyunv@compute1 ~]# systemctl start ntpd.service
[iyunv@compute1 ~]# systemctl enable ntpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
[iyunv@compute1 ~]# ntpstat
synchronised to NTP server (10.0.0.11) at stratum 5
   time correct to within 113 ms
   polling server every 64 s

[iyunv@compute1 ~]# ntpdate -u 10.0.0.11
14 Jul 14:51:51 ntpdate[15782]: adjust time server 10.0.0.11 offset -0.011970 sec
[iyunv@compute1 ~]# hwclock --systohc




3.1安装OpenStack packages
1
[iyunv@controller1 ~]# yum install centos-release-openstack-liberty



3.2更新系统
1
[iyunv@controller1 ~]# yum upgrade



3.3安装OpenStack客户端
1
[iyunv@controller1 ~]# yum install python-openstackclient



3.4如果开启了SELINUX,则需要安装如下包
1
[iyunv@controller1 ~]# yum install openstack-selinux





4.1数据库安装
1
[iyunv@comtroller1 ~]# yum install mariadb mariadb-server MySQL-python




4.2拷贝并编辑配置文件
1
2
3
4
5
6
7
8
9
[iyunv@comtroller1 ~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf.d/mariadb_openstack.cnf
[iyunv@comtroller1 ~]# vi /etc/my.cnf.d/mariadb_openstack.cnf
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8




4.3启动和设置开机自启动
1
2
[iyunv@comtroller1 ~]# systemctl enable mariadb.service
[iyunv@comtroller1 ~]# systemctl start mariadb.service




4.4设置数据库密码
1
[iyunv@comtroller1 ~]# mysql_secure_installation




4.5验证数据库配置
1
[iyunv@comtroller1 ~]# mysql -uroot -p




5.1安装mongodb (nosql数据库,仅安装Telemetry 时需要)
1
[iyunv@comtroller1 ~]# yum install mongodb-server mongodb



5.2编辑配置文件
1
2
3
[iyunv@comtroller1 ~]# vi /etc/mongod.conf
bind_ip = 10.0.0.11
smallfiles = true  ##此处可选配置,手册描述和实际有差,待确认



5.3启动和设置开机自启动
1
2
3
[iyunv@controller1 mongodb]# systemctl enable mongod.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mongod.service to /usr/lib/systemd/system/mongod.service.
[iyunv@controller1 mongodb]# systemctl start mongod.service



6.1安装消息队列rabbitmq
1
[iyunv@controller1 ~]# yum install rabbitmq-server



6.2启动和设置开机自启动
1
2
3
[iyunv@controller1 ~]# systemctl enable rabbitmq-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.
[iyunv@controller1 ~]# systemctl start rabbitmq-server.service



6.3添加用户并设置密码
1
2
[iyunv@controller1 ~]# rabbitmqctl add_user openstack openstack
Creating user "openstack" ...



6.4设置用户权限
1
2
[iyunv@controller1 ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...






运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-253106-1-1.html 上篇帖子: OpenStack安装与配置各种问题汇总 下篇帖子: openstack安装(liberty)--安装认证服务(Identity service)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表