暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

【stonedb】centos部署stonedb的安装操作步骤

原创 %Lucky 2022-12-07
639

说明:在centos上安装rpm包的步骤与方法如下,注意在安装中下载自己所需的安装包与替换文章中有关安装包的地方。安装包的下载出处,请见stonedb的官网通知。

第一步:下载安装包并解压

(1)获取安装包:
wget http://192.168.30.30/tmp/zsp/jenkins/stonedb57_jenkins-dev-20221205062314.tar.gz
(2)下载所需依赖
● yum install epel-release.noarch -y
●  yum install  jemalloc-devel.x86_64 snappy-devel.x86_64 libzstd-devel.x86_64 -y
(3)解压安装包
tar -zxvf stonedb57_jenkins-dev-20221205062314.tar.gz
(4)rpm安装
rpm -ivh stonedb_5.7-1.0.1-1.el7.x86_64.rpm

第二步:安装rpm包成功

rpm -ivh stonedb_5.7-1.0.1-1.el7.x86_64.rpm(可替换写自己的安装包)

执行成功后的显示如下所示:
[root@localhost x86_64]# rpm -ivh stonedb_5.7-1.0.1-1.el7.x86_64.rpm
Preparing… ################################# [100%]
package stonedb_5.7-1.0.1-1.el7.x86_64 is already installed
[root@localhost x86_64]# ll

第三步:查看安装的stonedb

[root@localhost ~]# which mysql
/opt/stonedb57/install/bin/mysql

第四步:查看mysql的进程,找出data目录

[root@localhost ~]# ps -ef | grep mysql

执行后的显示预期结果如下:

[root@localhost ~]# ps -ef | grep mysql
root     48903     1  0 14:18 ?        00:00:00 /bin/sh /opt/stonedb57/install//bin/mysqld_safe --datadir=/opt/stonedb57/install/data/ --pid-file=/opt/stonedb57/install/data/mysqld.pid --port-open-timeout=74
mysql    49003 48903  0 14:18 ?        00:00:01 /opt/stonedb57/install/bin/mysqld --basedir=/opt/stonedb57/install --datadir=/opt/stonedb57/install/data --plugin-dir=/opt/stonedb57/install/lib/plugin --user=mysql --port-open-timeout=74 --log-error=localhost.localdomain.err --pid-file=/opt/stonedb57/install/data/mysqld.pid
root     50130 49956  0 14:33 pts/0    00:00:00 grep --color=auto mysql

接下来进入到data目录下,找到mysqld.log文件并复制出初始密码

[root@localhost ~]# cd /opt/stonedb57/install/data
[root@localhost data]# cat mysqld.log

执行后的结果显示如下:

[root@localhost ~]# cd /opt/stonedb57/install/data
[root@localhost data]# cat mysqld.log
2022-12-07T06:17:10.061059Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
2022-12-07T06:18:03.653873Z 0 [Warning] InnoDB: New log files created, LSN=48434
2022-12-07T06:18:03.779606Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-12-07T06:18:03.996100Z 0 [Warning] 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: e8691ce9-75f6-11ed-90bd-aeb104ea3fd5.
2022-12-07T06:18:03.997181Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-12-07T06:18:04.220141Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-12-07T06:18:04.220185Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-12-07T06:18:04.221129Z 0 [Warning] CA certificate ca.pem is self signed.
2022-12-07T06:18:04.359176Z 1 [Note] A temporary password is generated for root@localhost: 8yzKB(ea(?D&     #注意此处是初始密码,复制保存

第五步:登录数据库

(1)首先登录数据库

/opt/stonedb57/install/bin/mysql -uroot -p   #回车之后输出复制的初始密码
[root@localhost data]# /opt/stonedb57/install/bin/mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.36-StoneDB-log

Copyright (c) 2021, 2022 StoneAtom Group Holding Limited
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

(2)修改初始密码

mysql> ALTER USER 'root'@'localhost' identified by '新密码'; 
mysql> flush privileges;   #刷新权限

执行后的结果显示如下

mysql> ALTER USER 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

第六步:配置快捷登录

[root@localhost data]# vim ~/.bashrc 
#添加如下的此段内容
alias mysql="/opt/stonedb57/install/bin/mysql -uroot -p123456"
[root@localhost data]# source ~/.bashrc    #保存更改
[root@localhost data]# mysql    #可直接使用mysql进入到数据库
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.36-StoneDB-log build-

Copyright (c) 2021, 2022 StoneAtom Group Holding Limited
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

至此则配置结束,可以直接使用数据库

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论