zookeeper安装部署-单点和集群

Build instructions for Hadoop (Hadoop 编译安装,参考hadoop源码包中BUILDING.txt文档)

----------------------------------------------------------------------------------
Requirements(编译需求,需要满足以下条件才能编译成功):

* Unix System
* JDK 1.6+
* Maven 3.0 or later
* Findbugs 1.3.9 (if running findbugs)
* ProtocolBuffer 2.5.0
* CMake 2.6 or newer (if compiling native code)
* Zlib devel (if compiling native code)
* openssl devel ( if compiling native hadoop-pipes )
* Internet connection for first build (to fetch all Maven and Hadoop dependencies)

安装以上依赖条件:

yum groupinstall “Development tools”
yum -y install cmake zlib openssl gcc zlib-devel openssl-devel make

tar -zxvf protobuf-2.5.0.tar.gz
make && make install
protoc --version

安装maven(apache-maven-3.0.5-bin.zip)
解压、配置环境变量-略
[[email protected] ~]# mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800)
Maven home: /usr/local/maven305
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_67/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
配置软件库:
[[email protected] ~]# ll /home/hadoop/.m2/
total 16
drwxrwxr-x. 56 hadoop hadoop  4096 Mar  3 20:13 repository
-rw-r--r--.  1 hadoop hadoop 10224 Mar  3 20:13 settings.xml
其中repository通过tar包repository.tar.gz解压得到。

编译前安装findbugs
下载:findbugs-3.0.0.tar.gz
解压:
tar  -zxvf findbugs-3.0.0.tar.gz

设置环境变量:
export FINDBUGS_HOME = /usr/local/findbugs
export PATH=$PATH:$FINDBUGS_HOME/bin

执行命令:source /etc/profile或者 . /etc/profile
验证:findbugs -version

----------------------------------------------------------------------------------
编译选项:
Build options:

* Use -Pnative to compile/bundle native code
  * Use -Pdocs to generate & bundle the documentation in the distribution (using -Pdist)
  * Use -Psrc to create a project source TAR.GZ
  * Use -Dtar to create a TAR with the distribution (using -Pdist)

Snappy build options:

Snappy is a compression library that can be utilized by the native code.
   It is currently an optional component, meaning that Hadoop can be built with
   or without this dependency.

* Use -Drequire.snappy to fail the build if libsnappy.so is not found.
    If this option is not specified and the snappy library is missing,
    we silently build a version of libhadoop.so that cannot make use of snappy.
    This option is recommended if you plan on making use of snappy and want
    to get more repeatable builds.

* Use -Dsnappy.prefix to specify a nonstandard location for the libsnappy
    header files and library files. You do not need this option if you have
    installed snappy using a package manager.
  * Use -Dsnappy.lib to specify a nonstandard location for the libsnappy library
    files.  Similarly to snappy.prefix, you do not need this option if you have
    installed snappy using a package manager.
  * Use -Dbundle.snappy to copy the contents of the snappy.lib directory into
    the final tar file. This option requires that -Dsnappy.lib is also given,
    and it ignores the -Dsnappy.prefix option.

OpenSSL build options:

OpenSSL includes a crypto library that can be utilized by the native code.
   It is currently an optional component, meaning that Hadoop can be built with
   or without this dependency.

* Use -Drequire.openssl to fail the build if libcrypto.so is not found.
    If this option is not specified and the openssl library is missing,
    we silently build a version of libhadoop.so that cannot make use of
    openssl. This option is recommended if you plan on making use of openssl
    and want to get more repeatable builds.
  * Use -Dopenssl.prefix to specify a nonstandard location for the libcrypto
    header files and library files. You do not need this option if you have
    installed openssl using a package manager.
  * Use -Dopenssl.lib to specify a nonstandard location for the libcrypto library
    files. Similarly to openssl.prefix, you do not need this option if you have
    installed openssl using a package manager.
  * Use -Dbundle.openssl to copy the contents of the openssl.lib directory into
    the final tar file. This option requires that -Dopenssl.lib is also given,
    and it ignores the -Dopenssl.prefix option.

Tests options:

* Use -DskipTests to skip tests when running the following Maven goals:
    ‘package‘,  ‘install‘, ‘deploy‘ or ‘verify‘
  * -Dtest=<TESTCLASSNAME>,<TESTCLASSNAME#METHODNAME>,....
  * -Dtest.exclude=<TESTCLASSNAME>
  * -Dtest.exclude.pattern=**/<TESTCLASSNAME1>.java,**/<TESTCLASSNAME2>.java
-------------------------------------------------------------------------------------
编译方法:
Building distributions:

Create binary distribution without native code and without documentation:

$ mvn package -Pdist -DskipTests -Dtar

Create binary distribution with native code and with documentation:

$ mvn package -Pdist,native,docs -DskipTests -Dtar

Create source distribution:

$ mvn package -Psrc -DskipTests

Create source and binary distributions with native code and documentation:

$ mvn package -Pdist,native,docs,src -DskipTests -Dtar

Create a local staging version of the website (in /tmp/hadoop-site)

$ mvn clean site; mvn site:stage -DstagingDirectory=/tmp/hadoop-site

----------------------------------------------------------------------------------

Handling out of memory errors in builds(编译过程中可能遇到的问题)

----------------------------------------------------------------------------------

If the build process fails with an out of memory error, you should be able to fix
it by increasing the memory used by maven -which can be done via the environment
variable MAVEN_OPTS.

Here is an example setting to allocate between 256 and 512 MB of heap space to
Maven

export MAVEN_OPTS="-Xms256m -Xmx512m"

----------------------------------------------------------------------------------

编译命令:mvn package -Pdist,native -DskipTests -Dtar

mvn package -DskipTests -Dtar -Dsnappy.lib=/usr/lib64/ -Dbundle.snappy

时间: 2024-08-08 20:09:10

zookeeper安装部署-单点和集群的相关文章

单点登录集群安装教程

在开发中的开源项目JeePlatform:https://github.com/u014427391/jeeplatform 欢迎start(s收藏),打算集成单点登录到自己的开源项目里,所以先搭建环境 [集群简介] 使用nginx作为负载均衡,使用redis存储tomcat session,来实现集群中tomcat session的共享,使用redis作为cas ticket的仓库,来实现集群中cas ticket的一致性. [安装教程] [keepalived安装] 下载keepalived

ZooKeeper环境搭建(单机/集群)(转)

前提: 配置文件主要是在$ZOOKEEPER_HOME/conf/zoo.cfg,刚解压时为zoo_sample.cfg,重命名zoo.cfg即可. 配置文件常用项参考:http://www.cnblogs.com/EasonJim/p/7483880.html 环境搭建: 一.ZooKeeper的搭建方式 ZooKeeper安装方式有三种,单机模式和集群模式以及伪集群模式. 单机模式:ZooKeeper只运行在一台服务器上,适合测试环境: 伪集群模式:就是在一台物理机上运行多个ZooKeepe

部署Hadoop高性能集群

部署Hadoop高性能集群 服务器概述 1)Hadoop是什么 Hadoop是Lucene创始人Doug Cutting,根据Google的相关内容山寨出来的分布式文件系统和对海量数据进行分析计算的基础框架系统,其中包含MapReduce程序,hdfs系统等. Hadoop包括两大核心,分布式存储系统和分布式计算系统. 2)分布式存储 为什么数据需要存储在分布式的系统中哪,难道单一的计算机存储不了吗,难道现在的几个TB的硬盘装不下这些数据吗?事实上,确实装不下.比如,很多的电信通话记彔就存储在很

在CentOS下安装Ngix服务及集群PHP、Tomcat

资源下载地址:http://download.csdn.net/detail/attagain/7570597 一. Ngix依赖模块安装 Ngix依赖模块有:pcre.zlib.openssl.md5 /sha1(如果系统中没有安装相应模块,需要按照下列方式安装) 1. 安装pcre模块(8.35) 官方网站:http://www.pcre.org/ 安装命令: # unzip pcre-8.35.zip # cd pcre-8.35 # ./configure # make && ma

手把手教你用Docker部署一个MongoDB集群

MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中最像关系数据库的.支持类似于面向对象的查询语言,几乎可以实现类似关系数据库单表查询的绝大部分功能,而且还支持对数据建立索引.本文介绍了如何使用Docker搭建MongoDB集群. 本文我会向大家介绍如何使用Docker部署一个MongoDB集群,具体如下: 2.6.5版本的MongoDB 有3个节点的副本集(Replica set) 身份验证 持久化数据到本地文件系统 首先要准备三个运行的Docker服务器,这意味着你

在python中使用zookeeper管理你的应用集群

http://www.zlovezl.cn/articles/40/ 简介: Zookeeper 分布式服务框架是 Apache Hadoop 的一个子项目,它主要是用来解决分布式应用中经常遇到的一些数据管理问题,如:统一命名服务.状态同步服务.集群管理.分布式应用配置项的管理等. 具体简介可以参照这篇文章. zkpython的安装: python中有一个zkpython的包,是基于zookeeper的c-client开发的,所以安装的时候需要先安装zookeeper的c客户端.安装步骤如下:

Kubernetes 通过statefulset部署redis cluster集群

Kubernetes 通过statefulset部署redis cluster集群 作者: 张首富 时间: 2019-02-19 个人博客地址: https://www.zhangshoufu.com QQ群: 895291458 需要有redis基础 Redis集群架构图 每个Mater 都可以拥有多个slave.当Master掉线后,redis cluster集群会从多个Slave中选举出来一个新的Matser作为代替,而旧的Master重新上线后变成 Master 的Slave. 部署re

001.Ansible部署RHCS存储集群

一 前期准备 1.1 前置条件 至少有三个不同的主机运行monitor (MON)节点: 至少三个直接存储(非外部SAN硬件)的OSD节点主: 至少两个不同的manager (MGR)节点: 如果使用CephFS,则至少有两个完全相同配置的MDS节点: 如果使用Ceph对象网关,则至少有两个不同的RADOSGW节点. 一个部署节点,可以使用ceph-ansible包中的Ansible剧本来部署和配置集群. 提示:Red Hat Ceph存储还支持在Red Hat OpenStack平台计算节点上

Zookeeper安装部署

Zookeeper安装部署 Zookeeper部署(单机模式)   下载ZooKeeper ü  http://zookeeper.apache.org/   解压 ü  tar -zxvf zookeeper-3.4.5.tar.gz   配置.在conf目录下创建一个配置文件zoo.cfg: tickTime=2000 dataDir=/home/hadoop/bigdata/zookeeper/datadataLogDir=/home/hadoop/bigdata/zookeeper/da