源码编译成功截图
Tigase 官网 https://tigase.net/
源码下载地址
https://repository.tigase.org/git/tigase-server.git 小编现在一直没有下载成功(8.0)
官方文档地址
https://docs.tigase.net/tigase-server/8.0.0/
eclipse 配置git
eclipse 下载tigase源码
https://docs.tigase.net/tigase-server/8.0.0/Development_Guide/html/#hackingTigase Tigase 官方二次开发文档
解压下载的文件
tar -zxvf tigase-server-xxx-dist-max.tar.gz
或
gzip -d tigase-xxx.tar.gz
tar -xvf tigase-xxx.tar
CentOS7 mongodb4.0(目前最新版本) 安装
https://www.mongodb.com/ 官网,选择 Resources 资源中的 文档 Documentation Guides MongoDB Server Installation
https://docs.mongodb.com/manual/installation/
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/ mongodb 官网 安装教程
创建一个/etc/yum.repos.d/mongodb-org-4.0.repo
[mongodb-org-4.0]
name = MongoDB Repository
baseurl = https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck = 1
enabled = 1
gpgkey = https:// www.mongodb.org/static/pgp/server-4.0.asc
sudo yum install -y mongodb-org
默认情况下,MongoDB使用mongod用户帐户运行并使用以下默认目录:
/var/lib/mongo (数据目录)
/var/log/mongodb (日志目录)
sudo service mongod start 启动
sudo service mongod stop 停止
sudo service mongod restart 重启
使用
mongo 不要写错(写成mongod)
tail -f /var/log/mongodb/mongod.log 查看是否启动成功
mongodb 卸载(默认安装路径)
sudo service mongod stop
sudo yum erase $(rpm -qa | grep mongodb-org)
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongo
跟随系统自动启动
sudo chkconfig mongod on
mongodb 可视化工具
https://robomongo.org/download
更新于2019年6月2日 2:40
Mongo的远程连接 mongodb 4.0.10
注意:Mongo的远程连接需要打开权限控制
mongo
use admin;
#首先添加个管理员账号(root权限):
db.createUser({
user:"root",pwd:"xxx",roles:[{
role:"root",db:"admin"}]});
db.auth("root","xxx");返回1表示成功
#添加个普通账号(读写权限): (命令中的db 代表用户所分配的数据库)
db.createUser({
user:"abc",pwd:"xxx",roles:[{
role:"readWrite",db:"admin"}]});
db.auth("abc","xxx") ;返回1表示成功
停止服务
service mongod stop
修改 /etc/mongod.conf 配置文件
vi /etc/mongod.conf
net:
bindIp: 0.0.0.0 注意bindIp:后面有空格,空格
serurity:
authorization: enabled #开启远程密码验证
setParameter:
enableLocalhostAuthBypass: true # 本地登录时不需要密码
service mongod restart
mongo --port 27017 -u myUserAdmin -p 'abc123' --authenticationDatabase 'admin'
mongo --version 4.0.10
cat /proc/version 查看CentOS版本
https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/#authenticate-with-full-administrative-access-via-localhost
https://blog.csdn.net/wangdatao_/article/details/78077774
更新于2019年6月2日 10:22
https://blog.csdn.net/Navagate/article/details/45956293 XMPP协议 搭建Tigase开发环境
tigase 配置
vi etc/config.tdsl
'config-type' = 'setup'
http () {
setup () {
'admin-user' = 'admin'
'admin-password' = '123456'
}
}
dataSource {
default () {
uri = 'mongodb://mongodb用户名:mongodb密码@localhost/数据库' 如 uri = 'mongodb://tigase:123456@localhost/tigasedb'
}
}
userRepository {
default () {}
}
authRepository {
default () {}
}
日志配置
debug = [ 'xmpp.XMPPIOService' ]
You can also have debugging switched on for many packages/classes at the same time:
debug = [ 'cluster' , 'xmpp.XMPPIOService' ]
Other packages you might be interested in are:
io can print out what is going on a very low level network level including TLS/SSL stuff.
xml would print the XML parser debugging data.
cluster would print all the clustering related stuff.
xmpp.impl would print logs from all plugins loaded to Tigase server.
Non-Tigase packages
To enable logging for your own packages from those different than Tigase, you have to use another option which has been made available for this:
debug-packages = [ your.com.package ]
tigase.conf配置
TIGASE_OPTIONS=" --property-file etc/config.tdsl "
系统服务
For systemd-based linux distributions
Once installation is complete you may start Tigase as a typical systemd service using following command:
sudo systemctl start tigase-server
To stop it, you may run following command:
sudo systemctl stop tigase-server
It is also possible to enable service, to make it start during startup of the operating system:
sudo systemctl enable tigase-server
For other linux distributions
Once installation is complete, you should be able to start Tigase using the following command:
service tigase start
Tigase should begin running in the background. Since Tigase is now installed as a service, it can be controlled with any of the service commands, such as:
service tigase stop
service tigase restart
参考配置
# Enable cluster mode
--cluster-mode = true
# Enable debugging for server and xmpp.impl
--debug = 'server,xmpp.impl'
# Set list of virtual hosts (old way)
--virt-hosts = 'example.com,test-1.example.com,test-2.example.com'
# Configure list of administrator jids
admins = [ 'admin@zeus', '[email protected]' ]
# Set config type
config-type = '--gen-config-def'
# Configure dataSource bean with database configuration
dataSource {
# Configure default data source (using default implementation so class is omitted)
default () {
uri = 'jdbc:postgresql://127.0.0.1/tigase?user=test&password=test&autoCreateUser=true'
}
# Configure data source with name exaple.com (will be used by domain example.com)
'example.com' () {
uri = 'jdbc:mysq://127.0.0.1/example?user=test&password=test&autoCreateUser=true'
}
}
# Configure C2S component
c2s {
# Enable Stream Management bean
'urn:xmpp:sm:3' () {
}
# Register tigase.server.xmppclient.SeeOtherHostDualIP as seeOtherHost bean
seeOtherHost (class: tigase.server.xmppclient.SeeOtherHostDualIP) {
}
# Add additional port 5224 which is SSL port and disable port 5223
connections () {
'5224' () {
socket = ssl
}
'5223' (active: false) {
}
}
}
# Configure HTTP API component
http {
# Set list of API keys
api-keys = [ 'test1234', 'test2356' ]
rest {
# Set value of environment property as a path to look for REST scripts
rest-scripts-dir = env('TIGASE_REST_SCRIPTS_DIR')
}
}
# Register pubsub-2 (class is passed as pubsub-2 name do not have default class assigned)
pubsub-2 (class: tigase.pubsub.cluster.PubSubComponentClustered) {
# Set configuration bean properties
pubsubConfig {
persistentPep = true
}
# Use tigase.pubsub.cluster.ClusteredNodeStrategy as advanced clustering strategy
strategy (class: tigase.pubsub.cluster.ClusteredNodeStrategy) {
}
}
# Configure Session Manager
sess-man {
# Here we enable pep, urn:xmpp:mam:1 processors and disable message-archive-xep-0136 processor
pep () {
}
'urn:xmpp:mam:1' () {
}
message-archive-xep-0136 (active: false) {
}
# Define class used as clustering strategy (it is different than default so class is required)
strategy (class: tigase.server.cluster.strategy.OnlineUsersCachingStrategy) {
}
}
启动
scripts/tigase.sh start etc/tigase.conf
停止运行
scripts/tigase.sh stop etc/tigase.conf
tigase 配置
按照上述配置后,点击以上链接,一路next
需要 config.tdsl 中 ‘config-type’ = ‘setup’
分别填写你的主机ip
centos登录的用户名,密码,选择你使用的数据库
数据库配置
如下图
1、你将要创建的数据名
2、填写你的主机ip,这里使用mongodb的默认端口12707
3、填写你将要使用的mongodb账户 用户名A
4、填写你将要使用的mongodb账户 密码P
5、填写你的mongodb创建的具有root权限用户的账号
6、填写填写你的mongodb创建的具有root权限用户的密码
tigase会使用5、6自动创建3、4数据库用户及密码
点击next后,如果没有问题,则check界面一路绿灯
数据库已经自动创建成功
重启服务
./scripts/tigase.sh stop
./scripts/{OS}/init.d/tigase start etc/tigase.conf
where {OS} is your type of Linux, gentoo, debian, mandriva, or redhat
查下你现在连了多少 连接数
show variables like '%max_connections%';
show global status like 'Max_used_connections';
https://blog.csdn.net/nginxs/article/details/77050959 Tigase-01 使用spark或spi登录Tigase服务器
Tigase8.0 配置Mongodb,数据库表中已经没有tig_paris表
官方工作人员回复:This works as expected as Tigase schema for MongoDB does not require tig_pairs table, see Tigase XMPP Server Schema topic in side https://docs.tigase.net/tigase-server/snapshot/Administration_Guide/html/#mongoDBSupport section.
好友关系信息
更新于2019年6月13日 9:50
账号密码
更新于2019年10月21日 11:26
tigase 8.0 修改端口
Windows eclipse环境搭建
编辑config.tdsl文件
'config-type' = 'default'
'debug' = 'server','xmpp.impl','xmpp.XMPPIOService','server.ext.handlers.SASLProcessor','spam'
'default-virtual-host' = 'xxx.com'
dataSource () {
default () {
uri = 'mongodb://tigase_user:密码@ip地址/tigasedb'
}
}
http () {
setup () {
'admin-password' = 'xxx..xx'
'admin-user' = 'admin'
}
}
tigase.conf
#osgiEnabled=(true|false)
#osgiEnabled=false
OSGI=${
osgiEnabled}
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver"
#GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewRatio=2 -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2 -XX:-ReduceInitialCardMarks -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"
#EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA"
#REMOTE_DEBUG=" -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n "
#GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc "
#JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0"
## AWS hostname resolver
#export INTERNAL_IP="$(curl -s http://169.254.169.254/latest/meta-data/local-hostname)"
#export EXTERNAL_IP="$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)"
JAVA_HOME="C:\Program Files\Java\jdk1.8.0_201"
CLASSPATH=""
## Possible memory allocation improvements on some CentOS/RHEL systems
## https://www.ibm.com/developerworks/community/blogs/kevgrig/entry/linux_glibc_2_10_rhel_6_malloc_may_show_excessive_virtual_memory_usage?lang=en
# export MALLOC_ARENA_MAX=4
## You should explicitly set young gen size only if you know what you are doing and only after running Load Tests that confirms the assumption!
#JAVA_YOUNG_GEN_EXPLICIT_SIZE=" -Xmn<young size>[g|m|k] "
#PRODUCTION_HEAP_SETTINGS=" -Xms5g -Xmx5g ${JAVA_YOUNG_GEN_EXPLICIT_SIZE} " # heap memory settings must be adjusted on per deployment-base!
JAVA_XSS=" -Xss228k "
JAVA_DIRECT_MEMORY=" -XX:MaxDirectMemorySize=128m "
JAVA_METASPACE=" -XX:MaxMetaspaceSize=128m "
JAVA_OPTIONS="${GC} ${GC_DEBUG} ${REMOTE_DEBUG} ${EX} ${ENC} ${DRV} ${JMX_REMOTE_IP} -server ${PRODUCTION_HEAP_SETTINGS} ${JAVA_XSS} ${JAVA_DIRECT_MEMORY} ${JAVA_METASPACE} "
##TIGASE_OPTIONS=" "
TIGASE_OPTIONS=" --property-file config.tdsl "