influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.17k stars 3.51k forks source link

influxdb 2.7.6, Error in replication stream, invalid response code 401 #25106

Closed win434545299 closed 3 days ago

win434545299 commented 4 days ago
  1. I have set up remote image
  2. I have set up replication image
  3. When I write to influxdb at 192.168.65.131, 192.168.65.130 should sync to the data. But now the status of 192.168.65.130 shows 401. image
  4. The following is my command to create remote influx remote create --name u18c1
    --host http://127.0.0.1:8086 --token xsU5jKrq4Zd4DsRsIvPdehYoVpAWq0_vgg7ZL6aqafYyrGefD8LkW6PcQPykwtlcNgWdLiBMy-bu3zmqFXk7gw== --org-id 0258df09deb53c6f --remote-url http://192.168.65.131:8086 --remote-api-token toVy-MKM61GoS6RllNehKb1sPIXsr8MVHBsBYs9KoeBh0nUu-y8aDlGclBGocoyAyjdEI0aAbYuOFuS4gpF2Mw== --remote-org-id 1ad78eef36f672bc
  5. The following is the command I used to create replication influx replication create --name u18c1_rep --host http://127.0.0.1:8086 --token xsU5jKrq4Zd4DsRsIvPdehYoVpAWq0_vgg7ZL6aqafYyrGefD8LkW6PcQPykwtlcNgWdLiBMy-bu3zmqFXk7gw== --org-id 0258df09deb53c6f --remote-id 0d41d0087d0ca000 --local-bucket-id 9d7c04ee134be939 --remote-bucket-id a11db21d91ff7821 --remote-bucket u18c1_bucket --max-age 0
  6. The tokens used are all root tokens.
philjb commented 3 days ago

401 is unauthorized - seems there is an issue with your token setup or the permissions of the tokens. I would try again with new tokens.

With a quick glance, I think your remote and stream commands look ok: double check with the docs: https://docs.influxdata.com/influxdb/cloud/write-data/replication/replicate-data/

win434545299 commented 3 days ago

401 is unauthorized - seems there is an issue with your token setup or the permissions of the tokens. I would try again with new tokens.

With a quick glance, I think your remote and stream commands look ok: double check with the docs: https://docs.influxdata.com/influxdb/cloud/write-data/replication/replicate-data/

@philjb

  1. I checked the two commands many times and found no differences with the documentation.
  2. I created the All Access API Token and replaced all the tokens in the command. Now when synchronizing, it still cannot be written. The current situation seems to be that the slave data can be detected to have changed, but when writing to the host, the token does not have permission.
  3. image

win434545299 commented 10 hours ago

@philjb I have tried many times again, but this problem has persisted. If possible, please help me take a look at this again. Thank you very much