hadoop 配置中遇到的问题

1.设置 bash 左侧的 host 值

类似下面有些服务器是内网IP,阿里云甚至是一个随机 ID,在多台内网机器跳转的时候很容易搞不清当前在什么机器上。
ubuntu@ip-10-1-1-43 ~$
因此可以通过这样子 来设定主机名称
sysctl kernel.hostname=hadoop1
设置完后就变成了:
[root@hadoop1 ~]#

2.设置 vpc 内网机器访问外网

一个弹性IP加带宽还是比较贵,如果能所有机器共用一个 ip 那就太好了
带外网的机器是 172.21.248.245, 内网机器为 172.21.248.246
在 245 机器配置 squid

yum install -y squid
vim /etc/squid/squid.conf

编辑以下内容:

# 设置内网网段,根据自己需要设置一个即可
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

# 配置访问黑白名单
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

maximum_object_size 4 MB
cache_mem 64 MB
access_log /var/log/squid/access.log
cache_dir ufs /var/spool/squid 100 16 256
squid -z  # 初始化 squid
systemctl enable squid
service start squid

上面配置好了代理服务器,接下来我们配置内网服务器 246
vim /etc/profile

export ALL_PROXY=http://172.21.248.245:3128
export HTTP_PROXY=$ALL_PROXY
export HTTPS_PROXY=$ALL_PROXY
export FTP_PROXY=$ALL_PROXY
export RSYNC_PROXY=$ALL_PROXY
export http_proxy=$ALL_PROXY
export https_proxy=$ALL_PROXY
export ftp_proxy=$ALL_PROXY
export rsync_proxy=$ALL_PROXY

在 vim /etc/yum.conf 下添加一行
proxy=http://172.21.248.245:3128

3. linux 添加用户

root 环境下

adduser hadoop
passwd -d hadoop 设置Hadoop 无需密码
# 将 hadoop 用户添加到 sudo 组
usermod -aG sudo hadoop

# 假若没有 sudo group
addgroup sudo
# 假若在 centos, 需要修改 /etc/suders 文件
%sudo   ALL=(ALL)       ALL
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容