设为首页 收藏本站
查看: 878|回复: 0

[经验分享] ZooKeeper Installation

[复制链接]

尚未签到

发表于 2015-11-21 16:10:13 | 显示全部楼层 |阅读模式
  来源:https://ccp.cloudera.com/display/CDHDOC/ZooKeeper+Installation#ZooKeeperInstallation-InstallingtheZooKeeperServerPackage
  

  
Contents

  • UpgradingZooKeeper to the Latest CDH3 Release

    • Performinga ZooKeeper Rolling Upgrade

  • Installingthe ZooKeeper Packages

    • Installingthe ZooKeeper Base Package
    • Installingthe ZooKeeper Server Package and Starting ZooKeeper on a Single Server
    • InstallingZooKeeper in a Production Environment
    • Settingup Supervisory Process for the ZooKeeper Server

  • Maintaininga ZooKeeper Server
  • Viewingthe ZooKeeper Documentation
  
Apache ZooKeeper is a highly reliable and available service that provides coordination between distributed processes.


For More Information
From the Apache ZooKeeper site:
"ZooKeeper is a high-performance coordination service for distributed applications. It exposes common services — such as naming, configuration management, synchronization, and group services - in a simple interface so you don't have to write them from scratch.You can use it off-the-shelf to implement consensus, group management, leader election, and presence protocols. And you can build on it for your own, specific needs."

To learn more about Apache ZooKeeper, visit http://zookeeper.apache.org/.
Upgrading ZooKeeper to the Latest CDH3 Release
Note
To see which version of ZooKeeper is shipping in the latest CDH3 release, check the Versionand Packaging Information. For important information on new and changed components, see the ReleaseNotes.
Cloudera recommends that you use a rolling upgrade process to upgrade ZooKeeper: that is, upgrade one server in the ZooKeeper ensemble at a time. This means bringing down each server in turn, upgrading the software, then restarting the server.The server will automatically rejoin the quorum, update its internal state with the current ZooKeeper leader, and begin serving client sessions.

This method allows you to upgrade ZooKeeper without any interruption in the service, and also lets you monitor the ensemble as the upgrade progresses, and roll back if necessary if you run into problems.

The instructions that follow assume that you are upgrading ZooKeeper as part of an upgrade to the latest CDH3 release, and have already performed the steps under UpgradingCDH3.

Performing a ZooKeeper Rolling Upgrade
Follow these steps to perform a rolling upgrade.

Step 1: Stop the ZooKeeper Server on the First Node
To stop the ZooKeeper server:

$sudo /sbin/service hadoop-zookeeper-server stop
or

$sudo /sbin/service hadoop-zookeeper stop
depending on the platform and release.

Warning
You must shut down the ZooKeeper. If ZooKeeper is running during the upgrade, the new version will not work correctly.Step 2: Install the ZooKeeper Base Package on the First Node
See Installing the ZooKeeper Base Package.

Step 3: Install the ZooKeeper Server Package on the First Node
See Installing the ZooKeeper Server Package.

Note
Do not try to start the server yet.Step 4: Re-enable the Server
Because of a packaging problem in earlier releases, you need to re-enable the server manually after upgrading ZooKeeper from CDH3 Update 1 or earlier to the latest CDH3 release:

$sudo /sbin/chkconfig --add hadoop-zookeeper-serverStep 5: Restart the Server
See Installing the ZooKeeper Server Package for instructionson starting the server.

The upgrade is now complete on this server and you can proceed to the next.

Step 6: Upgrade the Remaining Nodes
Repeat Steps 1-5 above on each of the remaining nodes.

The ZooKeeper upgrade is now complete.

Installing the ZooKeeper Packages
There are two ZooKeeper server packages:


  • The hadoop-zookeeper base package provides the basic libraries and scripts that are necessary to run ZooKeeper servers and clients. The documentation is also included inthis package.
  • The hadoop-zookeeper-server package contains the init.d scripts necessary to run ZooKeeper as a daemon process. Because hadoop-zookeeper-server dependson hadoop-zookeeper, installing the server package automatically installs the base package.
Important
If you have not already done so, install Cloudera's yum, zypper/YaST or apt repository before using the following commands to install ZooKeeper. For instructions, see CDH3Installation.Installing the ZooKeeper Base Package
To install ZooKeeper on Ubuntu and other Debian systems:

$sudo apt-get install hadoop-zookeeper

To install ZooKeeper On Red Hat-compatible systems:

$sudo yum install hadoop-zookeeper

To install ZooKeeper on SUSE systems:

$sudo zypper install hadoop-zookeeperInstalling the ZooKeeperServer Package and Starting ZooKeeper on a Single Server
The instructions provided here deploy a single ZooKeeper server in "standalone" mode. This is appropriate for evaluation, testing and development purposes, but may not provide sufficient reliability for a production application. SeeInstallingZooKeeper in a Production Environment for more information.

To install a ZooKeeper server on Ubuntu and other Debian systems:

$sudo apt-get install hadoop-zookeeper-server

To install ZooKeeper On Red Hat-compatible systems:

$sudo yum install hadoop-zookeeper-server

To install ZooKeeper on SUSE systems:

$sudo zypper install hadoop-zookeeper-server
To start ZooKeeper

Note
ZooKeeper may start automatically on installation on Ubuntu and other Debian systems.
Use the following command to start ZooKeeper:

$sudo /sbin/service hadoop-zookeeper-server startInstalling ZooKeeper in a Production Environment
For use in a production environment, you should deploy ZooKeeper as an ensemble with an odd number of nodes. As long as a majority of the servers in the ensemble are available, the ZooKeeper service will be available. The minimum recommended ensemble size isthree ZooKeeper servers, and it is recommended that each server run on a separate machine.

ZooKeeper deployment on multiple servers requires a bit of additional configuration. The configuration file (zoo.cfg) on each server must include a list of all servers in the ensemble, and each server must also have a myid file in its datadirectory (by default /var/zookeeper) that identifies it as one of the servers in the ensemble.

For instructions describing how to set up a multi-server deployment, see Installinga Multi-Server Setup.

Setting up Supervisory Process for the ZooKeeper Server
The ZooKeeper server is designed to be both highly reliable and highly available. This means that:


  • If a ZooKeeper server encounters an error it cannot recover from, it will "fail fast" (the process will exit immediately)


  • When the server shuts down, the ensemble remains active, and continues serving requests


  • Once restarted, the server rejoins the ensemble without any further manual intervention.
Cloudera recommends that you fully automate this process by configuring a supervisory service to manage each server, and restart the ZooKeeper server process automatically if it fails. See the ZooKeeperAdministrator's Guide for more information.

Maintaining a ZooKeeper Server
The ZooKeeper server continually saves znode snapshot files and, optionally, transactional logs in a Data Directory to enable you to recover data. It's a good idea to back up the ZooKeeper Data Directory periodically. Although ZooKeeper is highly reliable becausea persistent copy is replicated on each server, recovering from backups may be necessary if a catastrophic failure or user error occurs.

The ZooKeeper server does not remove the snapshots and log files, so they will accumulate over time. You will need to cleanup this directory occasionally, based on your backup schedules and processes. To automate the cleanup, azkCleanup.sh script isprovided in the bin directory of the hadoop-zookeeper base package. Modify this script as necessary for your situation. In general, you want to run this as a cron task based on your backup schedule.

The data directory is specified by the dataDir parameter in the ZooKeeper configurationfile, and the data log directory is specified by the dataLogDir parameter.

For more information, see Ongoing Data Directory Cleanup.

Viewing the ZooKeeper Documentation
For additional ZooKeeper documentation, see http://archive.cloudera.com/cdh/3/zookeeper/.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-141930-1-1.html 上篇帖子: ZooKeeper 节点类型 下篇帖子: Zookeeper实战之集群模式
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表