简介
2013年4月,OpenStack社区知名厂商Mirantis正式宣布了基于OpenStack的开源BDaaS(BigData-as-a-Service)项目——Sahara,旨在为用户提供简单部署hadoop集群的能力
Juno版中进入核心项目,Web UI集成进Dashboard
如果从事IT行业,大家应该对hadoop不陌生了,在互联网企业蓬勃发展的今天,谁掌握数据,谁就能赢得主动,亚马逊的AWS早就提供的相关功能,现在openstack也将之开源化石头君经过一个多礼拜的调查,总算是熟悉了一下sahara的搭建和使用流程,还给小组内成员做了讲座,好开心!
环境搭建
①sahara相关包安装
# yum install -y openstack-sahara*
②数据库参数修改
/etc/my.cnf中修改
[mysqld]
max_allowed_packet = 256M
# systemctl restart mariadb.service
③创建sahara数据库
# mysql -u root -p
Enter password: XXXXXX
MariaDB [(none)]> CREATE DATABASE sahara;
MariaDB [(none)]> GRANT ALL ON sahara.* TO 'sahara'@'%' IDENTIFIED BY 'XXXXXX';
MariaDB [(none)]>GRANT ALL ON sahara.* TO 'sahara'@'localhost' IDENTIFIED BY 'XXXXXX';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> quit
④sahara认证生成
# source ~/keystonerc_admin
# openstack user create sahara --password XXXXXX
+----------+----------------------------------+
| Field | Value |
+----------+----------------------------------+
| email | None |
| enabled | True |
| id | 559333ec387d4e8a8c889def46ac68a5 |
| name | sahara |
| username | sahara |
+----------+----------------------------------+
# openstack role add --project services --user sahara admin
+-------+----------------------------------+
| Field | Value |
+-------+----------------------------------+
| id | 390af33f4f2b4493bbcd09a070465b80 |
| name | admin |
+-------+----------------------------------+
# openstack service create --type data-processing --description "Data processing service" sahara
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Data processing service |
| enabled | True |
| id | 56064c37e63b48da8eef0807f25e0f06 |
| name | sahara |
| type | data-processing |
+-------------+----------------------------------+
# openstack endpoint create sahara --publicurl http://192.168.102.244:8386/v1.1/%\(tenant_id\)s --internalurl http://192.168.102.244:8386/v1.1/%\(tenant_id\)s --adminurl http://192.168.102.244:8386/v1.1/%\(tenant_id\)s --region RegionOne
注:
192.168.102.244为控制节点ip,下同
+--------------+------------------------------------------------+
| Field | Value |
+--------------+------------------------------------------------+
| adminurl | http://192.168.102.244:8386/v1.1/%(tenant_id)s |
| id | d59c5910b2b84c04821ba042c2d9c619 |
| internalurl | http://192.168.102.244:8386/v1.1/%(tenant_id)s |
| publicurl | http://192.168.102.244:8386/v1.1/%(tenant_id)s |
| region | RegionOne |
| service_id | 56064c37e63b48da8eef0807f25e0f06 |
| service_name | sahara |
| service_type | data-processing |
+--------------+------------------------------------------------+
⑤sahara配置文件修改
/etc/sahara/sahara.conf中日志与数据库连接设定
[DEFAULT]
verbose = true
log_dir = /var/log/sahara
host = 192.168.102.244
[database]
connection = mysql://sahara:XXXXXX@192.168.102.244/sahara
/etc/sahara/sahara.conf中keystone设定
[keystone_authtoken]
auth_uri = http://192.168.102.244:5000/v2.0
identity_uri = http://192.168.102.244:35357/
admin_user = sahara
admin_password = XXXXXX
admin_tenant_name = services
/etc/sahara/sahara.conf中rabbitmq设定
[DEFAULT]
rpc_backend = rabbit
notification_driver = messaging
[oslo_messaging_rabbit]
rabbit_virtual_host=/
rabbit_port=5672
rabbit_userid=openstack
rabbit_host = 192.168.102.244
rabbit_hosts=$rabbit_host:$rabbit_port
rabbit_password=XXXXXX
/etc/sahara/sahara.conf中neutron设定
[DEFAULT]
use_neutron = True
⑥数据库同步
# sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head
# mysql -u root -p
Enter password: XXXXXX
MariaDB [(none)]> use sahara;
MariaDB [sahara]> show tables;
+-------------------------+
| Tables_in_sahara |
+-------------------------+
| alembic_version |
| cluster_events |
| cluster_provision_steps |
| cluster_templates |
| clusters |
| data_sources |
| instances |
| job_binaries |
| job_binary_internal |
| job_executions |
| jobs |
| libs_association |
| mains_association |
| node_group_templates |
| node_groups |
| templates_relations |
+-------------------------+
16 rows in set (0.00 sec)
⑦启动服务
# systemctl start openstack-sahara-all
# systemctl enable openstack-sahara-all
为什么我要先把环境搭建说一遍呢?
是因为官网kilo版文档中木有Sahara搭建流程,用juno的资料的话,有很多问题(比如kilo版keystone命令行不用了,创建service中type修改了等等),大家可以尝试尝试!