007-001 Seata1.3.0使用Oracle

1. 在\color{blue} {業(yè)務(wù)數(shù)據(jù)庫執(zhí)行}創(chuàng)建UNDO_LOG表
create trigger sequence_undo_log before 
    insert on undo_log for each row when (new.id is null) 
begin 
    select  sequence_undo_log.nextval into:new.id from dual;  
end;
2. 在\color{blue} {seata數(shù)據(jù)庫}創(chuàng)建表
    1. 創(chuàng)建全局事物表 (\color{red} {seata數(shù)據(jù)庫})
    1. 在seata目錄下新建文件 -config.txt
    • 下載地址
      • seata/config.txt at 1.3.0
      • 注意目錄 位置


        image.png
      • 修改配置
        • 這里是配置事務(wù)組,可以配置多個(gè)


          image.png
        • 事務(wù)組要和項(xiàng)目配置文件中的相對應(yīng)


          image.png
      • 修改config.txt 中的數(shù)據(jù)庫配置


        image.png
    1. 初始化數(shù)據(jù)到nacos
  • 注意文件路徑


    image.png
  • 在git bash 執(zhí)行命令


    image.png
image.png
sh nacos-config.sh -h 210.210.210.212 -p 8848 -g SEATA_GROUP -t seata  -u nacos帳號 -w nacos密碼

  • 命令解讀
    1. -h : nacos地址
    2. -p : nacos端口
    3. -g : 注冊分組
    4. -t : 注冊的命名空間
    5. -u : nacos登錄帳號
    6. -w: nacos登錄密碼
    1. 修改配置-registry.conf


      image.png
image.png
    1. 修改file.conf


      image.png
    1. 上傳到服務(wù)器
    • 先將 oracle 的驅(qū)動(dòng)包添加的lib 目錄下面去


      image.png
    • 上傳文件


      image.png
    1. 建立文件
mkdir /opt/seata-server-1.3.0/seata/logs && vim /opt/seata-server-1.3.0/seata/logs/seata_gc.log
chmod -R a+w ./seata-server-1.3.0/seata/logs
image.png
    1. 刪除多余的命令并給予執(zhí)行權(quán)限
chmod -R +x /opt/seata-server-1.3.0/seata/bin/ && rm -fr  /opt/seata-server-1.3.0/seata/bin/seata-server.bat
  • 項(xiàng)目啟動(dòng)
nohup /opt/seata-server-1.3.0/seata/bin/seata-server.sh >/opt/seata-server-1.3.0/seata/logs/log.out 2>1 &
nohup /opt/seata-server-1.3.0/seata/bin/seata-server.sh -h 210.210.210.198 >/opt/seata-server-1.3.0/seata/logs/log.out 2>1 &
    1. 關(guān)于報(bào)錯(cuò) 的解決方案
 i.s.r.d.u.p.JacksonUndoLogParser - json encode exception, No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: io.seata.rm.datasource.undo.BranchUndoLog["sqlUndoLogs"]->java.util.ArrayList[1]->io.seata.rm.datasource.undo.SQLUndoLog["afterImage"]->io.seata.rm.datasource.sql.struct.TableRecords["rows"]->java.util.ArrayList[0]->io.seata.rm.datasource.sql.struct.Row["fields"]->java.util.ArrayList[6]->io.seata.rm.datasource.sql.struct.Field["value"]->oracle.sql.TIMESTAMP["stream"])
image.png
  • 修改nacos->seata配置項(xiàng)序列化方式 client.undo.logSerialization=kryo


    image.png
client.undo.logSerialization
  • 這個(gè)配置 在config.txt 中可以找到
  • 并添加對應(yīng)jar到工程中
        <dependency>
            <groupId>com.esotericsoftware.kryo</groupId>
            <artifactId>kryo</artifactId>
            <version>2.24.0</version>
        </dependency>
        <dependency>
            <groupId>de.javakaffee</groupId>
            <artifactId>kryo-serializers</artifactId>
            <version>0.45</version>
        </dependency>
        <dependency>
            <groupId>com.esotericsoftware</groupId>
            <artifactId>kryo</artifactId>
            <version>4.0.2</version>
        </dependency>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容