Comments (2)
On beater/mysqlbeat.go change the Run function from:
func (bt *Mysqlbeat) Run(b *beat.Beat) error {
logp.Info("mysqlbeat is running! Hit CTRL-C to stop it.")
ticker := time.NewTicker(bt.period)
for {
select {
case <-bt.done:
return nil
case <-ticker.C:
}
err := bt.beat(b)
if err != nil {
return err
}
}
}
To:
func (bt *Mysqlbeat) Run(b *beat.Beat) error {
logp.Info("mysqlbeat is running! Hit CTRL-C to stop it.")
err := bt.beat(b)
if err != nil {
return err
}
ticker := time.NewTicker(bt.period)
for {
select {
case <-bt.done:
return nil
case <-ticker.C:
}
err := bt.beat(b)
if err != nil {
return err
}
}
}
That way it'll run first and start a timer to continue running next iteration...
-- Adi.
from mysqlbeat.
Many thanks!!! - I figured this out myself. In our case (since we want only want to run this once a day against a dozen tables) I removed the entire ticker section and added your first section above. I also needed a "return nil" to close out the block.
This allows us to run a script with each mysql table==>es index update in series. We were seeing spurious issues when trying to run these concurrently against our es cluster.
...and many thanks for these useful scripts!!!
from mysqlbeat.
Related Issues (20)
- Images for README
- beater/mysqlbeat.go:289: b.Events undefined (type *beat.Beat has no field or method Events) HOT 3
- Not able to install HOT 3
- How to update template? HOT 1
- mysqlbeat: 406 Not Acceptable
- unable to see any logs and the command hangs forever. HOT 1
- Error while trying to push data to Elasticsearch HOT 1
- how to install mysqlbeat in centos?
- Is it possible to use a single beat to connect to multiple databases?
- ./main.go:12: cannot use beater.New() (type *beater.Mysqlbeat)
- make HOT 6
- Unable to connect over TLS HOT 1
- mysqlbeat restarts per 10s
- Where is the json for visualization?
- Not getting data HOT 3
- How to config mysql dbname HOT 1
- index quantity are 4 times of mysql db rows. HOT 2
- Visualize: "field" is a required parameter HOT 2
- [help needed] Managing deltas HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysqlbeat.