Cloudera Manager安装之时间服务器和时间客户端(二)

本文详细介绍了如何配置Cloudera Manager集群的时间同步过程,包括设置时间服务器和客户端的具体步骤,确保整个集群时间一致,为后续Cloudera Manager的安装打下坚实的基础。

前期博客

Cloudera Manager安装之Cloudera Manager安装前准备(CentOS6.5)(一)

 

 

 

 

 

带大家手把手读cloudera官网

 https://www.cloudera.com/documentation/enterprise/5-3-x.html

 

   说明:这些是可以点击进入,就直接可以下载得到电子档了。我这里不多赘述。

 

 

 

 

 

 

 

 

  (1) 找一台机器作为时间服务器

  我这里,放到clouderaManager01这台机器!

  注意,之前是已经做了集群时间同步了。

[hadoop@clouderaManager01 ~]$ sudo rpm -qa|grep ntp
fontpackages-filesystem-1.41-1.1.el6.noarch
ntp-4.2.6p5-10.el6.centos.2.x86_64
ntpdate-4.2.6p5-10.el6.centos.2.x86_64
[hadoop@clouderaManager01 ~]$ sudo vim /etc/ntp.conf 

 

 

  默认是如下

复制代码
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client


# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
复制代码

 

 

 

 

   注意,这里有2处地方需要我们进行修改,如下

   因为,

 

   所以,修改地方1:

restrict 192.168.80.0 mask 255.255.255.0 nomodify notrap

 

 

   所以,修改地方2:

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

 

 

   有些人的机器上,如果有,需要如下去掉注释。(我的这里是没有的)

server 127.127.1.0    #local  clock
fudge   127.127.1.0   stratum  10

 

 

 

 

   (2)找一台机器与,保持boss与时间同步

  我这里,放到clouderaManager01这台机器!

 

[hadoop@clouderaManager01 ~]$ sudo vi /etc/sysconfig/ntpd

 

 

   默认是

# Drop root to id 'ntp:ntp' by default.
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"

 

   

   我们,需要进行修改

# Drop root to id 'ntp:ntp' by default.
SYNC_HWCLOCK=yes
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"

   只需,增加如上的一行即可。

 

 

 

  然后,我们需设置clouderaManager01这台机器的时间服务器,为开机就启动,方便呗!

复制代码
[hadoop@clouderaManager01 ~]$ sudo service ntpd status
ntpd is stopped
[hadoop@clouderaManager01 ~]$ sudo service ntpd start
Starting ntpd:                                             [  OK  ]
[hadoop@clouderaManager01 ~]$ sudo chkconfig ntpd on
[hadoop@clouderaManager01 ~]$ sudo chkconfig --list|grep ntpd
ntpd               0:off    1:off    2:on    3:on    4:on    5:on    6:off
ntpdate            0:off    1:off    2:off    3:off    4:off    5:off    6:off
[hadoop@clouderaManager01 ~]$ 
复制代码

 

 

 

 

  (2) 找三台机器作为时间客户端

  我这里,放到clouderaManager02和clouderaManager03这三台机器!

  注意,这里使用的是Linux的定时任务,即Linux  Crontab,必须得root用户来操作啊!我这里是每10分钟同步一次!

[root@clouderaManager02 hadoop]# pwd
/home/hadoop
[root@clouderaManager02 hadoop]# crontab -l
no crontab for root
[root@clouderaManager02 hadoop]# crontab -e

 

 

 

 

 

 

## sync cluster time
0-59/10 * * * * /usr/sbin/ntpdate clouderamanager01

  其实啊,这里的写法很多种,我这里不多赘述,我喜欢用这种。

  第一个*是分

  第二个*是时

  第三个*是天

  第四个*是月

  clouderamanager01指的是,时间同步服务器是在哪台机器上。

  10是每10分钟一次,比如,你也设置为5,即每5分钟一次。

   

  clouderamanager03这台机器也是一样!这里不多赘述了。

 

 

 

 

 

 

 

 ***************************************************************

扩展:

   若是在工作中以后,需要手动来时间同步,则分别在时间客户端(louderaManager02、clouderaManager03和clouderaManager04)上,执行

  sudo /usr/sbin/ntpdate clouderaManager01

   即可,我这里不多说。

 ***************************************************************

 

 

 

 

接下来,我们进入,CM的安装!

Cloudera Manager安装之Cloudera Manager 5.3.X安装(三)(tar方式、rpm方式和yum方式)

转载于:https://www.cnblogs.com/wangsongbai/p/9116089.html

内容概要:本文系统介绍了算术优化算法(AOA)的基本原理、核心思想及Python实现方法,并通过图像分割的实际案例展示了其应用价值。AOA是一种基于种群的元启发式算法,其核心思想来源于四则运算,利用乘除运算进行全局勘探,加减运算进行局部开发,通过数学优化器加速函数(MOA)数学优化概率(MOP)动态控制搜索过程,在全局探索与局部开发之间实现平衡。文章详细解析了算法的初始化、勘探与开发阶段的更新策略,并提供了完整的Python代码实现,结合Rastrigin函数进行测试验证。进一步地,以Flask框架搭建前后端分离系统,将AOA应用于图像分割任务,展示了其在实际工程中的可行性与高效性。最后,通过收敛速度、寻优精度等指标评估算法性能,并提出自适应参数调整、模型优化并行计算等改进策略。; 适合人群:具备一定Python编程基础优化算法基础知识的高校学生、科研人员及工程技术人员,尤其适合从事人工智能、图像处理、智能优化等领域的从业者;; 使用场景及目标:①理解元启发式算法的设计思想与实现机制;②掌握AOA在函数优化、图像分割等实际问题中的建模与求解方法;③学习如何将优化算法集成到Web系统中实现工程化应用;④为算法性能评估与改进提供实践参考; 阅读建议:建议读者结合代码逐行调试,深入理解算法流程中MOA与MOP的作用机制,尝试在不同测试函数上运行算法以观察性能差异,并可进一步扩展图像分割模块,引入更复杂的预处理或后处理技术以提升分割效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值