標籤:配置 3.0 nobody 包含 重用 emd python 雲端儲存 roc
OpenStack介紹:
OpenStack是一個由NASA(美國國家航空航天局)和Rackspace合作研發並發起的,以Apache許可證授權的自由軟體和開放原始碼項目。
OpenStack是一個開源的雲端運算管理平台項目,由幾個主要的組件組合起來完成具體工作。OpenStack支援幾乎所有類型的雲環境,項目目標是提供實施簡單、可大規模擴充、豐富、標準統一的雲端運算管理平台。OpenStack通過各種互補的服務提供了基礎設施即服務(IaaS)的解決方案,每個服務提供API以進行整合。
OpenStack是一個旨在為公用及私人雲端的建設與管理提供軟體的開源項目。它的社區擁有超過130家企業及1350位開發人員,這些機構與個人都將OpenStack作為基礎設施即服務(IaaS)資源的通用前端。OpenStack項目的首要任務是簡化雲的部署過程並為其帶來良好的可擴充性。本文希望通過提供必要的指導資訊,協助大家利用OpenStack前端來設定及管理自己的公用雲或私人雲端。
OpenStack雲端運算平台,協助服務商和企業內部實作類別似於 Amazon EC2 和 S3 的雲基礎架構服務(Infrastructure as a Service, IaaS)。OpenStack 包含兩個主要模組:Nova 和 Swift,前者是 NASA 開發的虛擬伺服器部署和業務計算模組;後者是 Rackspace開發的分布式雲端儲存模組,兩者可以一起用,也可以分開單獨用。OpenStack除了有 Rackspace 和 NASA 的大力支援外,還有包括 Dell、Citrix、 Cisco、 Canonical等重量級公司的貢獻和支援,發展速度非常快,有取代另一個業界領先開源雲平台 Eucalyptus 的態勢。
OpenStack架構1:
OpenStack架構2:
OpenStack版本:
OpenStack官網:
http://www.openstack.org/
OpenStack Services:
實驗架構:
環境:
作業系統:
CentOS-7-x86_64-Minimal-1611
linux-node1.smoke.com: 192.168.56.11 控制節點
linux-node2.smoke.com: 192.168.56.12 計算節點
node1:
修改主機名稱:注意:修改主機名稱,以後不能更改。
[[email protected] ~]# hostname linux-node1.smoke.com`[[email protected] ~]# vim /etc/hostnamehostname linux-node1.smoke.com
網卡配置:
[[email protected] ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.56.11 netmask 255.255.255.0 broadcast 192.168.56.255 inet6 fe80::20c:29ff:fe81:308f prefixlen 64 scopeid 0x20<link> ether 00:0c:29:81:30:8f txqueuelen 1000 (Ethernet) RX packets 1198 bytes 105479 (103.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1079 bytes 228271 (222.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.47.136 netmask 255.255.255.0 broadcast 192.168.47.255 inet6 fe80::20c:29ff:fe81:3099 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:81:30:99 txqueuelen 1000 (Ethernet) RX packets 20266 bytes 29152833 (27.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4139 bytes 258109 (252.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
添加hosts檔案:
[[email protected] ~]# vim /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.11 linux-node1 linux-node1.smoke.com192.168.56.12 linux-node2 linux-node2.smoke.com
時間同步:會影響OpenStack正常運行。
[[email protected] ~]# yum -y install chrony[[email protected] ~]# vim /etc/chrony.confallow 192.168.0.0/16[[email protected] ~]# systemctl enable chronyd.service[[email protected] ~]# systemctl start chronyd.service
設定時區:
[[email protected] ~]# timedatectl set-timezone Asia/Shanghai
[[email protected] ~]# date2018年 09月 30日 星期日 22:33:31 CST
安裝MySQL:
[[email protected] ~]# yum -y install mariadb mriadb-server MySQL-python[[email protected] ~]# cp /usr/share/mariadb/my-medium.cnf /etc/my.cnfcp:是否覆蓋"/etc/my.cnf"? y
[[email protected] ~]# vim /etc/my.cnf[mysqld]default-storage-engine = innodbinnodb_file_per_tablecollation-server = utf8_general_ciinit-connect = ‘SET NAMES utf8‘character-set-server = utf8[[email protected] ~]# systemctl enable mariadb.serviceCreated symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.[[email protected] ~]# systemctl start mariadb.service
[[email protected] ~]# mysql_secure_installationNOTE: 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 currentpassword for the root user. If you‘ve just installed MariaDB, andyou 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 MariaDBroot user without the proper authorisation.Set root password? [Y/n] YNew password: Re-enter new password: Password updated successfully!Reloading privilege tables.. ... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] Y ... Success!Normally, root should only be allowed to connect from ‘localhost‘. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] Y ... Success!By default, MariaDB comes with a database named ‘test‘ that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.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 farwill take effect immediately.Reload privilege tables now? [Y/n] Y ... Success!Cleaning up...All done! If you‘ve completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!
[[email protected] ~]# mysql -uroot -psmoke520Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 11Server version: 10.1.20-MariaDB MariaDB ServerCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.MariaDB [(none)]> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema |+--------------------+3 rows in set (0.01 sec)MariaDB [(none)]> use mysql;Database changedMariaDB [mysql]> show tables;+---------------------------+| Tables_in_mysql |+---------------------------+| column_stats || columns_priv || db || event || func || general_log || gtid_slave_pos || help_category || help_keyword || help_relation || help_topic || host || index_stats || innodb_index_stats || innodb_table_stats || plugin || proc || procs_priv || proxies_priv || roles_mapping || servers || slow_log || table_stats || tables_priv || time_zone || time_zone_leap_second || time_zone_name || time_zone_transition || time_zone_transition_type || user |+---------------------------+30 rows in set (0.01 sec)MariaDB [mysql]> exit;Bye
Keystone資料庫:
[[email protected] ~]# mysql -uroot -psmoke520 -e "CREATE DATABASE keystone;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON keystone.* TO ‘keystone‘@‘localhost‘ IDENTIFIED BY ‘keystone‘;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON keyston.* TO ‘keystone‘@‘%‘ IDENTIFIED BY ‘keystone‘;"
Glance資料庫:
[[email protected] ~]# mysql -uroot -psmoke520 -e "CREATE DATABASE glance;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘localhost‘ IDENTIFIED BY ‘glance‘;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘%‘ IDENTIFIED BY ‘glance‘;"
Nove資料庫:
[[email protected] ~]# mysql -uroot -psmoke520 -e "CREATE DATABASE nova;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘localhost‘ IDENTIFIED BY ‘nova‘;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘ IDENTIFIED BY ‘nova‘;"
Neutron資料庫:
[[email protected] ~]# mysql -uroot -psmoke520 -e "CREATE DATABASE neutron;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘localhost‘ IDENTIFIED BY ‘neutron‘;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON neutron.* TO ‘neutron‘@‘%‘ IDENTIFIED BY ‘neutron‘;"
Cinder資料庫:
[[email protected] ~]# mysql -uroot -psmoke520 -e "CREATE DATABASE cinder;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘localhost‘ IDENTIFIED BY ‘cinder‘;"[[email protected] ~]# mysql -uroot -psmoke520 -e "GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder‘@‘%‘ IDENTIFIED BY ‘cinder‘;"
[[email protected] ~]# mysql -uroot -psmoke520 Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 30Server version: 10.1.20-MariaDB MariaDB ServerCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.MariaDB [(none)]> show databases;+--------------------+| Database |+--------------------+| cinder || glance || information_schema || keystone || mysql || neutron || nova || performance_schema |+--------------------+8 rows in set (0.00 sec)MariaDB [(none)]> exit;Bye
SOA(面向服務的架構) :
面向服務架構,它可以根據需求通過網路對鬆散耦合的粗粒度應用組件進行分布式部署、組合和使用。服務層是SOA的基礎,可以直接被應用調用,從而有效控制系統中與軟體代理互動的人為依賴性。
SOA是一種粗粒度、松耦合服務架構,服務之間通過簡單、精確定義介面進行通訊,不涉及底層編程介面和通訊模型。SOA可以看作是B/S模型、XML(標準通用標記語言 (SGML)的子集)/Web Service技術之後的自然延伸。
SOA將能夠協助軟體工程師們站在一個新的高度理解企業級架構中的各種組件的開發、部署形式,它將協助企業系統架構者以更迅速、更可靠、更具重用性架構整個業務系統。較之以往,以SOA架構的系統能夠更加從容地面對業務的急劇變化。
體繫結構:
松耦合的系統
基本特徵:
可從企業外部存取
隨時可用
粗粒度的服務介面分級
鬆散耦合
可重用的服務
服務介面設計管理
標準化的服務介面
支援各種訊息模式
精確定義的服務契約
SOA 服務用訊息進行通訊,該訊息通常使用XML Schema來定義(也叫做XSD, XML Schema Definition)。消費者和提供者或消費者和服務之間的通訊多見於不知道提供者的環境中。服務間的通訊也可以看作企業內部處理的關鍵商業文檔。
SOA服務通過一個扮演目錄列表(directory listing)角色的登記處(Registry)來進行維護。應用程式在登記處(Registry)尋找並調用某項服務。統一描述,定義和整合(UDDI, Universal Description, Definition, and Integration)是服務登記的標準。
安裝Message queue(訊息佇列):
OpenStack支援RabbitMQ,Qpid,ZeroMQ訊息佇列。
[[email protected] ~]# yum -y install rabbitmq-server
如果yum無法安裝,可以到官網下載最新包安裝,https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.8
[[email protected] ~]# ll
總用量 258604
-rw-------. 1 root root 1245 7月 18 19:48 anaconda-ks.cfg
-rw-r--r-- 1 root root 170023183 10月 1 01:53 jdk-8u181-linux-x64.rpm
drwxrwxr-x 12 421 wheel 4096 10月 1 01:47 otp_src_21.1
-rw-r--r-- 1 root root 85214629 10月 1 01:22 otp_src_21.1.tar.gz
-rw-r--r-- 1 root root 9557762 10月 1 01:08 rabbitmq-server-3.7.8-1.el7.noarch.rpm
JDK:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
[[email protected] ~]# yum -y install jdk-8u181-linux-x64.rpm
[[email protected] otp_src_21.1]# yum -y install make ncurses-devel gcc gcc-c++ unixODBC unixODBC-devel openssl openssl-devel
wxWidgets:
https://www.wxwidgets.org/downloads/
[[email protected] wxWidgets-3.1.1]# yum -y install gtk2-devel binutils-devel
[[email protected] ~]# tar xf wxWidgets-3.1.1.tar.bz2
[[email protected] ~]# cd wxWidgets-3.1.1
[[email protected] wxWidgets-3.1.1]# yum install gtk2-devel
[[email protected] wxWidgets-3.1.1]# yum -y install mesa-libGLU-devel
[[email protected] wxWidgets-3.1.1]# ./configure --with-opengl --enable-debug --enable-unicode
[[email protected] wxWidgets-3.1.1]# make && make install
[[email protected] include]# vim /etc/ld.so.conf.d/wxWidgets.conf
[[email protected] include]# ldconfig
Erlang:
http://www.erlang.org/downloads
[[email protected] ~]# tar xf otp_src_21.1.tar.gz
[[email protected] ~]# cd otp_src_21.1
[[email protected] otp_src_21.1]# ./configure
node2:
[[email protected] ~]# hostname linux-node2.smoke.com
[[email protected] ~]# vim /etc/hostnamehostname linux-node2.smoke.com
[[email protected] ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.56.12 netmask 255.255.255.0 broadcast 192.168.56.255 inet6 fe80::9752:504d:ee43:64f5 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:b2:dc:b3 txqueuelen 1000 (Ethernet) RX packets 23651 bytes 33698486 (32.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6118 bytes 455955 (445.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.47.135 netmask 255.255.255.0 broadcast 192.168.47.255 inet6 fe80::c33f:7c14:d42c:bc06 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:b2:dc:bd txqueuelen 1000 (Ethernet) RX packets 684 bytes 49408 (48.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 108 bytes 10149 (9.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 20 bytes 1708 (1.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 20 bytes 1708 (1.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[[email protected] ~]# vim /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.11 linux-node1 linux-node1.smoke.com192.168.56.12 linux-node2 linux-node2.smoke.com
[[email protected] ~]# yum -y install chrony`allow 192.168.0.0/16[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service
[[email protected] ~]# timedatectl set-timezone Asia/Shanghai
[[email protected] ~]# date2018年 09月 30日 星期日 22:33:55 CST
OpenStack部署(一)