GreatSQL社区

搜索

[已解决] 银河麒麟安装GreatSql失败

1045 2 2023-9-18 16:43
参考文档进行安装:

https://gitee.com/GreatSQL/GreatSQL-Manual/blob/master/4-install-guide/3-6-kylin-install.md
软件包:GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64.tar.xz
1.umask
0022


2. 安装
/sbin/groupadd mysql
/sbin/useradd -g mysql mysql -d /dev/null -s /sbin/nologin
mkdir -pv /home/middleware/greatsql/data
chown -R mysql:mysql /home/middleware/greatsql/data
chmod -R 700 /home/middleware/greatsql/data

cd /usr/local


tar -vxf GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64.tar.xz
cd GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/

echo 'export PATH=/usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/binPATH' >> ~/.bash_profile
source ~/.bash_profile

mkdir -p /var/lib/mysql-files && chown -R mysql:mysql /var/lib/mysql-files

3.greatsql.cnf

# /etc/greatsql.cnf
[client]
port=3307
socket=/home/middleware/greatsql/data/mysql.3307.sock

[mysql]
prompt="\u@mysqldb \R:\m:\s [\d]> "
no-auto-rehash
loose-skip-binary-as-hex

[mysqld]
user=mysql
port=3307
basedir=/usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64
datadir=/home/middleware/greatsql/data
socket=/home/middleware/greatsql/data/mysql.3307.sock
pid-file=/home/middleware/greatsql/data/mysql.3307.pid
character-set-server=utf8mb4
lower_case_table_names=1
innodb_temp_data_file_path=ibtmp1:12M:autoextend:max:5G
default_authentication_plugin=mysql_native_password

slow_query_log=1
log_timestamps=SYSTEM
slow_query_log_file=/home/middleware/greatsql/data/slow.log
log-error=/home/middleware/greatsql/data/mysql.error.log
long_query_time=1
log_queries_not_using_indexes =1
log_throttle_queries_not_using_indexes=60
min_examined_row_limit = 100
log_slow_admin_statements = 1
server-id=15910
log-bin=/home/middleware/greatsql/data/mysql-binlog

[mysqld_safe]
log-error=/home/middleware/greatsql/data/mysql.error.log
pid-file=/home/middleware/greatsql/data/mysql.3307.pid

[mysqldump]
quick
max_allowed_packet = 64M


4./etc/systemd/system/greatsql.service
[Unit]
Description=GreatSQL Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]


# some limits
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=65535
# processes/threads
LimitNPROC=65535
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false


User=mysql
Group=mysql
#如果是GreatSQL 5.7版本,此处需要改成simple模式,否则可能服务启用异常
#如果是GreatSQL 8.0版本则可以使用notify模式
#Type=simple
Type=notify
TimeoutSec=0
PermissionsStartOnly=true
ExecStartPre=/usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/bin/mysqld_pre_systemd
ExecStart=/usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/bin/mysqld  --defaults-file=/etc/greatsql.cnf $MYSQLD_OPTS
EnvironmentFile=-/etc/sysconfig/mysql
LimitNOFILE=10000
Restart=on-failure
RestartPreventExitStatus=1
Environment=MYSQLD_PARENT_PID=1
PrivateTmp=false


5. 启动


systemctl daemon-reload
service greatsql start


6. 报错


2023-09-18T15:38:51.836329+08:00 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-log-path: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2023-09-18T15:38:51.836401+08:00 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2023-09-18T15:38:51.836444+08:00 0 [System] [MY-010116] [Server] /usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/bin/mysqld (mysqld 8.0.32-24) starting as process 41350
2023-09-18T15:38:51.850025+08:00 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 69afa98f-55f6-11ee-ade3-980e2473db92.
2023-09-18T15:38:51.856387+08:00 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2023-09-18T15:38:51.856506+08:00 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-09-18T15:38:51.856531+08:00 0 [ERROR] [MY-010119] [Server] Aborting
2023-09-18T15:38:51.857023+08:00 0 [System] [MY-010910] [Server] /usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/bin/mysqld: Shutdown complete (mysqld 8.0.32-24)   GreatSQL, Release 24, Revision 3714067bc8c.
















error.log

4.11 KB, 下载次数: 1, 下载积分: 金币 -1

greatsql.service

1.09 KB, 下载次数: 0, 下载积分: 金币 -1

greatsql.cnf

4.49 KB, 下载次数: 0, 下载积分: 金币 -1

全部回复(2)
KAiTO 2023-9-18 17:12:33
请把/home/middleware/greatsql/data目录全部清空,并重新启动下GreatSQL
如果重启后还是出错,您就要再确认下data的目录路径是否正确,或者是可以重新再创一个data文件夹试试
KAiTO 2023-9-19 18:00:27
2023年9月19日此问题已解决
原因是
用户想自定义选择my.cnf文件,所以在greatsql.service中加入--defaults-file=/etc/greatsql.cnf,但由于GreatSQL中自动初始化脚本mysqld_pre_systemd并不支持自定义my.cnf文件设定,所以导致以上报错
目前社区已经预计在未来修复这个问题

目前解决方案如下

使用手动方式初始化
  1. $ /usr/local/GreatSQL-8.0.32-24-kylin-glibc2.28-aarch64/bin/mysqld --defaults-file=/etc/greatsql.cnf --initialize-insecure
复制代码
在使用systemd启动GreatSQL即可
  1. $ systemctl start greatsql
复制代码



c-java-father

1

主题

0

博客

2

贡献

新手上路

Rank: 1

积分
3

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-13 14:39 , Processed in 0.074462 second(s), 17 queries , Redis On.
快速回复 返回顶部 返回列表