开启/关闭 老版 Wiki
配置参数
配置项 | 类型 | 示例 | 描述 |
---|---|---|---|
wikiEditorNewOrgEnable | boolean | true | 老wiki新团队开启开关 |
wikiEditorDefaultEnable | boolean | true | 老wiki默认开启开关 |
操作步骤
ONES 配置 开启老版 wiki
修改配置
进入运行中的 ones 容器
ones-ai-k8s.sh
修改配置
vim config/private.yaml
如果打开的文件中有名为 wikiEditorNewOrgEnable 的 key,则只需将它的值改为 true。如果不存在名为 wikiEditorNewOrgEnable 的 key 则需要在最后一行写入
wikiEditorNewOrgEnable: true
如果打开的文件中有名为 wikiEditorDefaultEnable 的 key,则只需将它的值改为 true。如果不存在名为 wikiEditorDefaultEnable 的 key 则需要在最后一行写入
wikiEditorDefaultEnable: 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 03:48:03,041 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 03:48:03,112 [INFO] render config
2023-07-21 03:48:03,112 [INFO] merge configs
2023-07-21 03:48:07,132 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-21 03:48:07,132 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 03:48:07,200 [INFO] compatible overlay
2023-07-21 03:48:08,261 [INFO] collect dir info
2023-07-21 03:48:08,283 [INFO] setup global resrouces
2023-07-21 03:48:08,534 [INFO] gen registry credentials
2023-07-21 03:48:08,537 [INFO] setup namespace, registry-secret
2023-07-21 03:48:08,850 [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 03:48:13,188 [INFO] backward compatible
2023-07-21 03:48:13,320 [INFO] diff ones before setup
2023-07-21 03:48:18,115 [INFO] setup ones
2023-07-21 03:48:21,064 [INFO] record latest data
2023-07-21 03:48:23,006 [INFO] latest_hash == current_hash, skip
2023-07-21 03:48:23,006 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-21 03:48:23,010 [INFO] setup ones finish
2023-07-21 03:48:23,010 [INFO] elapsed time: 19.898 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\":0}" where config_type='1007';
#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
如果打开的文件中有名为 wikiEditorNewOrgEnable 的 key,则只需将它的值改为 false。如果不存在名为 wikiEditorNewOrgEnable 的 key 则需要在最后一行写入
wikiEditorNewOrgEnable: false
如果打开的文件中有名为 wikiEditorDefaultEnable 的 key,则只需将它的值改为 false。如果不存在名为 wikiEditorDefaultEnable 的 key 则需要在最后一行写入
wikiEditorDefaultEnable: 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 04:26:38,612 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 04:26:38,676 [INFO] render config
2023-07-21 04:26:38,676 [INFO] merge configs
2023-07-21 04:26:42,939 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-21 04:26:42,940 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-21 04:26:43,002 [INFO] compatible overlay
2023-07-21 04:26:44,098 [INFO] collect dir info
2023-07-21 04:26:44,120 [INFO] setup global resrouces
2023-07-21 04:26:44,362 [INFO] gen registry credentials
2023-07-21 04:26:44,366 [INFO] setup namespace, registry-secret
2023-07-21 04:26:44,680 [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 04:26:48,928 [INFO] backward compatible
2023-07-21 04:26:49,063 [INFO] diff ones before setup
2023-07-21 04:26:53,905 [INFO] setup ones
2023-07-21 04:26:56,747 [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 04:27:01,738 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-21 04:27:01,743 [INFO] setup ones finish
2023-07-21 04:27:01,743 [INFO] elapsed time: 23.067 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\":0}" where config_type='1007';
#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 的图标。