Running the Cloudera Training VM in VirtualBox(转)

本文提供了一步一步的指导教程,教你如何将 Cloudera 的 Hadoop 培训虚拟机从 VMware 转换到 VirtualBox 平台上运行,并实现了与桌面环境的良好集成。

Cloudera’s Training VM is one of the most popular resources on our website. It was created with VMware Workstation, and plays nicely with the VMware Player for Windows, Linux, and Mac. But VMware isn’t for everyone. Thomas Lockney has managed to get our VM image running on Virtual Box, and has written a step-by-step guide for the community. Thanks Thomas! – Christophe

I was quite pleased when I discovered that Cloudera had created a virtual machine image that could be used while working through their training material. It would make the process simpler, and it looked like a potentially useful environment for general Hadoop experimentation. However, their VM is built for VMware, which I stopped using a while back. However, as a heavy VirtualBox user, I knew that it would not be hard to get it running in my preferred desktop virtualization environment.

Here’s a step-by-step guide for getting Cloudera’s virtual machine image up and running. I’ll include screenshots for most of the steps to make it as clear as possible. I’ll assume you already have at least some familiarity with running VirtualBox (if not, there are plenty of good tutorials and references available online) and some experience with Ubuntu or some other fairly modern Linux desktop system.

1. The first step is to download the virtual machine from the Hadoop Training Virtual Machine page on Cloudera’s site. The version at the time of this writing is 3.1, and the filename you’ll end up with is cloudera-training-0.3.1.tar.bz2. Once you have downloaded the file (this may take a little while — it’s quite large), decompress it somewhere useful. On a Unix-based machine (e.g., Linux or OS X), you can do this by running the following command:

tar xjf cloudera-training-0.3.1.tar.bz2

2. Next, start up VirtualBox. Once it loads, go to the File menu and select Virtual Media Manager.

3. The Virtual Media Manager is where you set up new drive images. An image needs to be created before you can use it with a virtual machine. In this case, you’re creating a new image by pointing to the existing image, which was supplied with the Cloudera VM download. It’s a VMware image (a .vmdk file), which VirtualBox can read.

In the Virtual Media Manager window, click New to create a new image.

4. In the file dialog box that appears, browse to the directory where you extracted the download and select the file cloudera-training-0.2-cl3.vmdk. Please note that this name will likely change with later releases, so you might need to experiment to find the right file. If that is the case, you’ll be looking for files ending in .vmdk. Note that files with the s00# names are generally either snapshots or extensions to the base drive image (you can choose to have the image split up into multiple files).

 

5. After closing the Virtual Media Manager window, click the New button in the main VirtualBox window to create a new virtual machine.

6. From the Create New Virtual Machine dialog box, give your new machine a name. Select Linux as the operating system and Ubuntu as the version.

7. On the next screen, set the memory size. The VMware image that Cloudera created has 1024 MB assigned, but I’ve found I can get away with less for basic needs. If you plan to do full development in this VM, set it higher (if you have the space to spare).

8. Next, you’ll select the hard disk image, which we added earlier.

9. Double check the summary before clicking Finish .

10. After closing the Virtual Machine Wizard, you can select the Cloudera machine that you just created and click Start .

11. Assuming you’ve done everything correctly up to this point and your VirtualBox installation is working properly, you should see a window pop up with the boot-up messages for the new virtual machine. Watch this to make sure everything is booting fine. If you see error messages here or if your machine doesn’t boot up correctly, you may have missed a step earlier or selected the wrong file for the hard disk image.

12. After a few moments, you should see the desktop of your new image. If you’ve gotten this far, you can stop here if you want, but you’ll be missing out on the enhanced functionality that VirtualBox offers, such as better integration with your existing desktop, sharing of files, etc.

13. If you want full integration, open a terminal and run the following command:

sudo apt-get install build-essential linux-headers-`uname -r`

This will install the basics that you need before loading the VirtualBox additions.

 

14. Select Install Guest Additions from the Devices menu.

15. You should now see a pop-up window prompting you to run the installer for the guest additions. Click the Run button to continue.

16. If the dependencies installed correctly earlier, you’ll see a terminal window, which will show you the progress as the add-ons are installed.

 

17. At this point, you can select Shutdown from the system menu in the top menu bar, and then choose Restart to reboot your virtual machine. When the VM restarts and the desktop is fully loaded, you should be able to resize the window, use your mouse seamlessly between the virtual machine window and your desktop, and add a shared folder (see the VirtualBox documentation for instructions on this).

One last thing: there is a call at the very end of /etc/init.d/rc.local to /usr/bin/vmware-user that you might want to remove. It won’t hurt anything if you leave it there, but you will occasionally see error messages at startup or shutdown due to its presence. I finally hunted it down just now after running this VM for a while, so it’s really not a big deal.

That’s all folks!

 

参考连接:

http://www.cloudera.com/blog/2009/07/cloudera-training-vm-virtualbox/

 

注:启动后,如果启动失败。可以尝试修改virtual中对应系统的,设置->系统->处理器标签中,选中“启用PAE/NX”。

        可以使用以上这种方法生成多个虚拟机,然后构成云环境。

下载前可以先看下教程 https://pan.quark.cn/s/16a53f4bd595 小天才电话手表刷机教程 — 基础篇 我们将为您简单的介绍小天才电话手表新机型的简单刷机以及玩法,如adb工具的使用,magisk的刷入等等。 我们会确保您看完此教程后能够对Android系统有一个最基本的认识,以及能够成功通过magisk root您的手表,并安装您需要的第三方软件。 ADB Android Debug Bridge,简称,在android developer的adb文档中是这么描述它的: 是一种多功能命令行工具,可让您与设备进行通信。 该命令有助于各种设备操作,例如安装和调试应用程序。 提供对 Unix shell 的访问,您可以使用它在设备上运行各种命令。 它是一个客户端-服务器程序。 这听起来有些难以理解,因为您也没有必要去理解它,如果您对本文中的任何关键名词产生疑惑或兴趣,您都可以在搜索引擎中去搜索它,当然,我们会对其进行简单的解释:是一款在命令行中运行的,用于对Android设备进行调试的工具,并拥有比一般用户以及程序更高的权限,所以,我们可以使用它对Android设备进行最基本的调试操作。 而在小天才电话手表上启用它,您只需要这么做: - 打开拨号盘; - 输入; - 点按打开adb调试选项。 其次是电脑上的Android SDK Platform-Tools的安装,此工具是 Android SDK 的组件。 它包括与 Android 平台交互的工具,主要由和构成,如果您接触过Android开发,必然会使用到它,因为它包含在Android Studio等IDE中,当然,您可以独立下载,在下方选择对应的版本即可: - Download SDK Platform...
### 解决 Cloudera QuickStart VM 权限不足的问题 在使用 Cloudera QuickStart VM 的过程中,权限不足是一个常见的问题。以下是针对该问题的具体解决方案: #### 1. 修改 HDFS 用户目录权限 如果遇到无法访问某些 HDFS 路径的情况,可以通过修改路径的拥有者来解决问题。例如,在虚拟机中运行以下命令可以更改 `/user/cloudera` 目录的所有权给 `cloudera` 用户[^4]。 ```bash sudo -u hdfs hadoop fs -chown cloudera /user/cloudera ``` 此操作会将指定路径的所有权更改为当前用户(这里是 `cloudera`),从而允许其对该路径执行读写操作。 #### 2. 配置 sudoers 文件 有时需要以管理员身份运行特定命令,而默认情况下可能未授予足够的权限。此时可编辑 `sudoers` 文件并添加必要的权限设置。具体方法如下: - 打开终端输入 `visudo` 命令进入编辑模式; - 添加一行内容: ```plaintext cloudera ALL=(ALL) NOPASSWD:ALL ``` 这一步使得 `cloudera` 用户无需密码即可通过 `sudo` 提升权限。 #### 3. 设置正确的文件系统权限结构 对于本地磁盘上的数据存储位置或其他资源访问需求,则需确保这些区域具有适当的操作许可级别。通常做法包括但不限于调整 Linux 文件系统的 ACL (Access Control List),或者直接赋予整个项目工作区完全控制权: ```bash chmod -R 755 /path/to/workdir/ chown -R cloudera:cloudera /path/to/workdir/ ``` 上述两条指令分别设置了目标文件夹及其子项的安全属性以及归属关系,使其更适合多进程协作环境中的开发测试活动[^1]。 #### 4. 检查 Kerberos 认证状态 当集群启用了安全机制时,还需要确认客户端已成功完成认证流程才能正常交互服务端组件。如果是这种情况引起的错误提示,请按照官方文档指引重新验证票据有效性或尝试刷新缓存副本[^2]: ```bash kinit -kt /etc/security/keytabs/hdfs.headless.keytab hdfs ``` 以上步骤能够有效缓解因鉴权失败而导致的功能受限现象。 --- ### 总结 综上所述,解决 Cloudera QuickStart VM 中 “insufficient permissions” 错误的方法主要包括调整 HDFS 和操作系统层面的不同层次授权策略,并视具体情况决定是否涉及额外的身份验证环节处理。实际操作前建议先备份重要资料以防万一发生意外丢失情况。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值