cp /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib
cp -r flume-ng flume-ng2
cd flume-ng/bin
update flume-ng
cp /root/apache-flume-1.9.0-bin/bin/flume-ng /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/flume-ng/bin/
copy overwrite input y
lib directory ../../../jars/ , ../../../lib/
ll *|grep ../../../lib |wc -l
ll *|grep ../../../jar |wc -l
ll *|grep -v ../../../jar |wc -l
cd /root/apache-flume-1.9.0-bin/lib/
mkdir -p lib/avro
mv avro-ipc-1.7.4.jar lib/avro/avro-ipc.jar
mv avro-1.7.4.jar lib/avro/avro.jar
mkdir -p lib/hadoop
mkdir -p lib/kite
mv kite-data-core-1.0.0.jar lib/kite/kite-data-core.jar
mv kite-data-hive-1.0.0.jar lib/kite/kite-data-hive.jar
mv kite-data-hbase-1.0.0.jar lib/kite/kite-data-hbase.jar
mv kite-hadoop-compatibility-1.0.0.jar lib/kite/kite-hadoop-compatibility.jar
mkdir -p lib/parquet
mv parquet-avro-1.4.1.jar lib/parquet/parquet-avro.jar
mv parquet-column-1.4.1.jar lib/parquet/parquet-column.jar
mv parquet-common-1.4.1.jar lib/parquet/parquet-common.jar
mv parquet-encoding-1.4.1.jar lib/parquet/parquet-encoding.jar
mv parquet-format-2.0.0.jar lib/parquet/parquet-format.jar
mv parquet-hadoop-1.4.1.jar lib/parquet/parquet-hadoop.jar
mv parquet-jackson-1.4.1.jar lib/parquet/parquet-jackson.jar
mkdir -p /root/target
mkdir -p /root/target/jars
mv lib /root/target/
mv * /root/target/jars/
cd /root/target/jars/
mv flume-* /root/target/grepflume/
\cp -rf /root/target/jars/* /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/jars/
\cp -rf /root/target/lib/avro/* /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/avro/
\cp -rf /root/target/lib/kite/* /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/kite/
\cp -rf /root/target/lib/parquet/* /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/parquet/
\cp -rf /root/apache-flume-1.9.0-bin/tools/* /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/jars/
vim go.sh
#!/bin/bash
source_path=$1
tar_path=$2
file_ext=$3
#进入目录find 命令找的是相对路径 例如找到的是 ./sh.sh
cd $source_path
for i in `find -iname "*.$file_ext"`
do
#如果不切割字符,${i} 前面包含"./"
file_name=${i:2}
echo "文件名:$file_name"
ln -s ${source_path}${file_name} $tar_path/$name
done
chmod 777 go.sh
./go.sh /root/target/grepflume/ /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/flume-ng/lib/ jar
cd /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/flume-ng/lib
ln -vfs flume-avro-source-1.9.0.jar flume-avro-source.jar
ln -vfs flume-dataset-sink-1.9.0.jar flume-dataset-sink.jar
ln -vfs flume-file-channel-1.9.0.jar flume-file-channel.jar
ln -vfs flume-hdfs-sink-1.9.0.jar flume-hdfs-sink.jar
ln -vfs flume-hive-sink-1.9.0.jar flume-hive-sink.jar
ln -vfs flume-irc-sink-1.9.0.jar flume-irc-sink.jar
ln -vfs flume-jdbc-channel-1.9.0.jar flume-jdbc-channel.jar
ln -vfs flume-jms-source-1.9.0.jar flume-jms-source.jar
ln -vfs flume-kafka-channel-1.9.0.jar flume-kafka-channel.jar
ln -vfs flume-kafka-source-1.9.0.jar flume-kafka-source.jar
ln -vfs flume-ng-auth-1.9.0.jar flume-ng-auth.jar
ln -vfs flume-ng-config-filter-api-1.9.0.jar flume-ng-config-filter-api.jar
ln -vfs flume-ng-configuration-1.9.0.jar flume-ng-configuration.jar
ln -vfs flume-ng-core-1.9.0.jar flume-ng-core.jar
ln -vfs flume-ng-elasticsearch-sink-1.9.0.jar flume-ng-elasticsearch-sink.jar
ln -vfs flume-ng-embedded-agent-1.9.0.jar flume-ng-embedded-agent.jar
ln -vfs flume-ng-environment-variable-config-filter-1.9.0.jar flume-ng-environment-variable-config-filter.jar
ln -vfs flume-ng-external-process-config-filter-1.9.0.jar flume-ng-external-process-config-filter.jar
ln -vfs flume-ng-hadoop-credential-store-config-filter-1.9.0.jar flume-ng-hadoop-credential-store-config-filter.jar
ln -vfs flume-ng-hbase-sink-1.9.0.jar flume-ng-hbase-sink.jar
ln -vfs flume-ng-kafka-sink-1.9.0.jar flume-ng-kafka-sink.jar
ln -vfs flume-ng-log4jappender-1.9.0.jar flume-ng-log4jappender.jar
ln -vfs flume-ng-morphline-solr-sink-1.9.0.jar flume-ng-morphline-solr-sink.jar
ln -vfs flume-ng-node-1.9.0.jar flume-ng-node.jar
ln -vfs flume-ng-sdk-1.9.0.jar flume-ng-sdk.jar
ln -vfs flume-scribe-source-1.9.0.jar flume-scribe-source.jar
ln -vfs flume-spillable-memory-channel-1.9.0.jar flume-spillable-memory-channel.jar
ln -vfs flume-taildir-source-1.9.0.jar flume-taildir-source.jar
ln -vfs flume-thrift-source-1.9.0.jar flume-thrift-source.jar
ln -vfs flume-tools-1.9.0.jar flume-tools.jar
ln -vfs flume-twitter-source-1.9.0.jar flume-twitter-source.jar
rm -f flume-avro-source-1.6.0-cdh5.15.2.jar
rm -f flume-dataset-sink-1.6.0-cdh5.15.2.jar flume-twitter-source-1.6.0-cdh5.15.2.jar
rm -f flume-tools-1.6.0-cdh5.15.2.jar flume-thrift-source-1.6.0-cdh5.15.2.jar flume-taildir-source-1.6.0-cdh5.15.2.jar flume-spillable-memory-channel-1.6.0-cdh5.15.2.jar flume-scribe-source-1.6.0-cdh5.15.2.jar
rm -f flume-ng-sdk-1.6.0-cdh5.15.2.jar flume-ng-node-1.6.0-cdh5.15.2.jar flume-ng-morphline-solr-sink-1.6.0-cdh5.15.2.jar flume-ng-log4jappender-1.6.0-cdh5.15.2.jar
rm -f flume-ng-kafka-sink-1.6.0-cdh5.15.2.jar flume-ng-hbase-sink-1.6.0-cdh5.15.2.jar flume-ng-hadoop-credential-store-config-filter-1.6.0-cdh5.15.2.jar
rm -f flume-ng-external-process-config-filter-1.6.0-cdh5.15.2.jar flume-ng-environment-variable-config-filter-1.6.0-cdh5.15.2.jar flume-ng-embedded-agent-1.6.0-cdh5.15.2.jar
rm -f flume-ng-elasticsearch-sink-1.6.0-cdh5.15.2.jar flume-ng-core-1.6.0-cdh5.15.2.jar flume-ng-configuration-1.6.0-cdh5.15.2.jar
rm -f flume-ng-config-filter-api-1.6.0-cdh5.15.2.jar flume-ng-auth-1.6.0-cdh5.15.2.jar flume-kafka-source-1.6.0-cdh5.15.2.jar flume-kafka-channel-1.6.0-cdh5.15.2.jar
rm -f flume-jms-source-1.6.0-cdh5.15.2.jar flume-jdbc-channel-1.6.0-cdh5.15.2.jar flume-irc-sink-1.6.0-cdh5.15.2.jar flume-hive-sink-1.6.0-cdh5.15.2.jar
rm -f flume-hdfs-sink-1.6.0-cdh5.15.2.jar flume-file-channel-1.6.0-cdh5.15.2.jar
cp -rf /root/apache-flume-1.9.0-bin/tools/* /root/target/jars/
cd /opt/cloudera/parcels/CDH-5.15.2-1.cdh5.15.2.p0.3/lib/flume-ng/tools
ln -vfs /root/target/jars/flume-ng-log4jappender-1.9.0-jar-with-dependencies.jar flume-ng-log4jappender-1.9.0-jar-with-dependencies.jar
rm -f flume-ng-log4jappender-1.6.0-cdh5.15.2-jar-with-dependencies.jar
ln -vfs flume-ng-log4jappender-1.9.0-jar-with-dependencies.jar flume-ng-log4jappender-jar-with-dependencies.jar
网友评论