You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by qi...@apache.org on 2016/10/19 03:19:08 UTC
[09/28] incubator-eagle git commit: EAGLE-340 refactor
bin/eagle-sandbox-starter.sh to make it easier to use refactor
bin/eagle-sandbox-starter.sh to make it easier to use
EAGLE-340 refactor bin/eagle-sandbox-starter.sh to make it easier to use
refactor bin/eagle-sandbox-starter.sh to make it easier to use
Author: @qingwen220 <qi...@ebay.com>
Reviewer: @yonzhang <yo...@gmail.com>
Closes: #237
Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/36422ea8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/36422ea8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/36422ea8
Branch: refs/heads/master
Commit: 36422ea81da6e4c158fcac1e02d3cb9798bf6486
Parents: 8f12f82
Author: yonzhang <yo...@gmail.com>
Authored: Thu Jun 16 14:55:59 2016 -0700
Committer: yonzhang <yo...@gmail.com>
Committed: Thu Jun 16 14:55:59 2016 -0700
----------------------------------------------------------------------
.../src/main/examples/eagle-sandbox-starter.sh | 61 ++------------------
.../sample-sensitivity-resource-create.sh | 2 +
.../src/main/resources/application.conf | 23 ++++----
3 files changed, 19 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/36422ea8/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh b/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
index 286bc87..4a05a77 100644
--- a/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
+++ b/eagle-assembly/src/main/examples/eagle-sandbox-starter.sh
@@ -15,6 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# This script will start Eagle service with storage Derby,
+# and a sample application HiveQueryLog monitoring
+
source $(dirname $0)/../bin/eagle-env.sh
eagle_bin=$EAGLE_HOME/bin
@@ -29,41 +32,6 @@ $eagle_bin/eagle-check-env.sh
pid_dir=/var/run
-# Check HBase if it has been started
-hbase_master_pid=${pid_dir}/hbase/hbase-hbase-master.pid
-hbase_regionserver_pid=${pid_dir}/hbase/hbase-hbase-regionserver.pid
-echo "Checking if hbase is running ..."
-
-if [ -f $hbase_master_pid ] && \
- ps aux | grep -v grep | grep $(cat $hbase_master_pid) > /dev/null
-then
- echo "HBase Master is running as process `cat $hbase_master_pid`."
-else
- echo "Error: HBase Master is not running. Please start it via Ambari."
- exit 1
-fi
-
-if [ -f $hbase_regionserver_pid ] && \
- ps aux | grep -v grep | grep $(cat $hbase_regionserver_pid) > /dev/null
-then
- echo "HBase RegionServer is running as process `cat $hbase_regionserver_pid`."
-else
- echo "Error: HBase RegionServer is not running. Please start it via Ambari."
- exit 1
-fi
-
-# Check kafka if it has been started
-kafka_pid=$pid_dir/kafka/kafka.pid
-echo "Checking if kafka is running ..."
-
-if [ -f $kafka_pid ] && ps aux | grep -v grep | grep $(cat $kafka_pid) > /dev/null
-then
- echo "Kafka is running as process `cat $kafka_pid`."
-else
- echo "Error: Kafka is not running. Please start it via Ambari."
- exit 1
-fi
-
# Check storm if it has been started
nimbus_pid=$pid_dir/storm/nimbus.pid
supervisor_pid=$pid_dir/storm/supervisor.pid
@@ -104,33 +72,14 @@ $eagle_bin/eagle-service.sh start
###################################################################
echo "STEP [3/3]: start eagle topology"
-$eagle_bin/eagle-service-init.sh
-[ $? != 0 ] && exit 1
-echo "Creating kafka topics for eagle ... "
-KAFKA_HOME=/usr/hdp/current/kafka-broker
-EAGLE_ZOOKEEPER_QUORUM=localhost:2181
-topic=`${KAFKA_HOME}/bin/kafka-topics.sh --list --zookeeper $EAGLE_ZOOKEEPER_QUORUM --topic sandbox_hdfs_audit_log`
-if [ -z $topic ]; then
- $KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $EAGLE_ZOOKEEPER_QUORUM --replication-factor 1 --partitions 1 --topic sandbox_hdfs_audit_log
-fi
-
-if [ $? = 0 ]; then
-echo "==> Create kafka topic successfully for eagle"
-else
-echo "==> Failed, exiting"
-exit 1
-fi
$eagle_bin/eagle-topology-init.sh
[ $? != 0 ] && exit 1
${EAGLE_HOME}/examples/sample-sensitivity-resource-create.sh
[ $? != 0 ] && exit 1
${EAGLE_HOME}/examples/sample-policy-create.sh
[ $? != 0 ] && exit 1
-$eagle_bin/eagle-topology.sh --main org.apache.eagle.security.auditlog.HdfsAuditLogProcessorMain --config ${EAGLE_HOME}/conf/sandbox-hdfsAuditLog-application.conf start
-[ $? != 0 ] && exit 1
+
$eagle_bin/eagle-topology.sh --main org.apache.eagle.security.hive.jobrunning.HiveJobRunningMonitoringMain --config ${EAGLE_HOME}/conf/sandbox-hiveQueryLog-application.conf start
-[ $? != 0 ] && exit 1
-$eagle_bin/eagle-topology.sh --main org.apache.eagle.security.userprofile.UserProfileDetectionMain --config ${EAGLE_HOME}/conf/sandbox-userprofile-topology.conf start
-[ $? != 0 ] && exit 1
+
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/36422ea8/eagle-assembly/src/main/examples/sample-sensitivity-resource-create.sh
----------------------------------------------------------------------
diff --git a/eagle-assembly/src/main/examples/sample-sensitivity-resource-create.sh b/eagle-assembly/src/main/examples/sample-sensitivity-resource-create.sh
index 4a8f06f..615c00b 100644
--- a/eagle-assembly/src/main/examples/sample-sensitivity-resource-create.sh
+++ b/eagle-assembly/src/main/examples/sample-sensitivity-resource-create.sh
@@ -23,10 +23,12 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
#### create hdfs sensitivity sample in sandbox
+echo ""
echo "create hdfs sensitivity sample in sandbox... "
curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=FileSensitivityService" -d '[{"tags":{"site" : "sandbox", "filedir":"/tmp/private"}, "sensitivityType": "PRIVATE"}]'
#### create hbase sensitivity sample in sandbox
+echo ""
echo "create hdfs sensitivity sample in sandbox... "
curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=HbaseResourceSensitivityService" -d '[{"tags":{"site":"sandbox","hbaseResource":"default:alertStreamSchema"},"sensitivityType":"PrivateTable"}]'
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/36422ea8/eagle-webservice/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/application.conf b/eagle-webservice/src/main/resources/application.conf
index fff7d3f..ca936ed 100644
--- a/eagle-webservice/src/main/resources/application.conf
+++ b/eagle-webservice/src/main/resources/application.conf
@@ -13,15 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-eagle{
- service{
- storage-type="hbase"
- hbase-zookeeper-quorum="sandbox.hortonworks.com"
- hbase-zookeeper-property-clientPort=2181
- zookeeper-znode-parent="/hbase-unsecure",
- springActiveProfile="sandbox"
- audit-enabled=true
+eagle {
+ service {
+ storage-type="jdbc"
+ storage-adapter="derby"
+ storage-username="eagle"
+ storage-password=eagle
+ storage-database=eagle
+ storage-connection-url="jdbc:derby:/tmp/eagle-db-dev;create=true"
+ storage-connection-props="encoding=UTF-8"
+ storage-driver-class="org.apache.derby.jdbc.EmbeddedDriver"
+ storage-connection-max=8
}
-}
-
+}
\ No newline at end of file