[Alfresco]版本升級程序

No Comments

參考網頁
http://docs.alfresco.com/community/tasks/upgrade-process.html

–官網是這樣說–
為避免升級後的版本無法順利啟用, Alfresco 建議直接安裝新版本在新的路徑
並請管理者預先備分相關資料, 如:

1.設定組態檔 alfresco-global.properties 所指定的
dir.root目錄 (dir.root=/opt/alfresco-community/alf_data)
db.url目錄 (db.url=jdbc:postgresql://localhost:5432/alfresco)

2.索引設定檔 solrcore.properties 所指定的
date.dir.root目錄
(/opt/alfresco-community/solr4/archive-SpacesStore/conf/solrcore.properties)
(/opt/alfresco-community/solr4/workspace-SpacesStore/conf/solrcore.properties)

–以下是正式維運環境這樣做–
如果目錄名稱沒有要改, 資料庫名稱也沒有異動
可依以下步驟
1. service alfresco stop
2. login with root by X window
3. install Alfreso-new-version by wizard (don’t start service)
4. rsync -av alfresco-data-dir to new-alfresco-data-dir
5. edit alfresco-globle.properties
6.1 edit tomcat/bin/setenv.sh (JAVA_OPTS)
6.2 edit tomcat/scripts/ctl.sh

以下待服務啟動後再執行
7. edit tomcat/webapps/ROOT/index.jps (add script to document.location.href to /share/page)
8. use scripts to translate simp-chinese to trad-chinese by cn2tw-bat.sh
9. install AMPS (https://sourceforge.net/projects/aaar/files/v4.4/)
10. 修改 alfresco service (http://www.keensoft.es/en/our-road-from-alfresco-5-1-g-to-alfresco-201701/)
10. service alfresco start

重啟後, 可能要比較久才能重新使用
— end —

[logstash] 利用JDBC存取 mysql

No Comments

REF: https://www.zghhome.cn/?p=350

Access data from mySQL and output to ES
test1
test2
test3
test4
test5
test6
test7

############# input ##############
input {
    jdbc {
        jdbc_driver_library => "/usr/share/java/mysql-connector-java.jar"
        jdbc_driver_class => "com.mysql.jdbc.Driver"
        jdbc_connection_string => "jdbc:mysql://192.168.7.79:3306/note"
        jdbc_user => "dbuser"
        jdbc_password => "password"
        #parameters => {""}
        schedule => "* * * * *"
        statement => "select ID,post_date,post_title,ping_status from note_posts where id > :sql_last_value order by id"
        #statement => "select ID,post_date,post_title,ping_status from note_posts"
        # setting for last run
        clean_run => false
        record_last_run => true
        use_column_value => true
        tracking_column => id
        last_run_metadata_path => "/usr/share/logstash/logstash_mydb-note_last_run"
        type => "mydb-note"
    }
}

###################################
############# filter ##############
###################################

############# output ##############
output {
#    stdout { codec => "rubydebug" }
if [type] == "mydb-note" {
      if !("_grokparsefailure" in [tags]) {
        elasticsearch {
        hosts => [ "127.0.0.1:9200" ]
        index => [ "logstash-mydb-note" ]
        }
      } else {
        elasticsearch {
        hosts => [ "127.0.0.1:9200" ]
        index => [ "logstash-failure-mydb-note" ]
        } # ELK
      } # else
    } # if
}