首页 > 代码库 > Deploy sahara on openstack-icehouse
Deploy sahara on openstack-icehouse
前段时间花了将近一天的时间了解了一下Hadoop,参考相关的资料Hadoop可以部署在openstack上,openstack通过Sahara对Hadoop集群进行部署和管理。于是又花时间研究了Sahara,主要参考官网的文档,但里面还是有些需要注意的地方,下面是我在openstack上部署Sahara的步骤。
1.部署环境
在两台物理机上搭建openstack,一台作为openstack的控制节点,一台作为openstack的计算节点,openstack的版本是icehouse版。
2.sahara部署
(1)Sahara部署在控制节点。官网给了三种安装方式,我首先试的第三种方式,第三种方式部署完之后,keystone如果重启之后,就再也起不来了,我没有查出原因。最后只能采用第二种方式——RDO方式,经实践可行。
yum install openstack-sahara
(2)Sahara配置。
在数据库中为Sahara创建用户,并授权。
mysql –u* -p*
create database sahara;
create user sahara identified by ‘000000‘;
grant all privileges on sahara.* to sahara;
编辑/etc/sahara/sahara.conf
vi /etc/sahara/sahara.conf
添加下面的变量:
use_neutron=true #use neutron network
os_auth_uri = http://controller:5000 #keystone address
os_auth_host=controller #keystone host
os_auth_port=35357 #keystone port
os_admin_username=sahara #sahara keystone user
os_admin_password=000000 #sahara password
os_admin_tenant_name=service #sahara tenant
在[database]下删掉connection,添加
connection = mysql://sahara:000000@192.168.40.10/sahara
在keystone中创建Sahara用户并创建endpoint。
keystone user-create --name sahara --pass 000000
keystone user-role-list --user sahara --tenant service
keystone user-role-add --user sahara --tenant service --role admin
keystone service-create --name sahara
--type data_processing
--description "Sahara Data Processing"
keystone endpoint-create --service sahara
--region RegionOne
--publicurl "http://192.168.40.10:8386/v1.1/%(tenant_id)s"
--adminurl "http://192.168.40.10:8386/v1.1/%(tenant_id)s"
--internalurl "http://192.168.40.10:8386/v1.1/%(tenant_id)s"
(3)创建sahara相关的表
sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head
(4)启动sahara-api服务
service openstack-sahara-api start
3.Sahara-dashboard部署
(1)Sahara dashboard安装
yum install python-django-sahara
(2)openstack dashboard配置
vi /usr/share/openstack-dashboard/openstack_dashboard/setting.py
HORIZON_CONFIG = {
‘dashboards‘: (‘project‘, ‘admin‘, ‘settings‘, ‘sahara‘, ‘router‘,),
INSTALLED_APPS = [
‘saharadashboard‘,
vi /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py
添加
SAHARA_USE_NEUTRON = True
SAHARA_URL = ‘http://controller:8386/v1.1‘
参考文献:
http://docs.openstack.org/developer/sahara/icehouse/userdoc/installation.guide.html
http://docs.openstack.org/developer/sahara/icehouse/userdoc/configuration.guide.html
http://docs.openstack.org/developer/sahara/icehouse/horizon/installation.guide.html
Deploy sahara on openstack-icehouse