十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
yum install gem -y
创新互联是专业的清远网站建设公司,清远接单;提供网站设计制作、成都做网站,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行清远网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem sources -l
cd /opt/inst/logstash722/
vi Gemfile
#修改Gemfile文件
#source https://rubygems.org/
httpsvi Gemfile.lockgems.ruby-china.com/
vi Gemfile.lock
#remote: https://rubygems.org/
https://gems.ruby-china.com/
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
gem sources -l
由于修改ruby镜像库为淘宝库并没有成功,这里就需要修改Gemfile文件里面的数据源:
cd /opt/inst/logstash722/
vi Gemfile
#修改Gemfile文件
#source https://rubygems.org/
source "https://ruby.taobao.org"
#remote: https://rubygems.org/
remote: https://ruby.taobao.org
cd bin
./logstash-plugin list --verbose
unzip logstash-input-jdbc-4.3.3.zip
mv logstash-input-jdbc-4.3.3 /opt/inst/log_jdbc433
cd log_jdbc433/
vi Gemfile
source 'https://gems.ruby-china.com/'
需要一个mysql驱动包,sql文件,以及conf配置文件
input {
jdbc {
# mysql jdbc connection string to our backup databse
jdbc_connection_string => "jdbc:mysql://169.254.211.100:3306/test"
# the user we wish to excute our statement as
jdbc_user => "root"
jdbc_password => "root"
# the path to our downloaded jdbc driver
jdbc_driver_library => "/opt/inst/logstash722/sql/mysql-connector-java-5.1.40-bin.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
statement_filepath => "/opt/inst/logstash722/sql/logs_20171206.sql"
schedule => "*/1 * * * *"
type => "jdbc"
}
}
filter {
json {
source => "message"
remove_field => ["message"]
}
}
output {
elasticsearch {
hosts => "169.254.211.100:9200"
index => "logs_20171206"
document_id => "%{id}"
}
stdout {
codec => json_lines
}
}
cd /opt/inst/logstash722/bin
./logstash -f /opt/logfiter/mysql.conf
http://169.254.211.100:5601/app/kibana#/dashboard/1e4f4310-c638-11e9-9ea7-f9ef9537f0f4?_g=(refreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow-1y%2Cmode%3Aquick%2Cto%3Anow))
1566580763148
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。