NIFI:how to get custom log files by tailFail? - apache-nifi

I have nifi-1.3.0-RC1 and i want to get log files i used this :
nifi-1.3.0-RC1/logs/nifi-app.log
but tailFail processor throws and exception :Java.nio.file.NosuchFieleExcption maybe this version of nifi collects its log file somewhere else?

The log files are kept in a directory under $NIFI_HOME, which is the directory containing the bin, conf, lib, logs, etc. directories that Apache NiFi runs from. You can determine this directory by running
If you built NiFi from source, it will be a directory path like:
/Users/alopresto/Workspace/nifi/nifi-assembly/target/nifi-1.4.0-SNAPSHOT-bin/nifi-1.4.0-SNAPSHOT
If you downloaded the binary, it will be something like (after unzipping/untarring):
/Users/alopresto/Downloads/nifi-1.3.0/
It's a good idea to use the absolute path for the filesystem rather than the relative path you have above.

Related

Writer initialization failed.Error opening output file.The system cannot find the path specified

In informatica pc I got an error like Writer initialization failed.Error opening output file.The system cannot find the path specified.
Even I checked the directories and file names but what exactly confused.
It's exactly as it says: the Writer failed to initialize, as it was not able to locate the path and file specified.
Note that PowerCenter Workflows and Mappings are executed on the Server. So while you develop on your local laptop (for example) and place a file in C:\Temp folder, and you are able to see the file, once you run the process, it will be executed on the Server. And the Server will not refer your laptop. It will look for C:\Temp location on its local disk. And if that's a unix box, there won't even be a C: path!
Hence, the process will fail with exactly the message you've seen: initialization failed, error opening output file. You need to place the file in the location accessible by Server.
In case of Writer, you name target location where the file will be created - make sure the user used by PowerCenter does have the write access.

Debugging using Laravel Log files

I am trying to isolate a problem in a backend logic using log file. I have made a custom log file for the purpose because default log file has too much content to filter through. The module is already live so I have to read the log file from the server to debug the problem. I noticed that while performing commit, the log files I created was in gitignore. So I wanted to know how it works. Are log files generally placed in gitignore? And do servers make their own log files?
Yes, the server will create its own log file. Version control should not work with them since the information they contain will be relative to the environment in which they are contained (your server in this case). Therefore, by default, in the storage/logs directory you will find a .gitignore file with the content:
*
! .gitignore
which will cause none of the files contained in it to be managed by Git.
If your new log file is in this directory, it will not be processed by Git either.

Archive multiple folders under a single folder using Ansible

I'm using the below ansible-playbook code to archive multiple folders under IBM folder.
Below is my absolute path Directory structure:
/app
|-- /IBM
|--/test
|--/log
|--/common
|--/api
|--/<unknown folders>
The number of folders and files under IBM folder is unknown hence it seems impossible to specify all the files / folders under IBM under exclude_path attribute.
I wish to build an archive (gz) that has only IBM folder containing only two folders i.e common and api folders while ignoring the rest of the folders and files.
Thus, I wrote the below playbook:
- name: Creating the archive
archive:
path:
- /was/IBM/common
- /was/IBM/api
dest: /var/backup/mysetup.tar.gz
exclude_path:
- /was/IBM/common/log
- /was/IBM/api/tmp
format: gz
This gives me the archive file mysetup.tar.gz.
I want the mysetup.tar.gz file to have a folder called IBM which should have the two folders common and api. Thus, I'm expecting the below in the mysetup.tar.gz no matter what other files are under the IBM folder.
IBM
|--/common
|--/api
But, the mysetup.tar.gz does not have IBM folder but has common and api folders.
I was not specific hence my question did not get answered here: How to archive multiple folders under one folder using Ansible
Can you please guide me as to how I can get the archive to have both the folders inside the IBM folder inside the mysetup.tar.gz?
Requirement you have can't be achieved straight using archive module. Two specific reasons are listed below:
If you specify the path say /app/IBM then the content of the zip file will have the path after IBM something like common/, api/. To get IBM as a root directory inside the tar.gz file, you need to specify path as /app. This brings to the next point about the usage of exclude_path.
exclude_path doesn't work as you would expect. Say, if the path is define as /app and you want to exclude /app/IBM/test, this wouldn't work. exclude_path works only with direct sub folder/file of a defined path (with wildcard) which means that exclusion of /app/IBM/test would work if path defined as /app/IBM/* but that is not what is expected and brings back the previous point. There is already an issue reported on this topic.
So you probably better off using regular tar command using command/shell module.

apache nifi recursively fetch files from web server directory

I have web server with autoindex module that lists all files and folders. Something like that:
How can i recursively fetch all files using Apache NiFi? I tried to use ListFTP/FetchFTP processors, but without any luck.
Can someone tell me what processors should i use for this task?
As remote path you should specify the root folder from which you want to List/Fetch all files and sub folders.
In your case, you put /FILE/store/0002550267/ as remote path, so only files and folders in this directory will be picked up.
Change remote path to /File (or / if you want all files on the server) and you should see all files being listed.

Chef, related path from cookbook to file storage

Is it possibile to get absolute path to cookbook directory(I don't need path to cache).
What I want to do?
My structure:
Chef
-Cookbooks(tomcat, java, etc.)
-Profiles(json files with configs)
-Resources(zip files with programs)
runScript0.bat
runScript1.bat
....
How can I get path to Resources folder from recipes, I need to get files from this folder w/o hardcodded path. Of course I can download programs from svn/git, but I need this option too.
The structure you describe is not inside a cookbook so those files do not exist as far as Chef is concerned. Even inside a cookbook, you need to use a cookbook_file or remote_directory resource to write to a known place first.

Resources