跳到主要内容
版本:v3&v6

开启/关闭 新版 Wiki

配置参数

配置项类型示例描述
wizEditorNewOrgEnablebooleantrue为知新团队开启开关
wizEditorDefaultEnablebooleantrue为知默认开启开关

操作步骤

ONES 配置 开启新版 wiki

修改配置

进入运行中的 ones 容器

ones-ai-k8s.sh

修改配置

vim config/private.yaml

如果打开的文件中有名为 wizEditorNewOrgEnable 的 key,则只需将它的值改为 true。如果不存在名为 wizEditorNewOrgEnable 的 key 则需要在最后一行写入 wizEditorNewOrgEnable: true


如果打开的文件中有名为 wizEditorDefaultEnable 的 key,则只需将它的值改为 true。如果不存在名为 wizEditorDefaultEnable 的 key 则需要在最后一行写入 wizEditorDefaultEnable: true

修改后保存并退出

应用配置

make setup-ones

当观察到如下输出则说明执行成功

bash-5.0# make setup-ones
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-07-21 06:29:02,150 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 06:29:02,217 [INFO] render config
2023-07-21 06:29:02,217 [INFO] merge configs
2023-07-21 06:29:06,234 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-21 06:29:06,234 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 06:29:06,299 [INFO] compatible overlay
2023-07-21 06:29:07,390 [INFO] collect dir info
2023-07-21 06:29:07,411 [INFO] setup global resrouces
2023-07-21 06:29:07,670 [INFO] gen registry credentials
2023-07-21 06:29:07,674 [INFO] setup namespace, registry-secret
2023-07-21 06:29:08,001 [INFO] setup local-storage static-pvc, static-pv (cache config to tmp/config.yaml)
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
deployment.apps/localstorage-ones-cn-server-node03 unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-07-21 06:29:12,522 [INFO] backward compatible
2023-07-21 06:29:12,655 [INFO] diff ones before setup
2023-07-21 06:29:17,467 [INFO] setup ones
2023-07-21 06:29:20,329 [INFO] record latest data
render to tmp/latest-record-setup-app-comfigmap.yaml
render to tmp/date-record-setup-app-comfigmap.yaml
2023-07-21 06:29:25,388 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-21 06:29:25,393 [INFO] setup ones finish
2023-07-21 06:29:25,394 [INFO] elapsed time: 23.177 seconds

进入数据库

cat config/private.yaml | grep -i mysqlRootPassword
#mysqlRootPassword: KSiGLzpG5B6zHNkB(用输出的密码来替换下面的<mysqlRootPassword>,例如KSiGLzpG5B6zHNkB)
kubectl -n ones exec -it mysql-cluster-mysql-0 bash
#进入mysql
mysql -uroot -p<mysqlRootPassword>

如果看到以下输出则说明进入数据库成功

bash-4.2$ mysql -uroot -pKSiGLzpG5B6zHNkB
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 122087
Server version: 5.7.42-log MySQL Community Server (GPL)

Copyright (c) 2000, 2023, 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>

修改数据库中的新版 wiki 配置

use project;
#Database changed

#更改配置
update org_config set config_data="{\"enable\":true,\"max_online_users_count\":100}" where config_type='1008';
#Query OK, 1 row affected (0.00 sec)
#Rows matched: 1 Changed: 1 Warnings: 0
#然后退出数据库
exit
#Bye

退出 mysql 的容器

exit

清空 redis 数据

#进入redis容器
kubectl -n ones exec -it stable-redis-master-0 bash
#进入redis客户端
redis-cli
#清空数据
flushall
#退出
exit

验证

登陆 ones 系统,在知识库管理模块中新建页面时可以看到新版 wiki 的图标。

ONES 配置 关闭新版 wiki

修改配置

进入运行中的 ones 容器

ones-ai-k8s.sh

修改配置

vim config/private.yaml

如果打开的文件中有名为 wizEditorNewOrgEnable 的 key,则只需将它的值改为 false。如果不存在名为 wizEditorNewOrgEnable 的 key 则需要在最后一行写入 wizEditorNewOrgEnable: false


如果打开的文件中有名为 wizEditorDefaultEnable 的 key,则只需将它的值改为 false。如果不存在名为 wizEditorDefaultEnable 的 key 则需要在最后一行写入 wizEditorDefaultEnable: false

修改后保存并退出

应用配置

make setup-ones

当观察到如下输出则说明执行成功

bash-5.0# make setup-ones
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-07-21 06:18:16,609 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 06:18:16,671 [INFO] render config
2023-07-21 06:18:16,671 [INFO] merge configs
2023-07-21 06:18:20,683 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-21 06:18:20,683 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 06:18:20,746 [INFO] compatible overlay
2023-07-21 06:18:21,838 [INFO] collect dir info
2023-07-21 06:18:21,861 [INFO] setup global resrouces
2023-07-21 06:18:22,130 [INFO] gen registry credentials
2023-07-21 06:18:22,134 [INFO] setup namespace, registry-secret
2023-07-21 06:18:22,445 [INFO] setup local-storage static-pvc, static-pv (cache config to tmp/config.yaml)
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
deployment.apps/localstorage-ones-cn-server-node03 unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-07-21 06:18:26,691 [INFO] backward compatible
2023-07-21 06:18:26,822 [INFO] diff ones before setup
2023-07-21 06:18:31,662 [INFO] setup ones
2023-07-21 06:18:34,748 [INFO] record latest data
2023-07-21 06:18:36,759 [INFO] latest_hash == current_hash, skip
2023-07-21 06:18:36,760 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-21 06:18:36,764 [INFO] setup ones finish
2023-07-21 06:18:36,764 [INFO] elapsed time: 20.093 seconds

进入数据库

cat config/private.yaml | grep -i mysqlRootPassword
#mysqlRootPassword: KSiGLzpG5B6zHNkB (用输出的密码来替换下面的<mysqlRootPassword>,例如KSiGLzpG5B6zHNkB)
kubectl -n ones exec -it mysql-cluster-mysql-0 bash
#进入mysql
mysql -uroot -p<mysqlRootPassword>

如果看到以下输出则说明进入数据库成功

bash-4.2$ mysql -uroot -pKSiGLzpG5B6zHNkB
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 122087
Server version: 5.7.42-log MySQL Community Server (GPL)

Copyright (c) 2000, 2023, 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>

修改数据库中的新版 wiki 配置

use project;
#Database changed

#更改配置
update org_config set config_data="{\"enable\":false,\"max_online_users_count\":100}" where config_type='1008';
#Query OK, 1 row affected (0.00 sec)
#Rows matched: 1 Changed: 1 Warnings: 0
#然后退出数据库
exit
#Bye

退出 mysql 的容器

exit

清空 redis 数据

#进入redis容器
kubectl -n ones exec -it stable-redis-master-0 bash
#进入redis客户端
redis-cli
#清空数据
flushall
#退出
exit

验证

登陆 ones 系统,在知识库管理模块中新建页面时看不到新版 wiki 的图标。