上面链接里同样介绍了如何汉化和开发,确定电

ONLYOFFICE界面汉化,onlyoffice汉化

上面链接里同样介绍了如何汉化和开发。

我用golang的beego框架开发了文档管理,实现实时文档协作。

首先是安装docker,然后是拉取document server镜像,再就是汉化界面,最后是用golang提供回调和存储编辑后的文档。

汉化的步骤:1、删除容器里的文件,替换windows下的字体。

 删除容器 /usr/share/fonts下的所有文件. 然后运行script: documentserver-generate-allfonts.sh 然后清理浏览器缓存。

//进入容器(运行的镜像)内,删除/usr/share/fonts下除truetype外其他文件和文件夹

$ dockerexec -it 38e27 /bin/bash

[email protected]:/#dir或者ls –al

 

[email protected]:~#cd /usr/share/fonts/

[email protected]:/usr/share/fonts#ls

truetype  X11

//删除文件夹X11

[email protected]:/usr/share/fonts#rm -R dir X11

rm:cannot remove dir: No such file or directory

[email protected]:/usr/share/fonts#ls

truetype

[email protected]:/usr/share/fonts#cd truetype

[email protected]:/usr/share/fonts/truetype#ls –al

[email protected]:/usr/share/fonts/truetype#ls -al

total462392

drwxr-xr-x11 root   root       4096 Feb 19 04:17 .

………………

//删除trutype文件夹下所有文件,除了custome文件夹外

[email protected]:/usr/share/fonts/truetype#rm -R dir *.*

rm:cannot remove dir: No such file or directory

[email protected]:/usr/share/fonts/truetype#rm -R dir *

rm:cannot remove dir: No such file or directory

rm:cannot remove custom: Device or resource busy

[email protected]:/usr/share/fonts/truetype#ls

custom

[email protected]:/usr/share/fonts/truetype#ls -al

total 12

drwxr-xr-x10 root root 4096 Feb 19 10:14 .

drwxr-xr-x  6 root root 4096 Feb 19 10:12 ..

drwxr-xr-x  2 root root 4096 Feb 19 03:48 custom

……

 

[email protected]:/usr/share/fonts/truetype#exit

exit

 

[email protected] ~/winfont

//将当前文件夹C:UsersAdministrator下的winfont文件夹内的字体全部拷贝到容器的文件夹/usr/share/fonts/truetype中

$ tar -cv* | docker exec -i 6df tar x -C /usr/share/fonts/truetype

kaiu.ttf

msjh.ttc

msjhbd.ttc

msjhl.ttc

msyh.ttc

msyh.ttf

msyhbd.ttc

msyhl.ttc

simfang.ttf

simhei.ttf

simkai.ttf

simli.ttf

simsun.ttc

simsunb.ttf

simyou.ttf

……

 

[email protected] ~/winfont

//进入容器内

$ dockerexec -it 6df /bin/bash

[email protected]:/#sudo mkfontscale

[email protected]:/#sudo mkfontdir

[email protected]:/#sudo fc-cache -fv

/usr/share/fonts:caching, new cache contents: 0 fonts, 1 dirs

…………

fc-cache:succeeded

[email protected]:/#exit

exit

//退出容器

[email protected] ~/winfont

$ dockerexec 6df /usr/bin/documentserver-generate-allfonts.sh

GeneratingAllFonts.js, please wait...Done

onlyoffice-documentserver:docservice:stopped

onlyoffice-documentserver:docservice:started

onlyoffice-documentserver:converter:stopped

onlyoffice-documentserver:converter:started

 

如果机器重启后,不要用dockerrun命令,要用dockerstart

具体步骤见图:

然后在调用onlyoffice协同编辑的页面中,设置"lang": "zh-CN",

[html] view plain copy

  1.                 "editorConfig": {  
  2.                     "callbackUrl": "",  
  3.                     "user": {  
  4.                         "id": "{{.Uid}}",  
  5.                         "name": "{{.Uname}}"  
  6.                     },  
  7.                     "lang": "zh-CN",//"en-US",  
  8.                 },  

详细代码见

查看评论

上面链接里同样介绍了如何汉化和开发。 我用golang的beego框架开...

msyh.ttc

fc-cache:succeeded

3.3查看运行的容器

Hadoop动态添加删除节点datanode及恢复

  1. 配置系统环境

主机名,ssh互信,环境变量等

本文略去jdk安装,请将datanode的jdk安装路径与/etc/Hadoop/hadoop-evn.sh中的java_home保持一致,版本hadoop2.7.5

修改/etc/sysconfig/network

然后执行命令
hostname 主机名
这个时候可以注销一下系统,再重登录之后就行了

[[email protected] ~]# hostname
localhost.localdomain
[[email protected] ~]# hostname -i
::1 127.0.0.1
[[email protected] ~]#
[[email protected] ~]# cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=slave2
GATEWAY=192.168.48.2
# Oracle-rdbms-server-11gR2-preinstall : Add NOZEROCONF=yes
NOZEROCONF=yes
[[email protected] ~]# hostname slave2
[[email protected] ~]# hostname
slave2
[[email protected] ~]# su - hadoop
Last login: Sat Feb 24 14:25:48 CST 2018 on pts/1
[[email protected] ~]$ su - root

建datanode目录并改所有者

(此处的具体路径值,请参照namenode中/usr/hadoop/hadoop-2.7.5/etc/hadoop/hdfs-site.xml,core-site.xml中的dfs.name.dir,dfs.data.dir,dfs.tmp.dir等)

Su - root

# mkdir -p /usr/local/hadoop-2.7.5/tmp/dfs/data

# chmod -R 777 /usr/local/hadoop-2.7.5/tmp

# chown -R hadoop:hadoop /usr/local/hadoop-2.7.5

[[email protected] ~]# mkdir -p /usr/local/hadoop-2.7.5/tmp/dfs/data
[[email protected] ~]# chmod -R 777 /usr/local/hadoop-2.7.5/tmp
 [[email protected] ~]# chown -R hadoop:hadoop /usr/local/hadoop-2.7.5
 [[email protected] ~]# pwd
/root
[[email protected] ~]# cd /usr/local/
[[email protected] local]# ll
total 0
drwxr-xr-x. 2 root  root  46 Mar 21  2017 bin
drwxr-xr-x. 2 root  root    6 Jun 10  2014 etc
drwxr-xr-x. 2 root  root    6 Jun 10  2014 games
drwxr-xr-x  3 hadoop hadoop 16 Feb 24 18:18 hadoop-2.7.5
drwxr-xr-x. 2 root  root    6 Jun 10  2014 include
drwxr-xr-x. 2 root  root    6 Jun 10  2014 lib
drwxr-xr-x. 2 root  root    6 Jun 10  2014 lib64
drwxr-xr-x. 2 root  root    6 Jun 10  2014 libexec
drwxr-xr-x. 2 root  root    6 Jun 10  2014 sbin
drwxr-xr-x. 5 root  root  46 Dec 17  2015 share
drwxr-xr-x. 2 root  root    6 Jun 10  2014 src
[[email protected] local]#

ssh互信,即实现 master-->slave2免密码

master:

[[email protected] ~]# cat /etc/hosts

127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4

::1        localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.48.129    hadoop-master

192.168.48.132    slave1

192.168.48.131    slave2

[[email protected] ~]$ scp /usr/hadoop/.ssh/authorized_keys [email protected]:/usr/hadoop/.ssh

The authenticity of host 'slave2 (192.168.48.131)' can't be established.

ECDSA key fingerprint is 1e:cd:d1:3d:b0:5b:62:45:a3:63:df:c7:7a:0f:b8:7c.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'slave2,192.168.48.131' (ECDSA) to the list of known hosts.

[email protected]'s password:

authorized_keys       

[[email protected] ~]$ ssh [email protected]

Last login: Sat Feb 24 18:27:33 2018

[[email protected] ~]$

[[email protected] ~]$ exit

logout

Connection to slave2 closed.

[[email protected] ~]$

  1. 修改namenode节点的slave文件,增加新节点信息

[[email protected] hadoop]$ pwd

/usr/hadoop/hadoop-2.7.5/etc/hadoop

[[email protected] hadoop]$ vi slaves

slave1

slave2

3. 在namenode节点上,将hadoop-2.7.3复制到新节点上,并在新节点上删除data和logs目录中的文件

Master

[[email protected] ~]$ scp -R hadoop-2.7.5 [email protected]:/usr/hadoop

Slave2

[[email protected] hadoop-2.7.5]$ ll

total 124

drwxr-xr-x 2 hadoop hadoop  4096 Feb 24 14:29 bin

drwxr-xr-x 3 hadoop hadoop    19 Feb 24 14:30 etc

drwxr-xr-x 2 hadoop hadoop  101 Feb 24 14:30 include

drwxr-xr-x 3 hadoop hadoop    19 Feb 24 14:29 lib

drwxr-xr-x 2 hadoop hadoop  4096 Feb 24 14:29 libexec

-rw-r--r-- 1 hadoop hadoop 86424 Feb 24 18:44 LICENSE.txt

drwxrwxr-x 2 hadoop hadoop  4096 Feb 24 14:30 logs

-rw-r--r-- 1 hadoop hadoop 14978 Feb 24 18:44 NOTICE.txt

-rw-r--r-- 1 hadoop hadoop  1366 Feb 24 18:44 README.txt

drwxr-xr-x 2 hadoop hadoop  4096 Feb 24 14:29 sbin

drwxr-xr-x 4 hadoop hadoop    29 Feb 24 14:30 share

[[email protected] hadoop-2.7.5]$ pwd

/usr/hadoop/hadoop-2.7.5

[[email protected] hadoop-2.7.5]$ rm -R logs/*

  1. 启动新datanode的datanode和nodemanger进程

先确认namenode和当前的datanode中,etc/hoadoop/excludes文件中无待加入的主机,再进行下面操作

[[email protected] hadoop-2.7.5]$ sbin/hadoop-daemon.sh start datanode
starting datanode, logging to /usr/hadoop/hadoop-2.7.5/logs/hadoop-hadoop-datanode-slave2.out
[[email protected] hadoop-2.7.5]$ sbin/yarn-daemon.sh start nodemanager
starting datanode, logging to /usr/hadoop/hadoop-2.7.5/logs/yarn-hadoop-datanode-slave2.out
[[email protected] hadoop-2.7.5]$
[[email protected] hadoop-2.7.5]$ jps
3897 DataNode
6772 NodeManager
8189 Jps
[[email protected] ~]$

5、在NameNode上刷新节点

[[email protected] ~]$ hdfs dfsadmin -refreshNodes
Refresh nodes successful
[[email protected] ~]$sbin/start-balancer.sh

  1. 在namenode查看当前集群情况,

确认信节点已经正常加入

[[email protected] hadoop]$ hdfs dfsadmin -report
Configured Capacity: 58663657472 (54.63 GB)
Present Capacity: 15487176704 (14.42 GB)
DFS Remaining: 15486873600 (14.42 GB)
DFS Used: 303104 (296 KB)
DFS Used%: 0.00%
Under replicated blocks: 5
Blocks with corrupt replicas: 0
Missing blocks: 0
Missing blocks (with replication factor 1): 0


Live datanodes (2):

Name: 192.168.48.131:50010 (slave2)
Hostname: 183.221.250.11
Decommission Status : Normal
Configured Capacity: 38588669952 (35.94 GB)
DFS Used: 8192 (8 KB)
Non DFS Used: 36887191552 (34.35 GB)
DFS Remaining: 1701470208 (1.58 GB)
DFS Used%: 0.00%
DFS Remaining%: 4.41%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Thu Mar 01 19:36:33 PST 2018

Name: 192.168.48.132:50010 (slave1)
Hostname: slave1
Decommission Status : Normal
Configured Capacity: 20074987520 (18.70 GB)
DFS Used: 294912 (288 KB)
Non DFS Used: 6289289216 (5.86 GB)
DFS Remaining: 13785403392 (12.84 GB)
DFS Used%: 0.00%
DFS Remaining%: 68.67%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Thu Mar 01 19:36:35 PST 2018

[[email protected] hadoop]$

7动态删除datanode

7.1配置NameNode的hdfs-site.xml,

适当减小dfs.replication副本数,增加dfs.hosts.exclude配置

[[email protected] hadoop]$ pwd
/usr/hadoop/hadoop-2.7.5/etc/hadoop
[[email protected] hadoop]$ cat hdfs-site.xml
<configuration>
<property>
      <name>dfs.replication</name>
      <value>3</value>
</property>
  <property>
      <name>dfs.name.dir</name>
      <value>/usr/local/hadoop-2.7.5/tmp/dfs/name</value>
</property>
    <property>
      <name>dfs.data.dir</name>
      <value>/usr/local/hadoop-2.7.5/tmp/dfs/data</value>
    </property>
<property>
    <name>dfs.hosts.exclude</name>
    <value>/usr/hadoop/hadoop-2.7.5/etc/hadoop/excludes</value>
  </property>

</configuration>

7.2在namenode对应路径(/etc/hadoop/)下新建excludes文件,

并写入待删除DataNode的ip或域名

[[email protected] hadoop]$ pwd
/usr/hadoop/hadoop-2.7.5/etc/hadoop
[[email protected] hadoop]$ vi excludes
####slave2
192.168.48.131[[email protected] hadoop]$

7.3在NameNode上刷新所有DataNode

hdfs dfsadmin -refreshNodes
sbin/start-balancer.sh

7.4在namenode查看当前集群情况,

确认信节点已经正常删除,结果中已无slave2

[[email protected] hadoop]$ hdfs dfsadmin -report

或者可以在web检测界面(ip:50070)上可以观测到DataNode逐渐变为Dead。

在datanode项,Admin state已经由“In Service“变为”Decommissioned“,则表示删除成功

7.5停止已删除的节点相关进程

[[email protected] hadoop-2.7.5]$ jps
9530 Jps
3897 DataNode
6772 NodeManager
[[email protected] hadoop-2.7.5]$ sbin/hadoop-daemon.sh stop datanode
stopping datanode
[[email protected] hadoop-2.7.5]$ sbin/yarn-daemon.sh stop nodemanager
stopping nodemanager
[[email protected] hadoop-2.7.5]$ jps
9657 Jps
[[email protected] hadoop-2.7.5]$

8恢复已删除节点

执行7.2 中删除相关信息,然后4,5,6即可。

Hadoop2.3-HA高可用集群环境搭建 
Hadoop项目之基于CentOS7的Cloudera 5.10.1(CDH)的安装部署 
Hadoop2.7.2集群搭建详解(高可用) 
使用Ambari来部署Hadoop集群(搭建内网HDP源) 
Ubuntu 14.04下Hadoop集群安装 
CentOS 6.7安装Hadoop 2.7.2 
Ubuntu 16.04上构建分布式Hadoop-2.7.3集群 
CentOS 7 下 Hadoop 2.6.4 分布式集群环境搭建 
Hadoop2.7.3+Spark2.1.0完全分布式集群搭建过程 

1. 配置系统环境 主机名,ssh互信,环境变量等 本文略去jdk安装,请将datanode的jdk安装路径与/etc/Hadoop/had...

simsunb.ttf

truetype

可以用我做好的镜像导入。见docker load < documentserver.tar命令。

total 12

$ tar -cv* | docker exec -i 6df tar x -C /usr/share/fonts/truetype

onlyoffice-documentserver:converter: started

Administrator@604TFALNDKDKJWCMINGW64 ~/winfont

图片 1

到此已经可以用了。不过,就是要换一下documentserver中的字体,换成文泉驿linux字体。

msyhbd.ttc

truetype  X11

用find命令(Linux命令)找到字体所在目录,应该是/usr/share/fonts/truetype/msttcorefonts

msyh.ttf

$ dockerexec -it 38e27 /bin/bash

Administrator@604TFALNDKDKJWC MINGW64/c/program files/git/usr/share/fonts

simfang.ttf

$ dockersave -o onlyofficedocumentserver.tar onlyoffice/documentserver)

第四步:运行engineercms

//进入容器(运行的镜像)内,删除/usr/share/fonts下除truetype外其他文件和文件夹

root@6dfa5705aaef:/usr/share/fonts/truetype#ls –al

[root]# rm -R dir dirname删除所有

//将当前文件夹C:UsersAdministrator下的winfont文件夹内的字体全部拷贝到容器的文件夹/usr/share/fonts/truetype中

root@6dfa5705aaef:/usr/share/fonts#ls

3.4进入容器(运行的镜像)内

$ dockerexec 6df /usr/bin/documentserver-generate-allfonts.sh

//删除文件夹X11

再键入下面命令:

…………

Administrator@604TFALNDKDKJWCMINGW64 ~/winfont

Docker ps

root@6dfa5705aaef:/usr/share/fonts#rm -R dir X11

root@6dfa5705aaef:/usr/share/fonts/truetype#exit

[root]# rm -f *.ttf

[html]view plaincopy

simyou.ttf

sudo fc-cache -fv (建立字体缓存信息,也就是让系统认识雅黑)

https://github.com/3xxx/EngineerCMS

drwxr-xr-x10 root root 4096 Feb 19 10:14 .

——追求简单化的安装就能享受高雅的网络协作办公环境

root@6dfa5705aaef:/usr/share/fonts#ls

onlyoffice-documentserver:converter:stopped

Generating AllFonts.js, please wait...Done

$ dockerexec -it 38e27 /bin/bash

root@6dfa5705aaef:/#sudo mkfontscale

onlyoffice-documentserver:converter: stopped

/usr/share/fonts:caching, new cache contents: 0 fonts, 1 dirs

//进入容器(运行的镜像)内

把engineercms整个文件夹拷贝到宿主机的d盘,点击里面的engineercms.exe就行了,默认是宿主机80端口,如果冲突,需要在conf中更换端口。

                    },  

root@6dfa5705aaef:/usr/share/fonts/truetype#rm -R dir *

docker pull onlyoffice/documentserver

root@6dfa5705aaef:/usr/share/fonts/truetype#exit

rm:cannot remove dir: No such file or directory

第一步:确定电脑打开了cpu虚拟打开。https://jingyan.baidu.com/article/22fe7ced3b4c003002617f17.html

本文由必威发布于必威-运维,转载请注明出处:上面链接里同样介绍了如何汉化和开发,确定电

TAG标签:
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。