Here we will give details about what is Docker file, it’s content along the deployment steps to deploy the application into AWS.
Login in you AWS Account.
At first you need to create an instance in AWS or GCP. I have some articles on how you can create instance on AWS here.
Next, we need to connect to that instance. There are many ways to connect to an instance like Putty / Terminal or Console form AWS or GCP. If you want to connect from Putty then follow my other article here.
Docker file: Pull the latest(1.15.3) nifi docker image from https://hub.docker.com/r/apache/nifi/ in your local system.
Code Block docker pull apache/nifi:1.15.3
Run the pulled docker image
Secure Mode(with https)
Code Block docker run -p 8443:8443 -e SINGLE_USER_CREDENTIALS_USERNAME=admin -e SINGLE_USER_CREDENTIALS_PASSWORD='admin@123' -e NIFI_WEB_HTTPS_PORT='8443' -e NIFI_WEB_PROXY_HOST='192.168.100.100:8443' apache/nifi:1.15.3
When we will use secure mode then few useful environment variables are
custom login username and password set
SINGLE_USER_CREDENTIALS_USERNAME
andSINGLE_USER_CREDENTIALS_PASSWORD
.Replace
NIFI_WEB_PROXY_HOST
value with your ec2 Public IPv4 address valueIf username/password not set executed in command then It will create some auto-generated credentials and we'll see them in the
nifi-app.log
.Code Block Generated Username [USERNAME] Generated Password [PASSWORD]
NIFI_WEB_HTTPS_PORT
secure port no,NIFI_WEB_HTTPS_HOST
secure host ip or domain name.open nifi url in browser
https://instance-host:8443/nifi
Unsecure Mode(with http)
Code Block docker run -p 8080:8080 -e NIFI_WEB_HTTP_PORT='8080' apache/nifi:1.15.3
NIFI_WEB_HTTP_PORT
unsecure port no,NIFI_WEB_HTTP_HOST
secure host ip or domain name.open nifi url in browser
http://instance-host:8080/nifi
...
Upload AtaGlancee template in NIFI
Open the Nifi Url
http://instance-host:8080/nifi
and Login(If required)Create 2 Global Variable
ADDON_KEY = datapluginweb
VMH_MONGO_URI = MongoDB server url
Like : mongodb://admin:admin12345@instance-host:27017/master?authSource=admin
3. Next, import the all ataglance template here.
View file | ||
---|---|---|
|
4. Now drag all the templates on nifi dashboard.
...
Set Log Size in nifi through SSH Login
Login the aws server using ssh(open cmd terminal)
Code Block ssh -i nifibetaintancepair.pem ec2-user@18.222.63.48
find the running docker image container
docker ps
copy the container id and execute the docker bash
docker exec --user="root" -it <container_name> bash
Check logs file size
/nifi-current/logs$ ls -lh
Remove Logs
/nifi-current/logs$ rm nifi-app_*.log
Set maximum log size go to on
/nifi-current$ cd conf
find the
logback.xml
file/nifi-current/conf$ ls
edit the file
/nifi-current/conf$ vi logback.xml
if vi command not exist then install first/nifi-current/conf$ apt-get install vim -y
press +i
for edit file. add totalSizeCap value on logs sectionCode Block <totalSizeCap>10GB</totalSizeCap>
after edit save the change.
press ESC
thentype :wq
check your changes using by
/nifi-current/conf$ cat logback.xml