AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题

问题[ubuntu](dba)

Martin Hope
azzid
Asked: 2023-11-20 20:40:58 +0800 CST

Cassandra 的安全升级例程

  • 6

我的任务是升级基于 Ubuntu 的 Cassandra 集群 - 之前没有使用 Cassandra 的经验。

我尝试深入研究文档,但无法找到有关如何以受支持的方式进行升级的任何说明。

幸运的是,我有一个测试集群,只需确保 apt 指向正确的存储库并执行操作即可很好地升级apt upgrade- 但这可能只是由于数据库没有处于任何特定负载下。

是否应该在升级或类似操作之前封锁节点?或者信任 apt 做它的事情是否安全?

例如,nodetool upgradesstables从 4.0 升级到 4.1 后是否应该手动运行?

是否有我未能找到的有关该主题的文档?

I managed to find this resource and it is quite a lot more involved than the apt upgrade I feel was completely successful.

ubuntu
  • 2 个回答
  • 30 Views
Martin Hope
Anubhav Ranjan
Asked: 2023-11-02 17:23:07 +0800 CST

postgres 与 PostgreSQL 12 中的 pg_ctl 版本不同

  • 5

根据日志文件,我收到以下错误。

“/usr/lib/postgresql/12/bin/pg_ctl”找到了程序“postgres”,但与 pg_ctl 的版本不同。检查您的安装。

我运行的是 Ubuntu 20.04。

我执行了以下命令来确定正在运行的版本:

# /usr/lib/postgresql/12/bin/postgres --version
postgres (PostgreSQL) 12.16 (Ubuntu 12.16-0ubuntu0.20.04.1)
# /usr/lib/postgresql/12/bin/pg_ctl --version
pg_ctl (PostgreSQL) 12.15 (Ubuntu 12.15-0ubuntu0.20.04.1)

由于当前情况使我的数据库服务器无用并且我有一些无法访问的数据库,我是否需要更新或执行某些任务?


另外,现在当我运行命令时,我收到此错误:

postgres@tvsr-strapi:~$ psql
psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
postgres@tvsr-strapi:~$

我已经尝试重新创建符号链接,但仍然不起作用。

ubuntu
  • 1 个回答
  • 19 Views
Martin Hope
sunShine
Asked: 2023-01-21 06:39:24 +0800 CST

我怎样才能解决声明失败的问题?

  • 6

我正在尝试在 Ubuntu 上连接 FDB 文件。

ubuntu@me:/opt/firebird/bin$ sudo ./isql
Use CONNECT or CREATE DATABASE to specify a database
No entry for terminal type "xterm-256color";
using dumb terminal settings.
SQL>  connect "00.000.000.000:3050:/home/ubuntu/Firebird4.0/firebird.fdb " user 'SYSDBA' 
password 'masterkey';

但是,我收到此错误:

Statement failed, SQLSTATE = 08001 unavailable database 这里有什么问题?我该如何解决这个问题?

ubuntu
  • 1 个回答
  • 31 Views
Martin Hope
padjee
Asked: 2022-09-03 16:07:13 +0800 CST

无法写入文件“pg_wal/xlogtemp.2399”设备上没有剩余空间

  • 0

我正在使用此查询生成虚拟数据:

INSERT INTO tbltest1 (id, kol1, kol2)
SELECT generate_series(1,10000), substr(md5(random()::text), 1, 25), substr(md5(random()::text), 1, 45)
FROM generate_series(1, 1000000);

然后,在这个过程的中间,出现了这个错误:无法写入文件“pg_wal/xlogtemp.2399”,设备上没有剩余空间。

显然,这表明我没有空间了。

psql然后我想通过发出“ ”命令进入数据库。但是出现了这个错误“.s.PGSQL.5432”:连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败。没有这样的文件或目录弹出。

我看到一些错误会导致这个“.s.PGSQL.5432”错误。这对我来说真的是一条死胡同。

为什么会发出 no space left 错误?为什么 WAL 文件没有被回收?我有archive_mode = off,wal_level = logical。WAL 应该在此设置中回收。我该怎么做才能再次打开数据库?

我看到我仍然有很多可用空间(大约 20GB 以上)我在运行在 Win 10 主机上的 VM 上运行。

它真的困扰着我。请帮忙

更新

由于没有剩余空间,postgre 似乎无法写入 pg_wal。

  1. 我检查使用$root df -h
  2. 然后我增加空间:从 live USB (Ubuntu ISO) 启动。选择“Try Ubuntu” 打开 gparted 将 postgre 所在的 HDD 空间移动到磁盘末尾 展开以消耗可用空间 重新启动 VM,此处和此处也不使用 ISO Full 指令
  3. 使用引导光盘(上面的 Ubuntu ISO)执行Memory Test(memtest86+)。我不认为这一步是必要的。
  4. Reebot 来宾操作系统(我在 VMWare Workstation 上运行服务器)
  5. 确保 Ubuntu 占用了所有分配的空间。完整的说明在这里。根据您的需要进行调整。
  6. 再次重新启动。
  7. 像往常一样登录到 Ubuntu 并启动 postgres

现在postgres可以正常运行了。不再有“.s.PGSQL.5432”错误。

到目前为止,我的结论是 pg_wal 上没有剩余空间会导致 " .s.PGSQL.5432" 错误。

现在我面临另一个错误。我可以做“ Select * from table Limit 10”但我不能做像“ Select count(id) From table”这样的查询。关于页面块有错误: 关系库/13462/16387的块62052中的无效页面

非常感谢任何评论或帮助。

Ubuntu 22.04 在 VM、Postgres 12 上运行。

[ 错误4 vm_setting

postgresql ubuntu
  • 1 个回答
  • 145 Views
Martin Hope
sandre89
Asked: 2022-06-17 08:32:47 +0800 CST

如何在 Ubuntu 20.04 LTS 中将 Postgres 次要版本从 14.x 升级到 14.4

  • 0

在 2022 年 6 月 16 日,Postgres 发布了一个周期外版本 14.4concurrently ,它修复了使用14.0 到 14.3 版本中的选项创建的索引可能出现的损坏。

不用说,这是一个非常重要的升级,应该尽快完成。

由于我是一名 Web 开发人员,也碰巧为我的副项目运行他自己的服务器,因此我希望能验证从 14.2 升级到 14.4 的步骤。

  1. 由于这是一个小升级,因此无需转储和重新导入;简单地“替换二进制文件”就足够了。这是否意味着我可以预期在停止服务器后的停机时间少于 5 分钟?(正好是安装新版本的时间?)

  2. 我的服务器已经http://apt.postgresql.org/pub/repos/apt/添加了 apt 存储库。在 a 之后sudo apt update,如何确保 asudo apt install postgresql在运行之前安装 14.4 版本?(我不希望它尝试升级到 14.3 或其他陈旧版本)

  3. 使用 停止服务器后,对于此升级是否足够sudo systemctl stop postgresql简单?sudo apt install postgresql

postgresql ubuntu
  • 2 个回答
  • 423 Views
Martin Hope
Do Nhu Vy
Asked: 2022-03-30 19:40:02 +0800 CST

错误:无法打开扩展控制文件“/usr/share/postgresql/13/extension/postgis.control”:没有这样的文件或目录

  • 2

Ubuntu 21.10,PostgreSQL 13。

在此处输入图像描述

我发现错误

ERROR: could not open extension control file "/usr/share/postgresql/13/extension/postgis.control": No such file or directory

如何解决?

postgresql ubuntu
  • 1 个回答
  • 2253 Views
Martin Hope
GeorgeC
Asked: 2022-02-25 05:50:52 +0800 CST

在 Ubuntu 上的 QGIS 中打开 SQL Server 数据

  • 0

我正在尝试从 Ubuntu 上的 QGIS 连接到 SQL Server (MSSQL) 数据库。

根据以下链接,我创建了一个 odbc.ini 文件和驱动程序 -

https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/connection-string-keywords-and-data-source-names-dsns?view=sql-server-ver15 和 https: //learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#ubuntu18

[TEST]

Driver = ODBC Driver 17 for SQL Server

# Server = [protocol:]server[,port]  

Server = tcp:xxx,1433

然后在 QGIS 我得到 在此处输入图像描述

在配置 Windows ODBC 后,我可以从 Windows 机器上的 QGIS 连接到它,所以我很确定这不是服务器/数据库上的权限问题,而是 Ubuntu 20.4 机器上的驱动程序/连接字符串有问题。

我还尝试了https://gis.stackexchange.com/a/216422/2891中的解决方案。

更新

我现在尝试了以下解决方案来使用 docker 安装 QGIS?https://gis.stackexchange.com/a/333581/2891

并查看了有关在 Ubuntu 20.4 中创建 ODBC 链接的许多建议,例如https://help.interfaceware.com/kb/904和http://guywyant.info/log/206/connecting-to-ms-sql-server-from -ubuntu/

我在哪里使用 tsql/telnet 得到响应,但是

isql -v MSSQL devuser 'devpass'

给我

[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified

我能够从我正在添加 ODBC 连接以使用 Azure Data Studio 和 Beekeeper Studio 的机器连接到数据库,没有任何问题。只是 ODBC 连接和需要此功能的软件(如 QGIS)不起作用。

有人在他们的机器上运行这个吗?很高兴用积分奖励完整的答案...

更新 2 因此,在运行以下命令后,我得到了基本连接,但仍然无法连接到 QGIS。可以为这最后一块拼图做些什么?

~# sudo curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add
~# sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
~# sudo apt-get update
~# sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
~# isql -v -k "DRIVER={ODBC Driver 18 for SQL Server};SERVER=tcp:111.111.111.11,1433;UID=Test;PWD=*****;Authentication=SqlPassword;TrustServerCertificate=Yes"
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select * from [Test].[dbo].[Optic_Fibre]

在此处输入图像描述

sql-server ubuntu
  • 1 个回答
  • 132 Views
Martin Hope
Marco
Asked: 2022-01-17 12:34:34 +0800 CST

pg_upgradecluster 的问题

  • 0

星期五我使用pg_upgradecluster(在 Debian Buster 上)从 PostgreSQL 13 升级到 14。这很有效,所以今天我想升级另一台服务器(Linux Mint 20.3 Cinnamon)。这一次它不起作用。这是我所做的:

root@farao:~# pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
13  main    5432 online postgres /srv/local/postgresql/13    /var/log/postgresql/postgresql-13-main.log
14  main    5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
root@farao:~# pg_dropcluster --stop 14 main
root@farao:~# pg_upgradecluster -V -v 13 main /srv/local/postgresql/data/14
Use of uninitialized value $newversion in string eq at /usr/bin/pg_upgradecluster line 398.
Use of uninitialized value $_[0] in concatenation (.) or string at /usr/share/perl5/PgCommon.pm line 1049.
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Use of uninitialized value $argv[10] in system at /usr/bin/pg_upgradecluster line 461.
Error: invalid version ''
Error: Could not create target cluster
root@farao:~# pg_lsclusters
Ver Cluster Port Status Owner    Data directory           Log file
13  main    5432 online postgres /srv/local/postgresql/13 /var/log/postgresql/postgresql-13-main.log
root@farao:~# ps -ef | grep postgres
postgres   24351    1306  0 20:57 ?        00:00:00 /usr/lib/postgresql/13/bin/postgres -D /srv/local/postgresql/13 -c config_file=/etc/postgresql/13/main/postgresql.conf -c hba_file=/tmp/pg_hba.UabjBQ.conf
postgres   24353   24351  0 20:57 ?        00:00:00 postgres: 13/main: checkpointer 
postgres   24354   24351  0 20:57 ?        00:00:00 postgres: 13/main: background writer 
postgres   24355   24351  0 20:57 ?        00:00:00 postgres: 13/main: walwriter 
postgres   24356   24351  0 20:57 ?        00:00:00 postgres: 13/main: autovacuum launcher 
postgres   24357   24351  0 20:57 ?        00:00:00 postgres: 13/main: stats collector 
postgres   24358   24351  0 20:57 ?        00:00:00 postgres: 13/main: logical replication launcher 
root       24488   18929  0 20:58 pts/0    00:00:00 grep --color=auto postgres
root@farao:~# cat /tmp/pg_hba.UabjBQ.conf
local all postgres ident
root@farao:~# pg_upgradecluster -V -v 13 main /srv/local/postgresql/data/14
Use of uninitialized value $newversion in string eq at /usr/bin/pg_upgradecluster line 398.
Use of uninitialized value $_[0] in concatenation (.) or string at /usr/share/perl5/PgCommon.pm line 1049.
Stopping old cluster...
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Use of uninitialized value $argv[10] in system at /usr/bin/pg_upgradecluster line 461.
Error: invalid version ''
Error: Could not create target cluster
root@farao:~# pg_upgradecluster
Usage: /usr/bin/pg_upgradecluster [OPTIONS] <old version> <cluster name> [<new data directory>]
root@farao:~# 

没有-V参数,结果是一样的。我做错了什么?我需要安装 PERL 模块吗?

备注我只记得我只安装了 postgresql-13 并使用了仍然存在的数据库和配置。PostgreSQL 是否在某处存储有关它创建的集群的信息initdb?不合逻辑,因为pg_lsclusters可以找到它。

postgresql ubuntu
  • 1 个回答
  • 858 Views
Martin Hope
Tiago Oliveira de Freitas
Asked: 2021-10-15 07:06:23 +0800 CST

创建表空间不适用于 Postgres - Ubuntu - NTFS

  • 0

我无法在挂载目录中创建新表空间

psql -U sysuser -d postgres -c "CREATE TABLESPACE dadospostgres LOCATION '/media/tiago/Dados/Postgres/Bancos';"
ERROR:  could not set permissions on directory "/media/tiago/Dados/Postgres/Bancos": Permission denied

psql -U sysuser -d postgres -c "CREATE TABLESPACE dadospostgres LOCATION '/media/tiago/Dados/Postgres';"
ERROR:  could not set permissions on directory "/media/tiago/Dados/Postgres": Permission denied

文件夹权限:

root@tiago:/media/tiago/Dados# ls -l /media/
total 4
drwxr-x---+ 4 root root 4096 out 14 11:29 tiago

root@tiago:/media/tiago/Dados# ls -l /media/tiago/ | grep Dados
drwxrwxrwx 1 tiago tiago 8192 out 14 10:52 Dados

root@tiago:/media/tiago/Dados# ls -l /media/tiago/Dados/ | grep Postgres
drwx------ 1 postgres postgres         144 out 14 11:33 Postgres

root@tiago:/media/tiago/Dados# ls -l /media/tiago/Dados/Postgres/
total 0
drwx------ 1 postgres postgres 0 out 14 11:33 Bancos

挂载磁盘

root@tiago:/media/tiago/Dados# lsblk -O
└─nvme1n1p2
     nvme1n1p2
           /dev/nvme1n1p2
                259:9    188,9G 953,9G ntfs     765G    80% /media/tia Dados 56836A8F5F3C7018                     3af9eb40-7c61-4a6f-a748-180335979b27 dos    ebd0a0a2-b9e5-4433-87c0-68b6b72699c7           01418683-fa44-448e-92c1-234d67229098           128  0  0       0              953,9G       root  disk  brw-rw----         0    512      0     512     512    0 none      255 part        0      512B       2T         0    0B uuid.df8e86d6-8a47-9916-2e43-8e8b6efdb7cd    0 nvme1n1

root@tiago:/media/tiago/Dados# cat /etc/fstab
UUID=56836A8F5F3C7018  /media/tiago/Dados       ntfs-3g auto,users,permissions 0 0

我需要这个已安装磁盘中的可用空间。

postgresql ubuntu
  • 1 个回答
  • 137 Views
Martin Hope
Rahul
Asked: 2021-06-25 03:07:38 +0800 CST

Ubuntu - Sybase - PHP 无法连接

  • 1

我正在尝试从在 Ubuntu(18.4) 系统上的 apache2 上运行的 PHP(7.4, 8.0) Laravel 连接 Sybase 17。我们正在使用 SQL Anywhere。Sybase 未安装在同一台服务器上。

我们收到此错误 - 警告:odbc_connect():SQL 错误:[unixODBC][驱动程序管理器]无法打开 lib '/opt/sqlanywhere17/lib64/libdbodbc17_r.so':找不到文件,SQLConnect 中的 SQL 状态 01000 /var/www/html/sybaseconnection.php 第 14 行

我们已经执行了以下步骤:

  1. 已经验证了 libdbodbc17_r.so 文件。
  2. 已获得必要的许可。
  3. 能够使用 Telnet 和命令行连接到 SQL Anywhere 17。
php ubuntu
  • 1 个回答
  • 300 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve