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

找一台机器作为时间服务器

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

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

 

  在ubuntu系统里,跟centos系统有点出入。

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

 

 

  需要安装

[email protected]:~# sudo apt-get install ntp

 

  然后,再来配置,就不为空了。

[email protected]:~# sudo vim /etc/ntp.conf

 

 

  默认是如下

Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)
Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift


# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# Specify one or more NTP servers.

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org

# Use Ubuntu's ntp server as a fallback.
server ntp.ubuntu.com

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)
Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)

 

 

 

   

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

   因为,

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

 

 

 

 

所以,修改地方1:

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

 

 

 

 

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

  

   注意,Ubuntu系统的时间同步这块,跟centos系统有点出入。

 

 

   

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

Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)
[email protected]:~# sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[email protected]:~# ntpdate pool.ntp.org
25 Jun 17:10:14 ntpdate[9227]: the NTP socket is in use, exiting
[email protected]:~# date
2017年 06月 25日 星期日 17:10:23 CST
[email protected]:~# 
Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)

  ubuntucmbigdata1、ubuntucmbigdata2、ubuntucmbigdata3、ubuntucmbigdata4都去执行。

 

 

 

 

修改linux swap空间的swappiness

   Cloudera 建议将 /proc/sys/vm/swappiness 设置为 0。 
修改swappiness的值为零:

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

Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)
[email protected]:~# cat /proc/sys/vm/swappiness
60
[email protected]:~# echo 0 > /proc/sys/vm/swappiness
[email protected]:~# cat /proc/sys/vm/swappiness
0
[email protected]:~# 
Cloudera Manager安装之时间服务器和时间客户端(Ubuntu14.04)(二)

    我这里,仅拿ubuntucmbigdata1来说,其他的ubuntucmbigdata2、ubuntucmbigdata3和ubuntucmbigdata4是一样的。



本文转自大数据躺过的坑博客园博客,原文链接:http://www.cnblogs.com/zlslch/p/7078457.html,如需转载请自行联系原作者