OpenStack Ocata : Pre-Requirements

 
This is the exmaple of Cloud Computiong by OpenStack Ocata.
Install some services that some components of OpenStack needs for system requirements on here. 
This example is based on the emvironment like follows.
                  eth0|10.0.0.30 
          +-----------+-----------+
          |    [ Control Node ]   |
          |                       |
          |  MariaDB    RabbitMQ  |
          |  Memcached            |
          +-----------------------+
[1]
Install NTP Server to adjusts the date, refer to here.
NTPd : Configure NTP Server
2014/07/08
 
Install NTPd and Configure NTP server for time adjustment.
[1]Install NTPd.
[root@dlp ~]# 
yum -y install ntp
[root@dlp ~]# 
vi /etc/ntp.conf
# line 18: add the network range you allow to receive requests
restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
# change servers for synchronization
#
server 0.centos.pool.ntp.org iburst
#
server 1.centos.pool.ntp.org iburst
#
server 2.centos.pool.ntp.org iburst
#
server 3.centos.pool.ntp.org iburst
server ntp1.jst.mfeed.ad.jp iburst server ntp2.jst.mfeed.ad.jp iburst server ntp3.jst.mfeed.ad.jp iburst
[root@dlp ~]# 
systemctl start ntpd 
[root@dlp ~]# 
systemctl enable ntpd 
[2]If Firewalld is running, allow NTP service. NTP uses 123/UDP.
[root@dlp ~]# 
firewall-cmd --add-service=ntp --permanent 
success [root@dlp ~]# 
firewall-cmd --reload 
success
[3]Verify it works normally like follows.
[root@dlp ~]# 
ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp1.jst.mfeed. 172.29.1.100     2 u   29   64    1   18.826   -0.126   0.000
+ntp2.jst.mfeed. 172.29.2.50      2 u   28   64    1   21.592    0.018   0.000
*ntp3.jst.mfeed. 133.243.236.18   2 u   28   64    1   22.666   -1.033   0.000
[2]Add the repository of Openstack Ocata.
[root@dlp ~]# 
yum -y install centos-release-openstack-ocata 

[root@dlp ~]# 
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-OpenStack-ocata.repo 
[3]Install MariaDB server.
It's possible to use MariaDB 5.5 on CentOS Base repository though, but on this exmaple, Install MariaDB 10.1 provided from CentOS Release Openstack Newton above.

After installation, Configure basic settings, refer to here.
 
Install MariaDB 5.5 which is CentOS 7 default version to configure Database server.
[1]Install MariaDB 5.5.
[root@www ~]# 
yum -y install mariadb-server
[root@www ~]# 
vi /etc/my.cnf
# add follows within [mysqld] section

[mysqld]
character-set-server=utf8
[root@www ~]# 
systemctl start mariadb 

[root@www ~]# 
systemctl enable mariadb 

ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
[2]Initial Settings for MariaDB.
[root@www ~]# 
mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

# set root password

Set root password? [Y/n] 
y

New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
# remove anonymous users

Remove anonymous users? [Y/n] 
y

 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

# disallow root login remotely

Disallow root login remotely? [Y/n] 
y

 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

# remove test database

Remove test database and access to it? [Y/n] 
y

 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

# reload privilege tables

Reload privilege tables now? [Y/n] 
y

 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

# connect to MariaDB with root

[root@www ~]# 
mysql -u root -p 

Enter password:     
# MariaDB root password you set

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# show user list

MariaDB [(none)]> 
select user,host,password from mysql.user; 

+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| root | 127.0.0.1 | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| root | ::1       | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

# show database list

MariaDB [(none)]> 
show databases; 

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> 
exit

Bye
# install from Openstack Ocata

[root@dlp ~]# 
yum --enablerepo=centos-openstack-ocata -y install mariadb-server
[4]Install RabbitMQ, Memcached.
# install from EPEL

[root@dlp ~]# 
yum --enablerepo=epel -y install rabbitmq-server memcached
[root@dlp ~]# 
systemctl start rabbitmq-server memcached 

[root@dlp ~]# 
systemctl enable rabbitmq-server memcached 
# add openstack user (set any password you like for "password")

[root@dlp ~]# 
rabbitmqctl add_user openstack password 

Creating user "openstack" ...
...done.
[root@dlp ~]# 
rabbitmqctl set_permissions openstack ".*" ".*" ".*" 

Setting permissions for user "openstack" in vhost "/" ...
...done.
[5]If Firewalld is running, allow ports for services.
[root@dlp ~]# 
firewall-cmd --add-port={11211/tcp,5672/tcp} --permanent 

success
[root@dlp ~]# 
firewall-cmd --reload 

success

No comments:

Post a Comment