Github user mmiklavc commented on a diff in the pull request:
https://github.com/apache/metron/pull/1152#discussion_r208745344
--- Diff: metron-sensors/pycapa/README.md ---
@@ -76,8 +79,83 @@ General notes on the installation of Pycapa.
python setup.py install
```
+### Centos 6
+
+* These instructions can be used directly on CentOS 6 - useful for
developers using the Full Dev Vagrant test box.
+* Older distributions, like CentOS 6, that come with Python 2.6 installed,
should install Python 2.7 within a virtual environment and then run Pycapa from
within the virtual environment.
+
+1. Set up a couple environment variables.
+
+ ```
+ PYCAPA_HOME=/opt/pycapa
+ PYTHON27_HOME=/opt/rh/python27/root
+ ```
+
+1. Install required packages.
+
+ ```
+ for item in epel-release centos-release-scl "@Development tools"
python27 python27-scldevel python27-python-virtualenv libpcap-devel
libselinux-python; do yum install -y $item; done
+ ```
+
+1. Setup Pycapa directory.
+
+ ```
+ mkdir $PYCAPA_HOME && chmod 755 $PYCAPA_HOME
+ ```
+
+1. Create the virtualenv.
+
+ ```
+ export LD_LIBRARY_PATH="/opt/rh/python27/root/usr/lib64"
+ cd $PYCAPA_HOME
+ ${PYTHON27_HOME}/usr/bin/virtualenv pycapa-venv
+ ```
+
+1. Install Librdkafka at your chosen $PREFIX.
+
+ ```
+ export PREFIX=/usr
+ wget https://github.com/edenhill/librdkafka/archive/v0.11.5.tar.gz
-O - | tar -xz
--- End diff --
@justinleet Let me know what you think of the most recent update. That
should set the versions in requirements.txt. When I run it I get the following
output:
```
(pycapa-venv)[root@node1(127.0.0.1 192.168.66.121): /opt/pycapa/pycapa]
# pip install -r requirements.txt
You are using pip version 7.1.0, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting confluent-kafka==0.11.5 (from -r requirements.txt (line 1))
Collecting pcapy==0.11.4 (from -r requirements.txt (line 2))
Collecting argparse==1.4.0 (from -r requirements.txt (line 3))
Using cached
https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): futures in
/opt/pycapa/pycapa-venv/lib/python2.7/site-packages (from
confluent-kafka==0.11.5->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): enum34 in
/opt/pycapa/pycapa-venv/lib/python2.7/site-packages (from
confluent-kafka==0.11.5->-r requirements.txt (line 1))
Installing collected packages: confluent-kafka, pcapy, argparse
Successfully installed argparse-1.4.0 confluent-kafka-0.11.5 pcapy-0.11.4
(pycapa-venv)[root@node1(127.0.0.1 192.168.66.121):
/opt/pycapa/pycapa-venv/bin]
# pycapa --producer --kafka-topic pcap --interface eth1 --kafka-broker
$BROKERLIST
INFO:root:Connecting to Kafka; {'bootstrap.servers': 'node1:6667',
'group.id': 'TAAAIEXWVROR'}
INFO:root:Starting packet capture
%3|1533038296.388|FAIL|rdkafka#producer-1| [thrd:node1:6667/bootstrap]:
node1:6667/bootstrap: Connect to ipv4#192.168.66.121:6667 failed: Connection
refused
%3|1533038296.388|ERROR|rdkafka#producer-1| [thrd:node1:6667/bootstrap]:
node1:6667/bootstrap: Connect to ipv4#192.168.66.121:6667 failed: Connection
refused
%3|1533038296.388|ERROR|rdkafka#producer-1| [thrd:node1:6667/bootstrap]:
1/1 brokers are down
^CINFO:root:Clean shutdown process started
INFO:root:Waiting for '0' message(s) to flush
INFO:root:'35' packet(s) in, '35' packet(s) out
```
I'm not sure if anyone else gets the FAIL/ERROR messages when they run
pycapa, but it still runs as expected in spite of these errors.
---