我正在使用CDH 5.2.我可以使用spark-shell来运行命令.
提前致谢
我在Spark中有一个简单的程序:
/* SimpleApp.scala */
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
object SimpleApp {
def main(args: Array[String]) {
val conf = new SparkConf().setMaster("spark://10.250.7.117:7077").setAppName("Simple Application").set("spark.cores.max","2")
val sc = new SparkContext(conf)
val ratingsFile = sc.textFile("hdfs://hostname:8020/user/hdfs/mydata/movieLens/ds_small/ratings.csv")
//first get the first 10 records
println("Getting the first 10 records: ")
ratingsFile.take(10)
//get the number of records in the movie ratings file
println("The number of records in the movie list are : ")
ratingsFile.count()
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试从spark-shell运行此程序时,即我登录到名称节点(Cloudera安装)并在spark-shell上顺序运行命令:
val ratingsFile = sc.textFile("hdfs://hostname:8020/user/hdfs/mydata/movieLens/ds_small/ratings.csv")
println("Getting the first 10 records: ") …Run Code Online (Sandbox Code Playgroud) 我正在Cloudera集群上以YARN客户端模式启动分布式Spark应用程序.过了一段时间,我在Cloudera Manager上看到了一些错误.一些执行器断开连接,系统地发生这种情况.我想调试该问题,但YARN没有报告内部异常.
Exception from container-launch with container ID: container_1417503665765_0193_01_000003 and exit code: 1
ExitCodeException exitCode=1:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
at org.apache.hadoop.util.Shell.run(Shell.java:455)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:702)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:196)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:299)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:81)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Run Code Online (Sandbox Code Playgroud)
如何查看异常的堆栈跟踪?似乎YARN仅报告应用程序异常退出.有没有办法在YARN配置中查看spark executor日志?
我有一个CDH 5.3实例.我首先启动hive-metastore,然后从命令行启动hive-server,启动hive-server2.在此之后我使用beeline连接到我的hive-server2,但显然它不能这样.
Could not open connection to jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (state=08S01,code=0)
Run Code Online (Sandbox Code Playgroud)
另一个问题,我试着看看hive-server2是否正在侦听端口10000.我做了" sudo netstat -tulpn | grep :10000",但没有一个应用程序出现.我还在hive-site.xml中添加了以下属性,但无济于事.为什么它不会出现在netstat上?
<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
<description>TCP port number to listen on, default 10000</description>
</property>
Run Code Online (Sandbox Code Playgroud)
beeline上的connect命令:
!connect jdbc:hive2://localhost:10000 org.apache.hive.jdbc.HiveDriver
Run Code Online (Sandbox Code Playgroud)
当被要求输入用户名和密码时,我只输入相应值的测试"user"和"password",然后抛出错误.任何帮助将不胜感激
我在Ubuntu 12.04上安装了Cloudera Manager 5.9,带有嵌入式postgres数据库.我使用do-release-upgrade将Ubuntu升级到14.04.在此过程中,Postgres也从8.4升级到9.3.现在,当我尝试通过以下方式启动CM数据库时:
# sudo service cloudera-scm-server-db start
Run Code Online (Sandbox Code Playgroud)
我在CM db.log中收到以下错误:
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 8.4, which is not compatible with this version 9.3.15.
Run Code Online (Sandbox Code Playgroud)
我如何通过这个?我看了很多关于通过pg_dump转储postgres数据库并通过psql恢复的文档,但我不知道这在cloudera manager的上下文中是如何应用的,特别是当数据库没有出现时.
在Ubuntu 12.04上,当一切正常时,我相信转储可以像这样:
#pg_dump -h localhost -p 7432 -U scm > /tmp/scm_server_db_backup.$(date +%Y%m%d)
Run Code Online (Sandbox Code Playgroud)
我可以尝试创建一个空数据库并使用psql将转储恢复到此数据库.但是如何配置cdh指向此数据库?
我目前正在尝试学习如何在使用之前安装和配置Cloudera.
所以我安装在VirtualBox,Ubuntu 14.04,Cloudera Manager中.我想在伪单节点上尝试它(只有我的计算机:没有集群).
我设法完成安装.然后指定CDH群集安装的主机; localhost 127.0.0.1
我的问题在于"提供SSH登录凭据".步
安装Cloudera软件包需要对主机进行Root访问.此安装程序将通过SSH连接到您的主机,并以root用户身份或以无密码sudo/pbrun权限的其他用户身份登录,以成为root用户.登录所有主机为:Root
您可以通过密码或公钥验证连接上面选择的用户.验证方法:所有主机都接受相同的密码
输入密码:*********
SSH端口:22
然后继续按钮指向此
所有主机上的安装均失败.安装失败.无法进行身份验证.
"用尽的可用身份验证方法"
我试图重置root密码,没有改变..我试图使用权限无密码的其他用户(不确定我做对了..但没有工作)我尝试使用公共密钥ssh跟随教程这个
ssh-keygen -t rsa -P ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
但是我无法浏览id_rsa.pub的路径...因为Cloudera Manager没有访问权限/.ssh/ :(
我假设我没有完全理解这一步背后的内容,但是没有教程可以传递它.配置这个的任何解决方案?
谢谢你的建议.
我正在通过cloudera-manager-api获得集群.
我正在使用Maven shade-plugin.
还有一个与空指针异常有关的问题,但这并不能解决我的特定问题.它看起来像一个依赖问题,因为如果我在我的IDE中运行该应用程序它工作正常.
当我运行自打包的jar时,它会失败,我可能会缺少什么依赖?
来源如下
String host = HOST_PREFIX + args[0];
String command = args[1];
RootResourceV10 apiRoot = new ClouderaManagerClientBuilder()
.withHost(host).withPort(7180)
.withUsernamePassword(ADMIN, ADMIN).build().getRootV10();
if (apiRoot == null) {
System.exit(0);
}
ClustersResourceV10 clusterResource = apiRoot.getClustersResource();
try {
if (command.equals(START)) {
System.out.println("starting..");
ApiCommand cmd = apiRoot.getClustersResource().startCommand(
"cluster"
);
while (cmd.isActive()) {
cmd = apiRoot.getCommandsResource()
.readCommand(cmd.getId());
}
} else {
System.out.println("stopping..");
ApiCommand cmdstop = apiRoot.getClustersResource().stopCommand(
"cluster"
);
while (cmdstop.isActive()) {
cmdstop = apiRoot.getCommandsResource().readCommand(
cmdstop.getId());
}
}
} catch (NullPointerException e) …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用cloudera Manager 5.9在单个VM中设置hadoop集群(为简单起见).以下是我的环境的详细信息:
Host OS -> Windows 10
Virtualization software -> Virtual box 5.1.10
Guest OS -> Cent OS 6.8
Run Code Online (Sandbox Code Playgroud)
我安装了Cloudera Manager,按照Cloudera Manager的说明,按照步骤操作.
大多数安装步骤都很顺利,但在最后一次检查时失败了.下面是屏幕截图.
从屏幕截图中可以看出,它给出了错误:
"意外错误.无法验证数据库连接."
我已经对Cloudera默认使用的Postgres DB的配置文件进行了必要的更改,也就是说它应该能够接受远程连接.
Cloudera经理的日志中没有错误.我也做了在线搜索,但没有成功.
谁能帮我解决这个错误?
我正在运行cloudera安装的以下命令
./cloudera-manager-installer.bin
Run Code Online (Sandbox Code Playgroud)
接受oracle许可后,我的日志 错误安装失败,请转到2.install-oracle-j2sdk1.7.log
以下是日志文件的内容
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.syringanetworks.net
* extras: mirror.sanctuaryhost.com
* updates: centos.corenetworks.net
Setting up Install Process
No package oracle-j2sdk1.7 available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)
有人有这种错误吗?给出建议?
我们使用Cloudera Manager启用Namenode High Availability
Cloudera Manager >> HDFS >> Action> Enable High Availability >> Selected Stand By Namenode&Journal Nodes然后nameservice1
完成整个过程后,部署客户端配置.
通过列出HDFS目录(hadoop fs -ls /)从Client Machine进行测试,然后手动故障转移到备用namenode并再次列出HDFS目录(hadoop fs -ls /).这项测试完美无缺.
但是当我使用以下命令运行hadoop睡眠作业时它失败了
$ hadoop jar /opt/cloudera/parcels/CDH-4.6.0-1.cdh4.6.0.p0.26/lib/hadoop-0.20-mapreduce/hadoop-examples.jar sleep -m 1 -r 0
java.lang.IllegalArgumentException: java.net.UnknownHostException: nameservice1
at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:414)
at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:164)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:129)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:448)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:410)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:128)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2308)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:87)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2342)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2324)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:351)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:194)
at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:103)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:980)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:974)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:416)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1438)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:974) …Run Code Online (Sandbox Code Playgroud) cloudera-manager ×10
cloudera ×4
hadoop ×4
apache-spark ×3
cloudera-cdh ×3
postgresql ×2
scala ×2
cxf ×1
hadoop-yarn ×1
hadoop2 ×1
hdfs ×1
hive ×1
java ×1
linux ×1
maven ×1
ssh ×1
ubuntu-14.04 ×1