How to install Savanna

Pre-conditions: openstack has been installed successfully.


解压软件包中的savanna-all.tar.gz安装tar -C / -xzf savanna-all.tar.gz安装了下列软件
1、/openstack-horizon
2、/etc/savanna/savanna.conf
3、/usr/local/bin/savanna-api和savanna-db-manage
4、/usr/local/lib/python2.7/dist-packages
5、上传镜像到glance服务器:glance image-create --name=vanilla-hadoop.image --disk-format=qcow2 --container-format=bare < ./savanna-0.1.2-hadoop.qcow2
一、horizon的安装和配置。
1、将软件包中openstack-horizon拷贝到目标机器的根目录下 /
2、cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
3、修改local_settings.py的配置
[skipped]
OPENSTACK_HOST = "172.18.79.139" <------ KeyStone address
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
[skipped]
4、在keystone服务器上面注册horizon的服务(如果openstack已经安装成功,这个已经注册过了,可以省略)。
5、启动horizon服务 python manage.py runserver 0.0.0.0:6666(端口号可以任意)
6、在客户端浏览器上输入horizon所在的目标主机ip加端口进行访问。

可能存在的问题
1、缺少lessc的CSS样式
回答:
解决方案按照如下的次序安装软件包中savanna依赖的包.
libc-ares2 amd64
libv8-3.8.9.20 amd64                                                     
libev4 amd64                                                               
nodejs amd64                                                     
node-less
设置样式链接,使用系统/usr/bin/lessc样式来展示horizon的页面
ln -s /usr/bin/lessc <path_to_horizon>/bin/less/lessc

二、savanna的安装和配置
1、修改/etc/savanna/savanna.conf配置文件,可以修改端口prot和进行keystone认证的参数
os_auth_host=10.0.0.100
os_auth_port=35357
os_admin_username=nova
os_admin_password=service_pass
os_admin_tenant_name=service

2、在keystone上面注册savanna服务
keystone service-create --name savanna --type mapreduce --description "Savanna"

keystone endpoint-create --service-id ed08fa240cbd40898eab09eb9d5c3d0c --internalurl "http://25.8.67.32:9000/v0.2/%(tenant_id)s" --publicurl "http://25.8.67.32:9000/v0.2/%(tenant_id)s" --adminurl "none"

上面service-id为第一步成说那话是的id地址,ip地址为horizon的ip地址,端口为savanna配置文件中指定的端口。

这个过程中可能需要修改keystone所在主机的/root/.bashrc
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=keystone_admin
export OS_AUTH_URL="http://25.8.67.32:5000/v2.0/"
source /root/.bashrc

3、产生savanna使用的数据库
savanna‐db-manage ‐‐config‐file /etc/savanna/savanna.conf 后面参数自己尝试,可以参见软件包中savanna-db-manage

4、启动savanna服务
savanna‐api ‐‐config‐file /etc/savanna/savanna.conf

按照上述的步骤完成后可能存在着一下的问题,就是savanna的提供的服务由于版本号关系不能正确解析,由于savanna-all中的版本是1.0的版本的,由于1.0版本中有些服务还没有开发完,因此在创建node-temple的时候有问题(cluster-templete可以成功创建),因此我们将将savanna的版本降到稳定版上面,主要替换savanna的api文件以及savanna原始文件中被1.0版本所覆盖的文件。
a、将软件包中savanna文件拷贝到目标机器
b、使用setup.py来安装
c、主要的工作主要包括:替换/usr/local/bin下面关于savanna的运行文件;替换savanna.conf文件这个可能需要注意进行重新进行配置;主要替换/usr/local/lib/python2.7/dist-packages文件中的内容,主要看api文件中的都换成0.2的版本。
sudo savanna--manage --config-file /etc/savanna/savanna.conf reset-db --with-gen-templates
sudo savanna-api --config-file /etc/savanna/savanna.conf

5. Questions and Answers.
Q1: can not create DataNode Template through the website
Answer: go to /openstack-horizon/openstack_dashboard/api/savanna.py and modify line 139 and change "task_tracker_opts" to " job_tracker_opts"
if "tt" in str(node_type).lower():
        #template_data["task_tracker"] = task_tracker_opts
        template_data["task_tracker"] = job_tracker_opts
if "dn" in str(node_type).lower():
        #template_data["data_node"] = data_node_opts
        template_data["data_node"] = name_node_opts


Q2: when I start the hadoop cluster and find that the namenode  can no get the correct ip addresses of slavers
Answer:go to /usr/local/lib/python2.7/dist-packages/savanna-0.1.2.a3.gda0f4b7-py2.7.egg/savanna/service/cluster_ops.py and modify the function _check_if_up(nova, node):
    if len(nets) == 0:
            print "VM's networking is not configured yet"
            eventlet.sleep(10)
            return
    This could be improved by another methods.

Q3: when starting hadoop, through the logging file we can see hadoop can not find the host "ubuntu"
Answer: go to cluster_ops.py and modify the following function. adding the mapping between hostname and ip address.
def _generate_hosts(clmap):
    hosts = "127.0.0.1 localhost\n"
    hosts += "127.0.0.1 ubuntu\n"

Q4: through the log, we found the the hadoop can not create the following files.
Answer: go to cluster_ops.py and add the following code in fucntion _setup_node(node,clmap) before ret=_open_channel_and_execute()
     sftp.mkdir('/var/run/hadoop')
        sftp.chmod('/var/run/hadoop',0777)

Q5: how to configure the ip to address http://%s:50030 to see the details of jobtracker
Answers: go to node1 and configure the ip routers
    ipvsadm -A -t node1:port -s rr
    ipvsadm -a -t node1:port -r privateIP:50030 -m -w 1

Q6: hadoop has no privilige to create /tmp/savanna-hadoop-start-all.log
Answers: go to cluster.py and modify the function _start_cluster()
    change the direction of the log file.

Q7: Maybe there is somethings wrong in function _setup_ssh_connection(host,ssh) in cluster_opts.py, you should specify the prot 22 in ssh.connection(host,port,username,passowrd)





step 1 install python enviroment
cd virtual_enev
./install.sh

step 2 create python virtual enviroment to install savanna
virtualenv savanna-install-dir --no-system-site
or
virtualenv savanna-install-dir --system-site-packages

step 3 active python virtual enviroment
cd savanna-install-dir
source bin/active

step 4 install savanna
cd build-bundle
./install.sh

step 4 check savanna installation
cd build-bundle/savanna
python setup.py install

step 5 modify the savanna source codes
cd modified-savanna-code
copy instance.py to savanna-install-dir/lib/python2.7/site-packages/savanna-0.2.1-py2.7.egg/savanna/service
copy network.py to savanna-install-dir//lib/python2.7/site-packages/savanna-0.2.1-py2.7.egg/savanna/service
copy remote.py to savanna-install-dir/lib/python2.7/site-packages/savanna-0.2.1-py2.7.egg/savanna/utils
vim savanna-instal-dir/lib/python2.7/site-packages/savanna-0.2.1-py2.7.egg/savanna/service/instance.py(modify netid)

step 6 create savanna configuation
cd savanna-install-dir/
mkdir etc
cp build-bundle/savanna/etc/savanna/savanna.conf.sample etc/savanna.conf
vim etc/savanna.conf
port=8386
os_auth_host=the ip address of keystone
use_floating_ips=False


step 7 register savanna service
keystone service-create --name savanna --type mapreduce --description "Savanna"
keystone endpoint-create --service-id ed08fa240cbd40898eab09eb9d5c3d0c --internalurl "http://25.8.67.32:9000/v0.2/%(tenant_id)s" --publicurl "http://25.8.67.32:9000/v0.2/%(tenant_id)s" --adminurl "none"

ip = savanna ip
port savanna port 8386
V1.0

step 8 upload ubuntu-hadoop image(savanna-hadoop.qcow2)
glance image-create --name=savanna-0.2-vanilla-hadoop-ubuntu.qcow2 --disk-format=qcow2 --container-format=bare < ./savanna-0.2-vanilla-1.1.2-ubuntu-12.10.qcow2


step 9 start savanna service
pre-condition source savanna-install-dir/bin/active
savanna-api --config-fiel=savanna-install-dir/etc/savanna.conf


step10 install savanna dashboard
create a new terminal( not in python virtual enviroment)
cd savanna-dashborad-0.2.1
python setup.py install

step 11 configu savanna dashbaord
modify  openstack_dashboard/settings.py add savanna to
    HORIZON_CONFIG = {
        'dashboards': ('nova', 'syspanel', 'settings', 'savanna'),

    INSTALLED_APPS = (
        'savannadashboard',
           ....

modify openstack_dashboard/local/local_settings.py
add
SAVANNA_URL='http://ip:port/v1.0'


step 11 translate Chinese





Q1: install nodejs
cd nodejs
./install.sh

Q2 install savanna through network
step 1 install python virtual enviroment
step 2 create python virtual eviroment(virtualenv .....)
step 3 active virtual enviroment
step 4 pip install savanna
step 5 config .....


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值