Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
filebeat
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段孔乐
filebeat
Commits
b9c08346
Commit
b9c08346
authored
Jul 01, 2021
by
段孔乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify install script
parent
7c819acf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
filebeat-quick-install.sh
filebeat-quick-install.sh
+2
-2
uninstall.sh
uninstall.sh
+4
-2
util.sh
util.sh
+3
-2
No files found.
filebeat-quick-install.sh
View file @
b9c08346
#!/bin/bash
#!/bin/bash
#logstash_host="124.71.144.118:15044"
#logstash_host="124.71.144.118:15044"
#scan_dir="/data/backend-micro/**/*.log"
#scan_dir="/data/backend-micro/**/*.log"
dest
=
/usr/share/filebeat
dest
=
$(
cd
~
&&
pwd
)
src
=
"https://gitlab.33.cn/dkl/filebeat/-/archive/1.0.0/filebeat-1.0.0.tar.gz"
src
=
"https://gitlab.33.cn/dkl/filebeat/-/archive/1.0.0/filebeat-1.0.0.tar.gz"
name
=
${
src
##*/
}
name
=
${
src
##*/
}
...
@@ -10,7 +10,7 @@ service=${folder%-*}
...
@@ -10,7 +10,7 @@ service=${folder%-*}
version
=
${
folder
#*-
}
version
=
${
folder
#*-
}
sudo
systemctl stop filebeat.serivce 2>/dev/null
sudo
systemctl stop filebeat.serivce 2>/dev/null
mkdir
-p
$dest
sudo
mkdir
-p
$dest
cd
$dest
||
exit
1
cd
$dest
||
exit
1
if
[
-e
"./
$name
"
]
;
then
rm
-rf
$name
;
fi
if
[
-e
"./
$name
"
]
;
then
rm
-rf
$name
;
fi
wget
$src
wget
$src
...
...
uninstall.sh
View file @
b9c08346
#!/bin/bash
#!/bin/bash
if
[
"
$(
pwd
|
grep
-c
'filebeat'
)
"
-lt
0
]
;
then
echo
"script location is incorrect, run me in filebeat installation directory"
;
exit
1
;
fi
if
[
"
$(
pwd
|
grep
-c
'filebeat'
)
"
-lt
0
]
;
then
echo
"script location is incorrect, run me in filebeat installation directory"
;
exit
1
;
fi
.
./util.sh
.
./util.sh
sudo
systemctl disable filebeat 2>/dev/null
sudo
systemctl stop filebeat 2>/dev/null
sudo
systemctl stop filebeat 2>/dev/null
rm
-rf
/etc/systemd/system/filebeat.serivce
sudo
systemctl disable filebeat 2>/dev/null
sudo rm
-rf
/etc/systemd/system/filebeat.serivce
sudo rm
-rf
/etc/systemd/system/filebeat.serivce
# and symlinks that might be related
sudo
systemctl daemon-reload
sudo
systemctl daemon-reload
sudo
systemctl reset-failed
rm
-rf
"
$(
pwd
)
"
rm
-rf
"
$(
pwd
)
"
green
"uninstall succeed"
green
"uninstall succeed"
util.sh
View file @
b9c08346
...
@@ -33,6 +33,7 @@ done
...
@@ -33,6 +33,7 @@ done
function
initConf
(){
function
initConf
(){
chmod
+x ./filebeat
chmod
+x ./filebeat
chmod
+x ./
*
.sh
cat
>
./filebeat.yml
<<-
EOF
cat
>
./filebeat.yml
<<-
EOF
filebeat.inputs:
filebeat.inputs:
...
@@ -70,7 +71,7 @@ Wants=network-online.target
...
@@ -70,7 +71,7 @@ Wants=network-online.target
After=network-online.target
After=network-online.target
[Service]
[Service]
User=
root
User=
$(
whoami
)
ExecStart=
${
spath
}
/filebeat -c
${
spath
}
/filebeat.yml
ExecStart=
${
spath
}
/filebeat -c
${
spath
}
/filebeat.yml
Restart=always
Restart=always
...
@@ -79,7 +80,7 @@ WantedBy=multi-user.target
...
@@ -79,7 +80,7 @@ WantedBy=multi-user.target
"
>
$svcpath
"
>
$svcpath
cp
$svcpath
/etc/systemd/system/
sudo
cp
$svcpath
/etc/systemd/system/
sudo
systemctl daemon-reload
sudo
systemctl daemon-reload
sudo
systemctl
enable
$svcname
sudo
systemctl
enable
$svcname
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment