单机安装请参考:
http://fshuanglan.blog.51cto.com/133806/1369802
主:
[root@main tmp]# hostname -f
main.example.com
备:
[root@spare tmp]# hostname -f
spare.example.com
——————————————————————————————————————————————————————————————————————————————————————————————————————
Step 1☆ 环境搭建
yum install httpd mysql mysql-server php php-*
yum install java-1.7.0-openjdk.x86_64 java-1.7.0-openjdk-devel.x86_64
Step 2☆ 下载软件包
wget https://projects.tigase.org/p_w_uploads/download/1342/tigase-server-5.2.0-b3447.jar
Step 3☆ 安装配置PostgreSQL
rpm -ivh http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
yum install postgresql92-server postgresql92-*
chkconfig postgresql-9.2 on
service postgresql-9.2 initdb ---初始化数据库
chkconfig postgresql-9.2 on ---开机启动
service postgresql-9.2 start
rpm -qa | grep postgresql
postgresql-libs-8.4.20-1.el6_5.x86_64
postgresql92-9.2.8-1PGDG.rhel6.x86_64
postgresql92-contrib-9.2.8-1PGDG.rhel6.x86_64
postgresql92-libs-9.2.8-1PGDG.rhel6.x86_64
postgresql92-server-9.2.8-1PGDG.rhel6.x86_64
su - postgres
-bash-4.1$ psql
postgres=#
postgres=# alter user postgres with password 'postgres'; ---设置数据库超级用户密码
ALTER ROLE
postgres=# create user tigase with password 'tigase'; ---创建用户
CREATE ROLE
postgres=# create database tigase with owner tigase; ---创建数据库
CREATE DATABASE
postgres=# \l ---查看
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
tigase | tigase | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
(4 rows)
postgres=# \q --退出
-bash-4.1$
修改PostgresSQL 数据库配置实现远程访问。
-bash-4.1$ vi /var/lib/pgsql/9.2/data/postgresql.conf
#listen_addresses = ‘localhost’ 改为:listen_addresses = '*' #监听整个网络
修改客户端认证配置文件pg_hba.conf,将需要远程访问数据库的IP地址或地址段加入该文件。
-bash-4.1$ vi /var/lib/pgsql/9.2/data/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.0.0/24 trust
-bash-4.1$ exit
重启服务,测试连接数据库。
service postgresql-9.2 restart
Stopping postgresql-9.2 service: [ OK ]
Starting postgresql-9.2 service: [ OK ]
su - postgres
-bash-4.1$ psql -h 127.0.0.1 -U tigase -W -d tigase # -W强行要求用户输入密码
Password for user tigase:
psql (9.2.8)
Type "help" for help.
tigasedb=>
Step 4☆ 开启防火墙端口
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 5222 -j ACCEPT
iptables -I INPUT -p tcp --dport 5277 -j ACCEPT
iptables -I INPUT -p tcp --dport 5432 -j ACCEPT
Step 5☆启动HTTP、MySQL服务、设置MySQL密码、创建数据库
chkconfig httpd on
chkconfig mysqld on
service httpd start
service mysqld start
/usr/bin/mysql_secure_installation
Step 6☆ 软件安裝
java -jar tigase-server-5.2.0-b3447.jar -console
Welcome to the installation of Tigase XMPP (Jabber) Server 5.2.0-b3447!
- Artur Hefczyc <artur.hefczyc@tigase.org>
- Bartosz Makowski <bmalkowski@tigase.pl>
- Wojciech Kapcia <wojciech.kapcia@tigase.org>
- Andrzej Wójcik <andrzejw@tigase.org>
- Wojciech Czubaszek <wojciech.czubaszek@tigase.org>
- Eric Dziewa <eric.dziewa@tigase.org>
- Jacek Predki <jacek.predki@tigase.com>
- Piotr Kontek
- Alexander Gnauck
- Tomasz Sterna
- Mateusz Fioka
- David Pache
- Peter Sandstrm
- Yonas Yanfa
The homepage is at: http://www.tigase.org/
press 1 to continue, 2 to quit, 3 to redisplay
The installed application needs a JDK. A java runtime environment (JRE) will be not sufficient.
Enter path: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64
*** Select what you want to do next:
On this panel you can specify whether you want to install only or configure already installed server or to do both. If you are just installing a server on your machine it is a good idea to do both steps.
-------------------
The wizards you want to execute
Installation of the Tigase Server
[on, off]
on
Configuration of the Tigase Server
[on, off]
on
-------------------
If you notice any problems please report them to address: artur.hefczyc@tigase.org
press 1 to continue, 2 to quit, 3 to redisplay
1
Tigase XMPP (Jabber) server ver 5.2.0-b3447
About
Copyright (C) 2004-2013 Tigase.org. <http://www.tigase.org/>
The Tigase Jabber/XMPP Server is Open Source and Free (AGPLv3) Java based server.
The server offers complete implementation of the XMPP protocol with a long list
of extensions. Effcient, reliable and very extensible can be easily integrated
it with your systems.
The unique features of the Tigase server are
--- Press ENTER to continue --
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
1. I accept the terms of this license agreement.
2. I do not accept the terms of this license agreement.
Choose number (1-2): 1
Select target path [/tmp]
/opt/tigase-server
Select the packs you want to install:
1 => Base, The base files
2 => Unix Files, Files needed to run the server on Unix like systems
3 => [x] Docs, The documentation
4 => [x] Extras, Extras libraries, MUC, PubSub, STUN, Socks5, Message Archiving, ACS
5 => [x] Groovy scripting, Various Groovy scripts extending server functionality
6 => [x] Derby Database (DB included), Derby database (included) and JDBC driver
7 => [x] MySQL Database driver (DB not included), MySQL JDBC driver (MySQL has to be installed separately)
8 => [x] PostgreSQL Database driver (DB not included), PostgreSQL JDBC driver (PostgreSQL has to be installed separately)
9 => [x] SQL Server Database driver (DB not included), SQL Server JDBC driver (SQL Server has to be installed separately)
10 => [x] OSGi dependencies, If you intend to run Tigase in OSGi mode you need additional libraries. Enabling this Pack will also setup configuration files to start Tigase XMPP server in OSGi mode.
11 => [x] HTTP API Component, Interface for the service administration, monitoring and exchange data between Tigase and external system
12 => [ ] Sources, The server source files, tools and libraries sources are not included
r => Redisplay menu
d => DoneChoose action: d
press 1 to continue, 2 to quit, 3 to redisplay
1
[ Starting to unpack ]
[ Processing package: Base (1/11) ]
[ Processing package: Unix Files (2/11) ]
[ Processing package: Docs (3/11) ]
[ Processing package: Extras (4/11) ]
[ Processing package: Groovy scripting (5/11) ]
[ Processing package: Derby Database (DB included) (6/11) ]
[ Processing package: MySQL Database driver (DB not included) (7/11) ]
[ Processing package: PostgreSQL Database driver (DB not included) (8/11) ]
[ Processing package: SQL Server Database driver (DB not included) (9/11) ]
[ Processing package: OSGi dependencies (10/11) ]
[ Processing package: HTTP API Component (11/11) ]
[ Unpacking finished ]
*** Basic Tigase server configuration
On this panel you can specify basic configuration settings for the Tigase server.
Based on your selection here more configuration options might be presented later on. After the configuration is complete init.properties file will be created.
You can optionally restart the server at the end of the process if you like.
-------------------
0 [ ] Default installation
1 [x] Default plus extra components
2 [ ] Session Manager only
3 [ ] Network connectivity only
input selection: 1
Your XMPP (Jabber) domains [main.example.com]
example.com
Server administrators [admin@main.example.com]
admin@example.com
Admin password [tigase]
tigase
0 [ ] Derby (built-in database)
1 [ ] MySQL
2 [x] PostgreSQL
3 [ ] SQLServer
4 [ ] Other...
input selection:
2
-------------------
Advanced configuration options
[on, off]
off
press 1 to continue, 2 to quit, 3 to redisplay
1
*** Database configuration:
You have selected PostgreSQL database. This database needs additional configuration parameters. Please enter all required information.
-------------------
PostgreSQL super user account will be used only to create and configure database for the Tigase server. It will not be used by the Tigase server later on.
Super user account name: [root]
postgres
WARNING: password will be visible while entering
Super user password: postgres
WARNING: password will be visible while entering
Retype password:postgres
-------------------
PostgreSQL database details. It will be created automatically if it does not exist.
Database account: [tigase]
tigase
Account password: [tigase12]
tigase
Database name: [tigasedb]
tigase
Database host or IP: [localhost]
127.0.0.1
Additional database parameters: []
press 1 to continue, 2 to quit, 3 to redisplay
1
Checking connection to the database
Connection OK
Checking if the database exists
Exists OK
Checking the database schema
New schema loaded OK
Checking whether the database needs conversion
Conversion not needed
Adding XMPP admin accounts Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:29:52 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://127.0.0.1/tigase?user=postgres&password=postgres
All users added
Post installation actions
Finalizing... completed OK
Loading socks5 component schema
Loading socks5 schema... completed OK
Loading PubSub component schema
Loading PubSub schema... completed OK
Install was successeful
application installed on /opt/tigase-server
[ Console installation done ]
注意:按以上流程对第二台服务器进行安装,在数据库配置项,Database host or IP: [localhost] 请设置为主服务器的域名或者IP地址
-------------------
PostgreSQL database details. It will be created automatically if it does not exist.
Database account: [tigase]
tigase
Account password: [tigase12]
tigase
Database name: [tigasedb]
tigase
Database host or IP: [localhost]
main.example.com
Additional database parameters: []
press 1 to continue, 2 to quit, 3 to redisplay
1
Performing DB tasks
Checking connection to the database
Connection OK
Checking if the database exists
Exists OK
Checking the database schema
Schema OK, accounts number: 2
Checking whether the database needs conversion
Conversion not needed
Adding XMPP admin accounts Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Table schema found: public, database type: postgresql, database driver: org.postgresql.Driver
Apr 08, 2014 3:37:44 AM tigase.db.jdbc.DataRepositoryImpl initRepository
INFO: Initialized database connection: jdbc:postgresql://main.example.com/tigase?user=postgres&password=postgres
All users added
Post installation actions
Finalizing... completed OK
Loading socks5 component schema
Loading socks5 schema...
Socks5 schema exists, skipping schema load
Loading PubSub component schema
Loading PubSub schema...
PubSub schema exists, skipping schema load
Install was successeful
application installed on /opt/tigase-server
[ Console installation done ]
Step 6☆ 启动Tigase服务
手动启动:
cd /opt/tigase-server/
./scripts/tigase.sh start etc/tigase.conf
Starting Tigase:
Tigase running pid=1676
nohup: redirecting stderr to stdout
自动启动:
cd /opt/tigase-server/scripts/redhat/init.d
cp tigase /etc/init.d/
cd /etc/init.d/
chmod a+x tigase
useradd tigase
chown -R tigase:tigase /opt/tigase-server/logs
vim tigase
TIGASE_HOME=/opt/tigase-server --修改tigase安装目录
chkconfig --add /etc/init.d/tigase
chkconfig tigase on
/etc/init.d/tigase start
Starting Tigase XMPP server
Tigase started
Step 7☆ 客户端安装
前往PSI客户端网站下载 http://psi-im.org/download/
Step 8☆ ChatRoom同步
vim /opt/tigase-server/etc/init.properties
修改 --comp-class-1 = tigase.muc.MUCComponent
为:--comp-class-1 = tigase.muc.cluster.MUCComponentClustered
--virt-hosts = example.com
--user-db-uri = jdbc:postgresql://127.0.0.1/tigase?user=tigase&password=tigase
--user-db = pgsql
--admins = admin@example.com
--comp-name-4 = message-archive
--comp-name-3 = proxy
config-type = --gen-config-all
--comp-name-2 = pubsub
--comp-name-1 = muc
--cluster-mode = true
--sm-plugins = +message-archive-xep-0136
--debug = server
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent
服务端;
http://www.tigase.org/content/manual-installation-console-mode
客户端
http://www.tigase.org/content/psi-initial-configuration
转载于:https://blog.51cto.com/fshuanglan/1392313