1973
Posts
1225
Kudos Received
124
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 1937 | 04-03-2024 06:39 AM | |
| 3040 | 01-12-2024 08:19 AM | |
| 1664 | 12-07-2023 01:49 PM | |
| 2438 | 08-02-2023 07:30 AM | |
| 3394 | 03-29-2023 01:22 PM |
12-28-2016
08:46 PM
stderr: /var/lib/ambari-agent/data/errors-104.txt Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/stacks/HDF/2.0/hooks/before-INSTALL/scripts/hook.py", line 37, in <module>
BeforeInstallHook().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
method(env)
File "/var/lib/ambari-agent/cache/stacks/HDF/2.0/hooks/before-INSTALL/scripts/hook.py", line 34, in hook
install_packages()
File "/var/lib/ambari-agent/cache/stacks/HDF/2.0/hooks/before-INSTALL/scripts/shared_initialization.py", line 37, in install_packages
retry_count=params.agent_stack_retry_count)
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
self.env.run()
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
self.run_action(resource, action)
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
provider_action()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput())
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
return self._call_with_retries(cmd, is_checked=True, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
code, out = func(cmd, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
result = function(command, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
tries=tries, try_sleep=try_sleep)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
result = _call(command, **kwargs_copy)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install hdf-select' returned 1. Transaction check error:
file /usr/bin/conf-select from install of hdf-select-2.0.2.0-17.el6.noarch conflicts with file from package hdp-select-2.5.0.0-1245.el6.noarch
... View more
Labels:
- Labels:
-
Cloudera DataFlow (CDF)
12-28-2016
06:33 PM
5 Kudos
Create a Box.com Application https://YourCompany.app.box.com/developers/services/ Get your client api, client secret, developer token, use server authentication with OAuth 2.0 + JWT, Add a public key from your developer machine and server. This takes a few steps and you have to create a Private and Public key. openssl genrsa -aes256 -out private_key.pem 2048
openssl rsa -pubout -in private_key.pem -out public_key.pem Anatomy of a Box.com Directory https://myenterprise.app.box.com/files/0/f/26783331215/NIFITEST You need the bolded # for accessing that directory, it is the Folder ID. Box.Com Java SDK <dependency>
<groupId>com.box</groupId>
<artifactId>box-java-sdk</artifactId>
<version>2.1.1</version>
</dependency> Create a New Java Maven Application mvn archetype:generate -DgroupId=com.yourenterprise -DartifactId=boxapp -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false Java Code package com.dataflowdeveloper;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
import com.box.sdk.BoxAPIConnection;
import com.box.sdk.BoxFile;
import com.box.sdk.BoxFolder;
import com.box.sdk.BoxItem;
import com.box.sdk.BoxUser;
public final class Main {
// developer token expires in an hour
private static final String DEVELOPER_TOKEN = "somelongtokenlasts1hour";
private static final int MAX_DEPTH = 1;
private Main() { }
public static void main(String[] args) {
Logger.getLogger("com.box.sdk").setLevel(Level.ALL);
BoxAPIConnection api = new BoxAPIConnection(DEVELOPER_TOKEN);
BoxUser.Info userInfo = BoxUser.getCurrentUser(api).getInfo();
System.out.format("Welcome, %s <%s>!\n\n", userInfo.getName(), userInfo.getLogin());
// the example code lists everything from your root folder down, that could be
// alot, I have 75K files
// BoxFolder rootFolder = BoxFolder.getRootFolder(api);
// listFolder(rootFolder, 0);
BoxFile file = null;
// this is the id of the folder, you can get this two ways from either the URL or
// looking at the output of the root crawl
BoxFolder folder = new BoxFolder(api, "15296958056");
for (BoxItem.Info itemInfo : folder) {
if (itemInfo instanceof BoxFile.Info) {
BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
// lets look at all the attributes, many are null
System.out.println("File:" + fileInfo.getCreatedAt() + "," +
fileInfo.getDescription() + "," +
fileInfo.getExtension() + ",name=" +
fileInfo.getName() + ",id=" +
fileInfo.getID() + "," +
fileInfo.getCreatedBy() + "," +
fileInfo.getSize() + "," +
fileInfo.getVersion().getName() + "," +
fileInfo.getCreatedAt() + "," +
fileInfo.getModifiedAt() + "," +
fileInfo.getModifiedBy() +
"");
// download all the pdfs
if ( fileInfo.getName() != null && fileInfo.getID() != null && fileInfo.getName().endsWith(".pdf")) {
file = new BoxFile(api, fileInfo.getID());
FileOutputStream stream = null;
try {
stream = new FileOutputStream(fileInfo.getName());
} catch (FileNotFoundException e) {
e.printStackTrace();
}
file.download(stream); // downloads to current directory specified in above fileoutputstream
//Input stream for the file in local file system to be written to HDFS
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(fileInfo.getName()));
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
try{
System.out.println("Save to HDFS " + fileInfo.getName());
//Destination file in HDFS
Configuration conf = new Configuration();
String dst = "hdfs://yourserver:8020/box/" + fileInfo.getName();
FileSystem fs = FileSystem.get(URI.create(dst), conf);
OutputStream out = fs.create(new Path(dst));
//Copy file from local to HDFS
IOUtils.copyBytes(in, out, 4096, true);
java.nio.file.Path path = FileSystems.getDefault().getPath(fileInfo.getName());
Files.delete(path);
}catch(Exception e){
e.printStackTrace();
System.out.println("File not found");
}
}
}
}
}
private static void listFolder(BoxFolder folder, int depth) {
for (BoxItem.Info itemInfo : folder) {
String indent = "";
for (int i = 0; i < depth; i++) {
indent += " ";
}
// you need this ID for accessing a folder
System.out.println(indent + itemInfo.getName() + ",ID=" + itemInfo.getID() );
if (itemInfo instanceof BoxFolder.Info) {
BoxFolder childFolder = (BoxFolder) itemInfo.getResource();
if (depth < MAX_DEPTH) {
listFolder(childFolder, depth + 1);
}
}
}
}
} Caveats By default you can only use the Developer Token which only lasts for 1 hour and as soon as you save it will vanish from the screen, so copy it first. Reference:
http://opensource.box.com/box-java-sdk/ https://github.com/box/box-java-sdk/blob/master/doc/authentication.md
https://github.com/box/box-java-sdk/blob/master/doc/folders.md
https://github.com/box/box-java-sdk/blob/master/doc/files.md
https://github.com/tspannhw/boxprocessor
https://docs.box.com/v2.0/docs/configuring-box-platform
https://docs.box.com/docs/app-auth https://github.com/box/box-java-sdk/blob/master/src/example/java/com/box/sdk/example/Main.java https://github.com/box/box-java-sdk/blob/master/doc/folders.md#get-a-folders-items https://github.com/box/box-java-sdk/blob/master/doc/files.md#download-a-file
... View more
Labels:
12-28-2016
03:18 PM
NIFI 1.1 can do that https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.hive.ConvertAvroToORC/index.html
... View more
12-27-2016
03:16 PM
@Constantin Stanca suggested I take a look at the repos [root@tspanndev13 .ssh]# yum repolist
Loaded plugins: fastestmirror
Repository HDP-UTILS-1.1.0.21 is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: denver.gaminghost.co
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirror.sjc02.svwh.net
* updates: mirror.keystealth.org
repo id repo name status
HDF-2.0 HDF-2.0 39
HDF-2.1.0.0 HDF Version - HDF-2.1.0.0 41
HDP-2.5 HDP-2.5 200
HDP-UTILS-1.1.0.21 HDP-UTILS-1.1.0.21 52
!Updates-ambari-2.4.2.0 ambari-2.4.2.0 - Updates 12
base/7/x86_64 CentOS-7 - Base 9,363
cuda cuda 173
draios/x86_64 Draios 16
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,955
epel-apache-maven/7/x86_64 maven from apache foundation. 3
extras/7/x86_64 CentOS-7 - Extras 435
home_oojah_mqtt mqtt (CentOS_CentOS-7) 8
updates/7/x86_64 CentOS-7 - Updates 399
repolist: 21,696 Seems I have a few extra in there to delete. That fixed it.
... View more
12-27-2016
01:58 PM
Traceback (most recent call last): File "/var/lib/ambari-agent/cache/stacks/HDF/2.0/hooks/before-INSTALL/scripts/hook.py", line 37, in <module>
BeforeInstallHook().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
method(env)
File "/var/lib/ambari-agent/cache/stacks/HDF/2.0/hooks/before-INSTALL/scripts/hook.py", line 34, in hook
install_packages()
File "/var/lib/ambari-agent/cache/stacks/HDF/2.0/hooks/before-INSTALL/scripts/shared_initialization.py", line 37, in install_packages
retry_count=params.agent_stack_retry_count)
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
self.env.run()
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
self.run_action(resource, action)
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
provider_action()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 54, in action_install
self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 49, in install_package
self.checked_call_with_retries(cmd, sudo=True, logoutput=self.get_logoutput())
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 83, in checked_call_with_retries
return self._call_with_retries(cmd, is_checked=True, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/__init__.py", line 91, in _call_with_retries
code, out = func(cmd, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
result = function(command, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
tries=tries, try_sleep=try_sleep)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
result = _call(command, **kwargs_copy)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install hdf-select' returned 1. Transaction check error:
file /usr/bin/conf-select from install of hdf-select-2.0.2.0-17.el6.noarch conflicts with file from package hdp-select-2.5.0.0-1245.el6.noarch
Error Summary
... View more
Labels:
- Labels:
-
Apache Hadoop
12-27-2016
01:22 AM
I uninstalled everything, rebooted. Reinstalled and everything worked great. Perhaps a typo in my install.
... View more
12-26-2016
11:54 PM
newst on cenots7
... View more
12-26-2016
07:52 PM
1 Kudo
26 Dec 2016 19:49:14,900 INFO [main] ClasspathScannerUtils:64 - Found class [class org.apache.ambari.server.audit.request.eventcreator.ViewPrivilegeEventCreator]
26 Dec 2016 19:49:15,866 INFO [main] HostRoleCommandDAO:258 - Host role command status summary cache enabled !
26 Dec 2016 19:49:15,868 INFO [main] TransactionalLock$LockArea:121 - LockArea HRC_STATUS_CACHE is enabled
26 Dec 2016 19:49:16,157 INFO [main] AmbariServer:914 - Getting the controller
26 Dec 2016 19:49:17,580 ERROR [main] AmbariServer:929 - Failed to run the Ambari Server
org.apache.ambari.server.AmbariException: Current database store version is not compatible with current server version, serverVersion=2.4.2.0, schemaVersion=2.4.0
at org.apache.ambari.server.checks.DatabaseConsistencyCheckHelper.checkDBVersionCompatible(DatabaseConsistencyCheckHelper.java:147)
at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:919)
... View more
Labels:
- Labels:
-
Apache Ambari
12-26-2016
07:51 PM
https://community.hortonworks.com/articles/7882/hdfnifi-best-practices-for-setting-up-a-high-perfo.html https://community.hortonworks.com/questions/46867/javalangoutofmemoryerror-permgen-space-in-nifi.html
... View more