Skip to content

Commit

Permalink
Merge pull request #49 from luyyang1u/feature_add_txsql_open_doc
Browse files Browse the repository at this point in the history
The documentation has been updated to include the new txsql open-sour…
  • Loading branch information
gh-Devin authored Aug 30, 2024
2 parents a8e6980 + 212fd98 commit 5f5c701
Show file tree
Hide file tree
Showing 2 changed files with 283 additions and 286 deletions.
85 changes: 41 additions & 44 deletions docs/guide/18-txsql_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,66 +14,63 @@
### 安装依赖

```bash
# yum install -y git ncurses-devel bison cmake3 libaio-devel openssl openssl-devel cyrus-sasl-devel openldap-devel gtest libtirpc-devel
yum install -y git ncurses-devel bison cmake3 libaio-devel openssl openssl-devel cyrus-sasl-devel openldap-devel gtest libtirpc-devel

### gcc
# yum install centos-release-scl -y
# yum install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils -y
yum install centos-release-scl -y
yum install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils -y
```

## 编译流程

选择tdsql-develop-8.0.18分支
选择8.0分支

```bash
# cd tdsql/

### -t 可选择debug和release模式
# bash make.sh -t release -r 1
mkdir /tmp/txsql_extra && curl -o /txsql_extra/boost_1_70_0.tar.gz https://archives.boost.io/release/1.70.0/source/boost_1_70_0.tar.gz
tar xzf /tmp/txsql_extra/boost_1_70_0.tar.gz -C /txsql_extra
./build.sh -b /tmp/txsql_extra/boost_1_70_0 -t release
```

编译生成的TXSQL二进制包,是存在代码库tdsql/mysql_install目录下

## 安装和卸载TXSQL

### 安装TXSQL

TXSQL在mysql-server-8.0.18的install目录下,有封装的install_mysql_innodb.sh脚本可以用于快速安装
## 体验TXSQL
通过 mtr 拉起 mysqld 测试,在 mysql-test 目录下,执行 ./mtr --start 即可

```bash
# cd ./install
# export change_ip_before_use=$ip;bash ./install_mysql_innodb.sh default mysql $port $bpsize $datadir $logdir "character_set_server=utf8&collation_server=utf8_general_ci&lower_case_table_names=1"
cd bld-release/mysql-test
./mtr --start
```

- $ip:部署所在的本机物理ip,如:192.168.1.1
- $port:指定TCP/IP连接监听的端口号,如:4001
- $bpsize:innodb_buffer_pool_size配置,如:96000M
- $datadir:存储数据路径,如:/data2/tdsql/data
- $logdir:存储日志路径,如:/data2/tdsql/log

执行脚本后,有如下信息返回,则表示安装成功
```bash
...
+---------------------+
| now() |
+---------------------+
| xxxx-xx-xx xx:xx:xx |
+---------------------+
+----------------------------------+
| version() |
+----------------------------------+
| 8.0.xx-v18-txsql-xx.x.x-xxxxxxxx |
+----------------------------------+
START SUCCESS.
[xxxx-xx-xx xx:xx:xx] installing finished:xxxx!
待数据初始化好后,连接数据库
```shell
mysql -uroot -S bld-release/mysql-test/var/tmp/mysqld.1.sock
```
### 卸载TXSQL

卸载会清理该节点的所有binlog和数据,谨慎执行

```bash
# cd ./install
# ./uninstall_mysql.sh $port
```

- $port:安装TXSQL时指定的监听端口号,如:4001
执行脚本后,有如下信息返回,则表示安装成功
```sql
# Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.22-txsql-v18-txsql-22.3.0-20240830 Source distribution

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mtr |
| mysql |
| performance_schema |
| sys |
| test |
+--------------------+
6 rows in set (0.00 sec)
```
Loading

0 comments on commit 5f5c701

Please sign in to comment.