Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Unable to connnect to SQLServer dataserver parameter not Working

Đang mở
#151 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
ruby, sql
Lĩnh vực
backend, databases

Hướng nghiên cứu

Không có tệp mã nguồn hoặc bài kiểm thử nào được nêu. Hãy bắt đầu với cấu hình SQL output plugin và lỗi kết nối TinyTDS, sau đó theo dõi cách các tham số host và dataserver của nó được truyền đến SQLServer adapter; hoàn thành có nghĩa là thiết lập được một kết nối hoạt động, có tài liệu, mà không gặp các lỗi cấu hình đã nêu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

So I've been working with this plugin for some days and finally achieved sending logs to a local sqlserver container.
Now that Im trying in prepo I'm not able to connecto to the database.
And so I startted with

<match docker.caesar**>
    @type copy
    <store>
        @type stdout
    </store>
    <store>
        @type sql
        log_level info
        host 172........\sql2019pre
        port 1433
        chema_search_path piscinalogs
        database db_Poseidon
        adapter sqlserver
        username "#{ENV['USER']}"
        password "#{ENV['PASSWORD']}"
        state_file /var/run/fluentd/sql_state
        <table>
            table logs
column_mapping 'time:timestamp,level:level,mensaje:message,Container_Name:containerName,App_Name:appName,Env:enviroment'
            # This is the default table because it has no "pattern" argument in <table>
            # The logic is such that if all non-default <table> blocks
            # do not match, the default one is chosen.
            # The default table is required.
            flush_interval 10s
        </table>
    </store>
</match>

This configuration did not work since it returns
fluentd | 2024-08-29 09:42:24 +0000 [warn]: #0 failed to flush the buffer. retry_times=0 next_retry_time=2024-08-29 09:42:26 +0000 chunk="620cf46e28eacdbcecf964d3ed2978be" error_class=TinyTds::Error error="Server name not found in configuration files"
Then I investigated how activerecords connects to database and encounter that they used the param: dataserver
When removing the host param in order to introduce the dataserver param :

<match docker.caesar**>
    @type copy
    <store>
        @type stdout
    </store>
    <store>
        @type sql
        log_level info
        dataserver 172.......\sql2019pre
        port 1433
        chema_search_path piscinalogs
        database db_Poseidon
        adapter sqlserver
        username "#{ENV['USER']}"
        password "#{ENV['PASSWORD']}"
        state_file /var/run/fluentd/sql_state
        <table>
            table logs
column_mapping 'time:timestamp,level:level,mensaje:message,Container_Name:containerName,App_Name:appName,Env:enviroment'
            # This is the default table because it has no "pattern" argument in <table>
            # The logic is such that if all non-default <table> blocks
            # do not match, the default one is chosen.
            # The default table is required.
            flush_interval 10s
        </table>
    </store>
</match>

It returns:
fluentd | 2024-08-29 09:45:42 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="'host' parameter is required"
And so I decided to let both parameters

<match docker.caesar**>
    @type copy
    <store>
        @type stdout
    </store>
    <store>
        @type sql
        host  172......
        dataserver 172.......\sql2019pre
        port 1433
        chema_search_path piscinalogs
        database db_Poseidon
        adapter sqlserver
        username "#{ENV['USER']}"
        password "#{ENV['PASSWORD']}"
        state_file /var/run/fluentd/sql_state
        <table>
            table logs
column_mapping 'time:timestamp,level:level,mensaje:message,Container_Name:containerName,App_Name:appName,Env:enviroment'
            # This is the default table because it has no "pattern" argument in <table>
            # The logic is such that if all non-default <table> blocks
            # do not match, the default one is chosen.
            # The default table is required.
            flush_interval 10s
        </table>
    </store>
</match>

It returns: fluentd | 2024-08-29 09:48:34 +0000 [warn]: #0 failed to flush the buffer. retry_times=4 next_retry_time=2024-08-29 09:48:48 +0000 chunk="620cf5c1a09d87697d7c0f92760ef3fb" error_class=TinyTds::Error error="Unable to connect: Adaptive Server is unavailable or does not exist (172......)"
Im quite lost at this point

Ngôn ngữ chính
Ruby
Star
112
Fork
58
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluent/fluent-plugin-sql

Tất cả issue của fluent/fluent-plugin-sql

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.