Member since
07-14-2016
215
Posts
45
Kudos Received
16
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
3789 | 12-13-2018 05:01 PM | |
10553 | 09-07-2018 06:12 AM | |
2758 | 08-02-2018 07:04 AM | |
3732 | 03-26-2018 07:38 AM | |
2836 | 12-06-2017 07:53 AM |
11-30-2017
10:29 AM
I would suggest that you try to find a machine with higher CPU and RAM (13 GB might not be sufficient) so that there is no resource constraints.
... View more
11-30-2017
10:21 AM
1 Kudo
Hey
@Gaurav Bapat, looks like a resource issue to me. Can you vagrant ssh into the box and see if ambari-server is running using the command ambari-server status ? If it is running, then from browser launch Ambari UI http://node1:8080 and you will be able to see the different service status. If many of the services are showing as red or not running, then it is apparent that you might be hitting the system limits.
I would suggest that you try to find a machine with higher CPU and RAM (13 GB might not be sufficient) so that there is no resource constraints.
... View more
11-29-2017
05:06 AM
1 Kudo
This is where the crux of the whole deployment happens - Ambari first installs all the services, and then starts them.
... View more
11-29-2017
04:53 AM
@Gaurav Bapat 1) For the multinode install, I would recommend that you try to setup HCP by following the documentation at: https://docs.hortonworks.com/HDPDocuments/HCP1/HCP-1.3.1/bk_installation/content/installation_info_roadmap.html 2) For the Ambari going down, you need NOT do 'vagrant up' every time. Ambari dying out probably indicates that you are having a resource crunch on the VM. In order to bring up Ambari, you can follow these steps: cd metron-deployment/vagrant/full-dev-platform
vagrant ssh
sudo ambari-server status #To find out current status of service
sudo ambari-server start #To start in case the service is stopped Cheers, Anand
... View more
11-28-2017
09:05 AM
1 Kudo
You are welcome! 🙂 Yes, 16 GB is definitely better @Gaurav Bapat. Yup, more the processing, you will see better results.
... View more
11-28-2017
08:55 AM
2 Kudos
This article serves as an addendum to the main Metron MaaS
README doc in Apache Metron github. It is highly recommended that you go through the README article in github to understand the concepts and working principle. This article only intends to capture the steps specific to the Metron full dev vagrant platform so it is easy for a user to copy-paste-run and get it working quickly. Further, this article only covers the successful startup, deployment and validation of the Metron MaaS service. Refer to the master github README for further steps. Prerequisites
* You need to have a working Metron full dev platform before you proceed with the instructions Step 1:Install Required Packages
Run the following commands to install Flask, Jinja2, Squid client and the Elasticsearch HEAD plugin:
vagrant ssh #To SSH onto the full-dev platform
sudo yum install python-flask
sudo yum install python-jinja2
sudo yum install squid
sudo service start squid
sudo /usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head
Step 2: Create Mock DGA service files
Run the following commands:
sudo su - metron
mkdir mock_dga
cd mock_dga
Download the files from this
link and copy to the folder. Alternativey you use the following commands to create the files:
* vi dga.py
(paste the below code snippet, save and quit)
from flask import Flask
from flask import request,jsonify
import socket
app = Flask(__name__)
@app.route("/apply", methods=['GET'])
def predict():
h = request.args.get('host')
r = {}
if h == 'yahoo.com' or h == 'amazon.com':
r['is_malicious'] = 'legit'
else:
r['is_malicious'] = 'malicious'
return jsonify(r)
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 0))
port = sock.getsockname()[1]
sock.close()
with open("endpoint.dat", "w") as text_file:
text_file.write("{\"url\" : \"http://0.0.0.0:%d\"}" % port)
app.run(threaded=True, host="0.0.0.0", port=port)
* vi rest.sh
(paste the below code snippet, save and quit)
#!/bin/bash
python dga.py
Run these commands to make the files executable
chmod +x /home/metron/mock_dga/*
Step 3: Create HDFS directories
Run the following commands as
vagrant user, and _not_ as metron user
sudo su - hdfs -c "hadoop fs -mkdir /user/metron"
sudo su - hdfs -c "hadoop fs -chown metron:metron /user/metron"<br>
Step 4: Start MaaS service
Run the following commands:
Note: Change the METRON_HOME variable per the version of Metron you are running
sudo su - metron
export METRON_HOME=/usr/metron/0.4.2
$METRON_HOME/bin/maas_service.sh -zq node1:2181
Verify MaaS service running and view application log
Follow these steps to ensure that the maas service is running properly
1. Launch Ambari UI at http://node1:8080. Authenticate with admin/admin
2. Go to Services -> YARN -> 'Quick Links' dropdown -> ResourceManager UI
3. You should be able to see the application listed in the UI, similar to the below:
4. Click on the application -> Logs -> AppMaster.stderr log file to view the startup logs. Check for presence of any errors. If there are none, you are good to deploy the DGA model in the next step. Step 5: Deploy Mock DGA model
Run the following command as metron user to deploy the DGA model
$METRON_HOME/bin/maas_deploy.sh -zq node1:2181 -lmp /home/metron/mock_dga -hmp /user/metron/models -mo ADD -m 512 -n dga -v 1.0 -ni 1
Once the command completes, you can monitor the ResourceManager UI application logs to check for any errors. Verify DGA model has been successfully deployed
a) Run the following command as metron user:
$METRON_HOME/bin/maas_deploy.sh -zq node1:2181 -mo LIST
At the end of the command execution, you should be able to see something similar to the following output, which indicates that the model has been successfully deployed. Model dga @ 1.0
dga:1.0 @ http://node1:50451 serving:
apply=apply
Note: The port number '50451' in the above output may change across different runs.
b) Try to hit the model via curl by running the following commands, and verify you are seeing the respective outputs. [metron@node1 ~]$ curl 'http://localhost:50451/apply?host=testing.com'
{
"is_malicious": "malicious"
}
[metron@node1 ~]$ curl 'http://localhost:50451/apply?host=yahoo.com'
{
"is_malicious": "legit"
}
With this you would have been able to successfully started, deployed and validated Metron MaaS on your full dev Metron platform. Step 6: Squid Example The next steps of sending data through the squid sensor and having it processed through the MaaS is not covered as a part of this article. Please refer to the steps listed in the github README doc.
... View more
Labels:
11-28-2017
06:37 AM
1 Kudo
Please click on the link as highlighted below.... to see the service logs Also, from your 2nd screenshot I can see that there was a timeout because of which the script was killed. This could be due to resource constraints on your system. I would recommend that you find a system with a better configuration and try deploying Metron there.
... View more
11-28-2017
06:19 AM
1 Kudo
@Gaurav Bapat, it looks like the installation was successful, but the components did not start. Can you check on what is the error from the Ambari UI ? To do this, click the below icon in Ambari UI: Then go to "Start Components on node1" and drill down to find out more.
... View more
11-28-2017
05:39 AM
Hm.. looks like your system is having a resource crunch. You need not do vagrant provision always.
... View more
11-28-2017
05:38 AM
The lag is expected since Metron creates substantial load on the system. Sure, if you can get another system with beefier system configuration that will definitely help.
... View more