CDH 06Cloudera Manager服务添加&&HDFSYARN等HA高可用(markdown新版二)
Posted 与自己作战
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CDH 06Cloudera Manager服务添加&&HDFSYARN等HA高可用(markdown新版二)相关的知识,希望对你有一定的参考价值。
文章目录
一、添加服务
1、添加IMPALA服务
1)选择依赖
2)自定义角色分配
3)审核更改–默认
4)命令详细
- 首次
- 完成
5)完成
6)重启hdfs服务
2添加HUE服务
1)添加hue服务
2)选择依赖
3)自定义角色分配
4)配置数据库
5)命令详细
3、添加KAFKA服务
1)添加kafka服务
2)自定义分配角色
3)审核更改
4)命令详细
- 首次
- 完成
5)完成
4、添加SPARK服务
1)添加spark服务
2)选择依赖
3)自定义角色分配
4)审核更改–默认
5)命令详细
-
首次
-
完成
6)完成
7)重启服务
5、添加SENTRY服务
1)添加sentry
2)自定义角色分配
3)数据库配置
4)审核更改–自动过
5)自定义角色分配
- 首次
- 完成
6)完成
二、配置HA高可用
1、HDFS配置HA
1)点击hdfs
2)启动高可用
3)配置Nameservice名称–推荐与集群名称一致
4)分配角色
5)审核更改–推荐指定目录
6)命令详细
7)完成
2、YARN配置HA
1)点击yarn
2)启动高可用
3)配置
4)命令详细
5)完成
3、HBASE配置高可用
1)点击base
2)添加角色实例
3)自定义角色分配
4)停止启动即可
5)完成
以下不用看,是运行脚本
1). vi ssh_to_all_node.sh
#!/bin/bash
ssh_port=36565
domain_name=“yunes.com”
if [ $# -eq 1 ]
then
cmd=$1
elif [ $# -eq 2 ]
then
cmd=$1
grep_host=$2
else
echo “Must at least One parameter: 1. sshCommand; 2. grepHost”
exit 1
fi
local_host=$(hostname -f)
echo $local_host
echo “---------------------------------------------------------”
echo “Begin run command: [ $cmd ] to AllCusterNode, Please waitting…”
echo “”
if [ KaTeX parse error: Expected 'EOF', got '#' at position 1: #̲ -eq 1 ] then …domain_name“|grep -v ‘ipa’|grep -v ‘grep’|awk 'print KaTeX parse error: Expected 'EOF', got '' at position 2: 2̲'` do if …target_host” != “
l
o
c
a
l
h
o
s
t
"
]
;
t
h
e
n
e
c
h
o
"
R
u
n
C
o
m
m
a
n
d
:
s
s
h
r
o
o
t
@
local_host" ]; then echo "Run Command: ssh root@
localhost"];thenecho"RunCommand:sshroot@target_host
c
m
d
"
s
l
e
e
p
1
s
s
h
−
p
cmd" sleep 1 ssh -p
cmd"sleep1ssh−pssh_port root@
t
a
r
g
e
t
h
o
s
t
"
target_host "
targethost"cmd”
fi
done
fi
if [ KaTeX parse error: Expected 'EOF', got '#' at position 1: #̲ -eq 2 ] then …domain_name“|grep -v ‘ipa’|grep -v ‘grep’|grep “$grep_host”|awk 'print KaTeX parse error: Expected 'EOF', got '' at position 2: 2̲'` do if …target_host” != “
l
o
c
a
l
h
o
s
t
"
]
;
t
h
e
n
e
c
h
o
"
R
u
n
C
o
m
m
a
n
d
:
s
s
h
r
o
o
t
@
local_host" ]; then echo "Run Command: ssh root@
localhost"];thenecho"RunCommand:sshroot@target_host
c
m
d
"
s
l
e
e
p
1
s
s
h
−
p
cmd" sleep 1 ssh -p
cmd"sleep1ssh−pssh_port root@
t
a
r
g
e
t
h
o
s
t
"
target_host "
targethost"cmd”
fi
done
fi
2). vi sync_to_all_node.sh
#!/bin/bash
ssh_port=36565
domain_name=“yunes.com”
if [ $# -eq 2 ]
then
source_file=$1
target_dir=$2
elif [ $# -eq 3 ]
then
source_file=$1
target_dir=$2
grep_host=$3
else
echo “Must at least Two parameter: 1. source file, 2. TargetDir, 3.grepForHostName”
exit 1
fi
echo $source_file
echo $target_dir
local_host=$(hostname -f)
echo $local_host
echo “---------------------------------------------------------”
echo “Begin sync file from
l
o
c
a
l
h
o
s
t
:
local_host:
localhost:source_file to AllCusterNode, Please waitting…”
echo “”
if [ KaTeX parse error: Expected 'EOF', got '#' at position 1: #̲ -eq 2 ] then …domain_name“|grep -v ‘ipa’|grep -v ‘grep’|awk 'print KaTeX parse error: Expected 'EOF', got '' at position 2: 2̲'` do if …target_host” != “$local_host” ]; then
echo “Sync file from $source_file to
t
a
r
g
e
t
h
o
s
t
:
target_host:
targethost:target_dir”
sleep 1
scp -P$ssh_port -r
s
o
u
r
c
e
f
i
l
e
r
o
o
t
@
source_file root@
sourcefileroot@target_host😒target_dir/
fi
done
fi
if [ KaTeX parse error: Expected 'EOF', got '#' at position 1: #̲ -eq 3 ] then …domain_name“|grep -v ‘ipa’|grep -v ‘grep’|grep “$grep_host”|awk 'print KaTeX parse error: Expected 'EOF', got '' at position 2: 2̲'` do if …target_host” != “$local_host” ]; then
echo “Sync file from $source_file to
t
a
r
g
e
t
h
o
s
t
:
target_host:
targethost:target_dir”
sleep 1
scp -P$ssh_port -r
s
o
u
r
c
e
f
i
l
e
r
o
o
t
@
source_file root@
sourcefileroot@target_host😒target_dir/
fi
done
fi
# 1). vi ssh_to_all_node.sh
#!/bin/bash
ssh_port=36565
domain_name="yunes.com"
if [ $# -eq 1 ]
then
cmd=$1
elif [ $# -eq 2 ]
then
cmd=$1
grep_host=$2
else
echo "Must at least One parameter: 1. sshCommand; 2. grepHost"
exit 1
fi
local_host=$(hostname -f)
echo $local_host
echo "---------------------------------------------------------"
echo "Begin run command: [ $cmd ] to AllCusterNode, Please waitting..."
echo ""
if [ $# -eq 1 ]
then
for target_host in `cat /etc/hosts |grep "$domain_name"|grep -v 'ipa'|grep -v 'grep'|awk 'print $2'`
do
if [ "$target_host" != "$local_host" ]; then
echo "Run Command: ssh root@$target_host $cmd"
sleep 1
ssh -p$ssh_port root@$target_host "$cmd"
fi
done
fi
if [ $# -eq 2 ]
then
for target_host in `cat /etc/hosts |grep "$domain_name"|grep -v 'ipa'|grep -v 'grep'|grep "$grep_host"|awk 'print $2'`
do
if [ "$target_host" != "$local_host" ]; then
echo "Run Command: ssh root@$target_host $cmd"
sleep 1
ssh -p$ssh_port root@$target_host "$cmd"
fi
done
fi
# 2). vi sync_to_all_node.sh
#!/bin/bash
ssh_port=36565
domain_name="yunes.com"
if [ $# -eq 2 ]
then
source_file=$1
target_dir=$2
elif [ $# -eq 3 ]
then
source_file=$1
target_dir=$2
grep_host=$3
else
echo "Must at least Two parameter: 1. source file, 2. TargetDir, 3.grepForHostName"
exit 1
fi
echo $source_file
echo $target_dir
local_host=$(hostname -f)
echo $local_host
echo "---------------------------------------------------------"
echo "Begin sync file from $local_host:$source_file to AllCusterNode, Please waitting..."
echo ""
if [ $# -eq 2 ]
then
for target_host in `cat /etc/hosts |grep "$domain_name"|grep -v 'ipa'|grep -v 'grep'|awk 'print $2'`
do
if [ "$target_host" != "$local_host" ]; then
echo "Sync file from $source_file to $target_host:$target_dir"
sleep 1
scp -P$ssh_port -r $source_file root@$target_host:$target_dir/
fi
done
fi
if [ $# -eq 3 ]
then
for target_host in `cat /etc/hosts |grep "$domain_name"|grep -v 'ipa'|grep -v 'grep'|grep "$grep_host"|awk 'print $2'`
do
if [ "$target_host" != "$local_host" ]; then
echo "Sync file from $source_file to $target_host:$target_dir"
sleep 1
scp -P$ssh_port -r $source_file root@$target_host:$target_dir/
fi
done
fi
以上是关于CDH 06Cloudera Manager服务添加&&HDFSYARN等HA高可用(markdown新版二)的主要内容,如果未能解决你的问题,请参考以下文章