OpenStack 学习笔记(二):OpenStack 基础环境搭建

By | 2017年2月16日
目录
[隐藏]

环境:

    系统版本:CentOS-7.0

 控制节点:192.168.100.120

 计算节点:192.168.100.121

1.同步时间

1
2
3
[root@openstack ~]# hostnamectl set-hostname openstack
[root@openstack ~]# su -
[root@openstack ~]# ntpdate pool.ntp.org

2.添加mitaka源

1
2
3
4
[root@openstack ~]# wget http://repos.fedorapeople.org/repos/openstack/openstack-mitaka/rdo-release-mitaka-3.noarch.rpm
[root@openstack ~]# yum install -y centos-release-openstack-mitaka
[root@openstack ~]# yum install -y rdo-release-mitaka-3.noarch.rpm
[root@openstack ~]# yum upgrade -y

2.添加hosts解析

1
2
3
4
5
6
7
8
9
10
[root@openstack ~]# echo -e "192.168.100.120\t$(uname -n)" >> /etc/hosts
[root@openstack ~]# tail -n 1 /etc/hosts
192.168.254.140 openstack
[root@openstack ~]# ping -c 2 openstack
PING openstack (192.168.100.12056(84) bytes of data.
64 bytes from openstack (192.168.100.120): icmp_seq=1 ttl=64 time=0.035 ms
64 bytes from openstack (192.168.100.120): icmp_seq=2 ttl=64 time=0.052 ms
--- openstack ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.035/0.043/0.052/0.010 ms

3.安装openstack client

1
2
[root@openstack~]# yum install python-openstackclient 
openstack-selinux

4.安装MariaDB

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@openstack ~]# yum -y install mariadb-devel mariadb mariadb-server python2-PyMySQL
[root@openstack ~]# cp /usr/share/mariadb/my-medium.cnf /etc/my.cnf
[root@openstack ~]# vim /etc/my.cnf
[client]
default-character-set=utf8
[mysqld]
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
character-set-server = utf8
[root@openstack ~]# systemctl enable mariadb.service
[root@openstack ~]# systemctl start mariadb.service
[root@openstack ~]# systemctl status mariadb.service

6.安装rabbitmq

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@openstack ~]# yum -y install http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.5/rabbitmq-server-3.5.5-3.noarch.rpm
[root@openstack ~]# cp /usr/share/doc/rabbitmq-server-3.5.5/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
[root@openstack ~]# vim /etc/rabbitmq/rabbitmq.config
17: {tcp_listeners, [5672]},
22: {tcp_listeners, [{"0.0.0.0"5672}]}
[root@openstack ~]# systemctl enable rabbitmq-server.service
[root@openstack ~]# systemctl start rabbitmq-server.service
[root@openstack ~]# systemctl status rabbitmq-server.service
[root@openstack ~]# netstat -antup|egrep '15672|25672'|grep LISTEN
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      17111/beam          
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN      17111/beam
[root@openstack ~]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
  mochiweb
  webmachine
  rabbitmq_web_dispatch
  amqp_client
  rabbitmq_management_agent
  rabbitmq_management
Applying plugin configuration to rabbit@openstack... started 6 plugins.
[root@openstack ~]# rabbitmqctl add_user openstack 11111111
Creating user "openstack" ...
[root@openstack ~]# rabbitmqctl set_user_tags openstack administrator
Setting tags for user "openstack" to [administrator] ...
[root@openstack ~]# rabbitmqctl set_permissions -p / openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...

7.安装memcached

1
2
3
4
5
6
7
[root@openstack ~]# yum -y install memcached python-memcached
[root@openstack ~]# systemctl enable memcached.service
[root@openstack ~]# systemctl start memcached.service
[root@openstack ~]# systemctl status memcached.service
[root@openstack ~]# netstat -antup|grep '11211'|grep LISTEN               
tcp        0      0 0.0.0.0:11211           0.0.0.0:*               LISTEN      4106/memcached 
tcp6      0      0 :::11211                    :::*                        LISTEN      4106/memcached

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注