Hypertable - 安装-单机

Hypertable 有几种安装方式,入下表:

1.  单机:安装于单机,采用本地文件系统

2.  Hadoop:分布式安装,在Hadoop之上(HDFS)

3.  MapR:分布式安装,在MapR之上

4.  ThriftBroker:在应用服务器上安装ThriftBroker

Standalone

(http://hypertable.com/documentation/installation/quick_start_standalone/)

单机

For applications that need the performancecharacteristics and data model that Hypertable has to offer, but don'trequire horizontal scalability, Hypertable can be setup to run on a singlemachine over its native filesystem. For better performance characteristics,this machine can be configured with an SSD drive. This document describes howto get Hypertable up and running on a single standalone machine.

有些应用,只需要Hypertable的性能特性和数据模型,不需要水平扩展,这时,可以将Hypertable部署到单机,运行在本地文件之上。为了达到更好的性能,这台机器可以配置有SSD驱动器。本文描述了如何将Hypertable部署到单机并使之运行。

Table of Contents

Prerequisites

Step 1 - Install Hypertable Package

Step 2 - FHS-ize Installation

Step 3 - Set "current" link

Step 4 - Setup data volume

Step 5 - Edit Hypertable Configuration File

Step 6 - Start Hypertable

Step 7 - Verify Installation

Step 8 - Stop Hypertable

What Next?

目录

先决条件

步骤1 – 安装Hypertable包

步骤2 –FHS-ize安装

步骤3 – 设置“current”链接

步骤4 – 建立数据空间

步骤5 – 编辑配置文件

步骤6 – 启动Hypertable

步骤7 – 验证安装

步骤8 – 停止Hypertable

下一步?

Prerequisites

先决条件

Before you getstarted with the installation, there are some general system requirements thatneed to be satisfied before proceeding.  These requirements are describedas follows:

  • root access - If you plan toinstall Hypertable in the standard location (/opt/hypertable) you will needroot access to create and populate that directory.  You can either carryout the steps below while logged in as the root user or you need to havesudo privileges.  If you do not have root access, you can install the.tar.bz2 package anywhere you like.
  • open file limit - Most operatingsystems have a limit on the total number of files that a process can have openat any one time.  If you plan to load a large amount of data intoHypertable, you will likely need to increase this limit.  See Open File Limit for details on how to increase this limit.
  • firewall - The Hypertableprocesses use TCP and UDP to communicate with one another and with clientapplications.  Firewalls can block this traffic and prevent Hypertablefrom operating properly.  Any firewall that blocks traffic to or fromspecific ports should be disabled or the appropriate ports should be opened upto allow Hypertable communication.  SeeHypertableFirewall Requirements for instructions on how to do this.
  • VERSION - This document assumes that the shell variable $VERSION contains the version number of Hypertable being installed (e.g. 0.9.5.5).

在开始安装以前,有一些基本的要求,如下:

  • root用户权限 – 如果你想将Hypertable安装到标准位置(/opt/hypertable),你需要root账户获得该目录的创建和控制权限。你可以采用root账户登录或使用sudo权限来进行下面的安装步骤。如果你没有root权限,你能将这个.tar.bz2包安装到你喜欢的其它位置。
  • 打开文件的限制 – 大多数操作系统对一个进程所能同时打开的最多文件的数目都有限制。如果你计划将大量文件载入Hypertable,你可能需要修改这个限制值。关于增加此限制的细节参考“Open File Limit”。
  •  防火墙 – Hypertable进程间以及与客户应用间采用TCP和UDP通讯。防火墙可能阻止这种通讯,使Hypertable不能正常工作。任何阻止这种通讯或关闭特定端口的防火墙都不应该打开,Hypertable必需通过特定的端口通讯。关于如何做请参阅“Hypertable Firewall Requirements”(http://hypertable.com/documentation/misc/firewall_requirements/)。
  • 版本 -.本文假定环境变量$VERSION包含安装的Hypertable的版本号(例如0.9.5.5)。

Step1 - Install Hypertable Package

步骤1– 安装Hypertable包

Hypertable can be installed via binarypackages which can be downloaded as described on the HypertableDownload page. Thepackages come bundled with nearly all of the dependent shared libraries. Thenice thing about this approach is that just two packages are required forlinux, a 64-bit linux package and a 32-bit linux package. The only requirementis that your system be built with glibc 2.4+ (released on March 6th 2006) whichprovides stack smashing protection.    Hypertable comes with aprogram launch script, ht, that sets up LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH)to point to the lib/ directory of the installation so that the dependentlibraries can be found by the dynamic linker.

Hypertable可以通过二进制包来安装,该包可以从Hypertable网站的Download页下载。这个包捆绑了几乎所有依赖的共享库。采用这种方法安装,在Linux上只需要两个包:64位Linux包和32位Linux包。唯一的要求是你的系统构建于glibc2.4(2006年3月6日发布)及以上,该版中,提供了栈(溢出)保护。Hypertable带着一个启动脚本ht,它创建了LD_LIBRARY_PATH (或 DYLD_LIBRARY_PATH),指向安装目录的lib/目录,则动态链接器能找到依赖的库。

To begin the package installation, switch tothe directory containing the package file and then issue the command listedbelow for your operating system.

安装包时,切换到包含安装包的目录,根据操作系统的不同,使用以下命令。

Redhat, CentOS, or SUSE Installation

$ sudo rpm -ivh --replacepkgs --nomd5 package.rpm

Debian or Ubuntu Installation

$ sudo dpkg --install package.deb

Bzipped Archive Installation

$ sudo tar xjvf package.tar.bz2

Mac installation

Double-click the package.dmg file and follow theinstructions

The Redhat, Debian, and Mac packages willinstall Hypertable under a directory by the name of /opt/hypertable/$VERSION bydefault.  You will need to change the ownership of the installation filesand directories to the owner that you plan to launch the services as. Forexample:

在RedHat,Debian和Mac下,缺省情况时会将Hypertable安装到/opt/hypertable/$VERSION下,你需要更改安装目录和文件的所有者,变为你打算采用的启动服务的用户,例如

sudo chown -R john:staff /opt/hypertable/$VERSION

Step 2 - FHS-ize安装

步骤2– FHS-ize安装

See Filesystem Hierarchy Standard for an introduction to FHS. Create the directories /etc/opt/hypertableand /var/opt/hypertable on all machines in the cluster and change ownership tothe user account under which the binaries will be run. For example:

FHS的介绍参阅“Filesystem Hierarchy Standard”(http://hypertable.com/documentation/misc/filesystem_hierarchy_standard_fhs/)。在机架的所有机器上创建两个目录/etc/opt/hypertable和 /var/opt/hypertable,修改其所有者为运行者账户,例如:

$ sudo mkdir /etc/opt/hypertable /var/opt/hypertable

$ sudo chown john:staff /etc/opt/hypertable /var/opt/hypertable

Then FHS-ize the installation with thefollowing command:

然后,采用如下命令FHS化安装过程:

$ /opt/hypertable/$VERSION/bin/fhsize.sh

Step 3 - Set "current" link

步骤3– 设置”current”链接

To make the latest version of Hypertablereferenceable from a well-known location, we recommend setting a"current" link to point to the latest installation.  Afterinstallation, make a symlink from /opt/hypertable/current to point to thelatest installed version.

为使Hypertable能从一个公开的位置得到最新的版本,建议设置一个”current”,指向最新版Hypertable的安装位置。安装完成后,建立一个符号链接从/opt/hypertable/current指向最新版的安装。

$ cd /opt/hypertable

$ ln -s $VERSION current

Step 4 - Setup datavolume

步骤4– 建立数据空间

To configure the Hypertable installation towrite to the correct data volume, make sure the volume is formatted and mountedsomewhere, for example /data. Then create a directory on that data volume toserve as the toplevel directory for the Hypertable data files.  Forexample:

为使Hypertable能正确写入数据,请确认空间已被格式化,并安装(mount)到某处,例如,/data。然后,在数据空间上创建一个目录,作为Hypertable的顶级数据文件目录,例如

$ sudo mkdir -p /data/hypertable/fs

Then make sure this directory is readable andwriteable by the user account from which you will be running the Hypertableservice.  For example:

请确保在你运行Hypertable服务的账户对这个目录具有可读可写权限,例如:

$ sudo chown -R john:staff /data/hypertable

Finally, create a symbolic link called"fs" inside the Hypertable installation pointing to the directory youjust created on the data volume.  For example:

最后,在Hypertable安装位置创建一个符号链接”fs”,指向你刚才创建的数据卷的目录,例如:

$ cd /opt/hypertable/current
$ ln -s /data/hypertable/fs

Step5 - Edit Hypertable Configuration File

步骤5– 编辑Hypertable配置文件

Open the file/opt/hypertable/current/conf/hypertable.cfg file in an editor and modify theHyperspace.Replica.Host property to contain the name of your local machine instead of localhost. For example:

用一个编辑器打开文件/opt/hypertable/current/conf/hypertable.cfg,修改Hyperspace.Replica.Host属性,包含本地的机器名,而部署localhost,例如:

Hyperspace.Replica.Host=yourmachine

This modification will allow other machinesin your network to access this local Hypertable instance by simply copying thismodified configuration file into the conf/ directory of their Hypertable installation:

这样修改后,只要把这个修改后的配置文件拷贝到网络中其他机器上的Hypertable安装位置的conf/目录下,其他机器就能访问本地的Hypertable实例:

othermachine$ scpyourmachine:/opt/hypertable/current/conf/hypertable.cfg/opt/hypertable/current/conf

othermachine$ /opt/hypertable/current/bin/ht shell

Step 6 - StartHypertable

步骤6– 启动Hypertable

Run the following command to launchHypertable.

运行下面的命令启动Hypertable。

$ /opt/hypertable/current/bin/start-all-servers.sh local

It will generate output that looks like thefollowing

它产生的输出看起来如下:

DFS broker:available file descriptors: 256

Started DFSBroker (local)

Started Hyperspace

Started Hypertable.Master

Started Hypertable.RangeServer

Started ThriftBroker

Step 7 - VerifyInstallation

步骤7– 验证安装

Create a table.

创建表。

echo "USE '/'; CREATE TABLE foo ( c1, c2 ); GETLISTING;" \

    |/opt/hypertable/current/bin/ht shell --batch

The output ofthis command should look like:

它的输出看起来像这样:

foo

sys (namespace)

 

Load some data.

载入数据

echo "USE '/'; INSERT INTO foo VALUES('001','c1', 'very'), \

    ('000','c1', 'Hypertable'), ('001', 'c2', 'easy'), ('000', 'c2', 'is');" \

| /opt/hypertable/current/bin/ht shell –batch

 

Dump the table.

输出表。

echo "USE '/'; SELECT * FROM foo;" \

| /opt/hypertable/current/bin/ht shell –batch

 

The output ofthis command should look like:

它的输出看起来像这样:

000         c1            Hypertable

000         c2            is

001         c1            very

001         c2            easy

Step 8 - StopHypertable

步骤8– 停止Hypertable

To stopHypertable, run the following command:

要停止Hypertable,运行如下命令:

$ /opt/hypertable/current/bin/stop-servers.sh

To wipeHypertable clean, removing all tables, run the following command (which willstop Hypertable if it is not already stopped):

要清理Hypertable,删除所有的表,运行如下的命令(如果Hypertable未停止,会停止Hypertable):

$ /opt/hypertable/current/bin/clean-database.sh

What Next?

下一步

Congratulations! Now that you have successfully installed Hypertable, we recommend that you walkthrough theHQL Tutorial to get familiar with using the system.

恭喜!现在你已经成功安装了Hypertable,我们建议你继续HQL之旅。

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值