文章目录
- 1.资源下载
- 2.上传服务器
- 3.赋予执行权限并执行安装
- 4.执行安装
- 5.访问Bitbucket
- 6.Bitbucket安装页面配置
- 6.1连接Jira应用程序到PostgreSQL
- 6.1.1创建并配置PostgreSQL数据库
- 6.1.2测试数据库连接
- 6.2授权
- 6.2.1授权包
- 6.2.1.1资源地址
- 6.2.1.2上传到服务器
- 6.2.2停止bitbucket服务
- 6.2.3修改`_start-webapp.sh`配置文件
- 6.2.4启动bitbucket服务
- 6.2.5验证授权包是否注入成功
- 6.2.6获取授权码
- 7.插件安装
- 7.1插件下载
- 7.2获取插件授权码
- 8.常用命令行
1.资源下载
https://www.atlassian.com/zh/software/bitbucket/download/data-center
2.上传服务器
scp -r D:\xx\atlassain\atlassian-bitbucket-7.21.20-x64.bin root@xxx.xxx.xxx.xxx:/usr/local/xxx
3.赋予执行权限并执行安装
cd /usr/local/xxx
chmod +x atlassian-bitbucket-7.21.20-x64.bin
4.执行安装
[root@localhost soft_resource]# ./atlassian-bitbucket-7.21.20-x64.bin
Unpacking JRE ...
Starting Installer ...
然后弹出一个选择框
5.访问Bitbucket
如果服务器本地可以连接,但是通过远程ip访问不行,则需要检查一下防火墙是否放行7990
端口,也可以暂时先关闭防火墙后重试。
firewall-cmd --zone=public --add-port=7990/tcp --permanent
firewall-cmd --reload #修改后需要重新加载防火墙生效
# 显示success表示成功
# –zone=public表示作用域为公共的
# –add-port=7990/tcp添加tcp协议的端口端口号为7990
# –permanent永久生效,如果没有此参数,则只能维持当前 服 务生命周期内,重新启动后失效;
6.Bitbucket安装页面配置
6.1连接Jira应用程序到PostgreSQL
参考文档:https://confluence.atlassian.com/bitbucketserver0721/connect-bitbucket-to-postgresql-1115666288.html
6.1.1创建并配置PostgreSQL数据库
CREATE ROLE bitbucket WITH LOGIN PASSWORD 'bitbucket' VALID UNTIL 'infinity';
#如果存在,先删除
DROP DATABASE bitbucketdb;
CREATE DATABASE bitbucketdb WITH ENCODING='UTF8' OWNER=bitbucket CONNECTION LIMIT=-1;
6.1.2测试数据库连接
测试成功后点击next,进行数据库的初始化。
6.2授权
6.2.1授权包
注意: 此授权包经测试,无法授权bitbucket8版本,仅供参考,可自行实践。
6.2.1.1资源地址
https://github.com/haxqer/confluence/releases/download/v1.3.3/atlassian-agent.jar
6.2.1.2上传到服务器
scp -r D:\Colde\atlassain\github的破解包\atlassian-agent.jar root@xxx.xxx.xxx.xxx:/opt/atlassian
6.2.2停止bitbucket服务
systemctl stop atlbitbucket
首次安装过程,可能会出现无法停止服务的现象,使用ps -ef|grep bitbucket
进行查询
ps -ef|grep bitbucket
[root@localhost ~]# ps -ef|grep bitbucket
atlbitb+ 96157 1 1 10:11 pts/0 00:00:24 /opt/atlassian/bitbucket/7.21.20/jre/bin/java -Xshare:auto -Dopensearch.networkaddress.cache.ttl=60 -Dopensearch.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=SPI,JRE -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.io.tmpdir=/var/atlassian/application-data/bitbucket/tmp/search -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:logs/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=32 -XX:GCLogFileSize=64m -XX:MaxDirectMemorySize=536870912 -Dopensearch.path.home=/opt/atlassian/bitbucket/7.21.20/opensearch -Dopensearch.path.conf=/var/atlassian/application-data/bitbucket/shared/search/config -Dopensearch.distribution.type=tar -Dopensearch.bundled_jdk=true -cp /opt/atlassian/bitbucket/7.21.20/opensearch/lib/* org.opensearch.bootstrap.OpenSearch -d -p /var/atlassian/application-data/bitbucket/log/search/opensearch.pid
atlbitb+ 96175 1 10 10:11 pts/0 00:02:43 /opt/atlassian/bitbucket/7.21.20/jre/bin/java -classpath /opt/atlassian/bitbucket/7.21.20/app -Datlassian.standalone=BITBUCKET -Dbitbucket.home=/var/atlassian/application-data/bitbucket -Dbitbucket.install=/opt/atlassian/bitbucket/7.21.20 -Dcom.sun.jndi.ldap.connect.pool.timeout=300000 -Xms512m -Xmx1g -XX:+UseG1GC -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djava.io.tmpdir=/var/atlassian/application-data/bitbucket/tmp -Djava.library.path=/opt/atlassian/bitbucket/7.21.20/lib/native;/var/atlassian/application-data/bitbucket/lib/native com.atlassian.bitbucket.internal.launcher.BitbucketServerLauncher start
postgres 97285 8410 0 10:33 ? 00:00:02 postgres: bitbucket bitbucketdb 192.168.182.131(37534) idle
postgres 97288 8410 0 10:33 ? 00:00:00 postgres: bitbucket bitbucketdb 192.168.182.131(37536) idle
postgres 97289 8410 0 10:33 ? 00:00:00 postgres: bitbucket bitbucketdb 192.168.182.131(37538) idle
postgres 97290 8410 0 10:33 ? 00:00:00 postgres: bitbucket bitbucketdb 192.168.182.131(37540) idle
postgres 97291 8410 0 10:33 ? 00:00:00 postgres: bitbucket bitbucketdb 192.168.182.131(37542) idle
postgres 97292 8410 0 10:33 ? 00:00:00 postgres: bitbucket bitbucketdb 192.168.182.131(37544) idle
root 97501 97375 0 10:38 pts/2 00:00:00 grep --color=auto bitbucket
[root@localhost ~]#
再用kill -9 <进程ID>
杀死进程
[root@localhost ~]# kill -9 96157
[root@localhost ~]# kill -9 96175
再次查询
[root@localhost ~]# ps -ef|grep bitbucket
root 97585 97375 0 10:40 pts/2 00:00:00 grep --color=auto bitbucket
[root@localhost ~]#
6.2.3修改_start-webapp.sh
配置文件
cd /opt/atlassian/bitbucket/7.21.20/bin # 打开安装的bin文件夹
vim _start-webapp.sh
直接在JAVA_OPTS变量最前面追加-javaagent:/opt/atlassian/atlassian-agent.jar
JAVA_OPTS="-javaagent:/opt/atlassian/atlassian-agent.jar -classpath $INST_DIR/app $JAVA_OPTS $BITBUCKET_ARGS $JNDI_ARGS $JMX_OPTS $JVM_REQUIRED_ARGS $JVM_SUPPORT_RECOMMENDED_ARGS"
6.2.4启动bitbucket服务
systemctl start atlbitbucket
6.2.5验证授权包是否注入成功
ps aux | grep javaagent # 出现-javaagent
[root@localhost soft_resource]# ps aux | grep javaagent
jira 95074 7.5 14.5 5647864 560856 ? Sl 10:02 3:24 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.desktop/sun.font=ALL-UNNAMED --add-opens=java.base/sun.reflect.generics.parser=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.base/sun.util.calendar=ALL-UNNAMED --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED? -Xms384m -Xmx2048m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Dlog4j2.contextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector -Dlog4j2.disableJmx=true -Dlog4j2.garbagefree.threadContextMap=true -Dlog4j2.isWebapp=false -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT -Datlassian.plugins.startup.options= -javaagent:/opt/atlassian/atlassian-agent.jar -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xlog:gc*:file=/opt/atlassian/jira/logs/atlassian-jira-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=20M -XX:+ExplicitGCInvokesConcurrent -Dignore.endorsed.dirs= -classpath /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/jira -Dcatalina.home=/opt/atlassian/jira -Djava.io.tmpdir=/opt/atlassian/jira/temp org.apache.catalina.startup.Bootstrap start
atlbitb+ 98060 129 19.4 3783240 751088 ? Sl 10:47 0:31 /opt/atlassian/bitbucket/7.21.20/jre/bin/java -javaagent:/opt/atlassian/atlassian-agent.jar -classpath /opt/atlassian/bitbucket/7.21.20/app -Datlassian.standalone=BITBUCKET -Dbitbucket.home=/var/atlassian/application-data/bitbucket -Dbitbucket.install=/opt/atlassian/bitbucket/7.21.20 -Dcom.sun.jndi.ldap.connect.pool.timeout=300000 -Xms512m -Xmx1g -XX:+UseG1GC -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djava.io.tmpdir=/var/atlassian/application-data/bitbucket/tmp -Djava.library.path=/opt/atlassian/bitbucket/7.21.20/lib/native;/var/atlassian/application-data/bitbucket/lib/native com.atlassian.bitbucket.internal.launcher.BitbucketServerLauncher start
root 98210 0.0 0.0 112828 988 pts/1 S+ 10:48 0:00 grep --color=auto javaagent
java -jar /opt/atlassian/atlassian-agent.jar # 出现参数提示
[root@localhost /]# java -jar /opt/atlassian/atlassian-agent.jar
====================================================
======= Atlassian Crack Agent v1.3.1 =======
======= https://zhile.io =======
======= QQ Group: 30347511 =======
====================================================
KeyGen usage: java -jar /opt/atlassian/atlassian-agent.jar [-d] [-h] -m <arg> [-n
<arg>] -o <arg> -p <arg> -s <arg>
-d,--datacenter Data center license[default: false]
-h,--help Print help message
-m,--mail <arg> License email
-n,--name <arg> License name[default: <license email>]
-o,--organisation <arg> License organisation
-p,--product <arg> License product, support:
[crowd: Crowd]
[jsm: JIRA Service Management]
[questions: Questions plugin for Confluence]
[crucible: Crucible]
[capture: Capture plugin for JIRA]
[conf: Confluence]
[training: Training plugin for JIRA]
[*: Third party plugin key, looks like:
com.foo.bar]
[bitbucket: Bitbucket]
[tc: Team Calendars plugin for Confluence]
[bamboo: Bamboo]
[fisheye: FishEye]
[portfolio: Portfolio plugin for JIRA]
[jc: JIRA Core]
[jsd: JIRA Service Desk]
[jira: JIRA Software(common jira)]
-s,--serverid <arg> License server ID
================================================================================
# Crack agent usage: append -javaagent arg to system environment: JAVA_OPTS.
# Example(execute this command or append it to setenv.sh/setenv.bat file):
export JAVA_OPTS="-javaagent:/opt/atlassian/atlassian-agent.jar ${JAVA_OPTS}"
# Then start your confluence/jira server.
[root@localhost /]#
6.2.6获取授权码
使用java -jar /opt/atlassian/atlassian-agent.jar
命令可以查看附加参数如何填写;如果安装的Bitbucket
是data center
则需要加上 -d true
。
例子:-s
的值,在页面配置Bitbucket中获取,为服务器ID
java -jar /opt/atlassian/atlassian-agent.jar -p bitbucket -m aaa@bbb.com -n my_name -o https://zhile.io -s XXXX-CCCC-QQQQ-DDDD
7.插件安装
7.1插件下载
https://marketplace.atlassian.com/
7.2获取插件授权码
执行命令和上面的一样,只是把 -p 参数值换成应用密钥,例如
java -jar atlassian-agent.jar -p com.xpandit.plugins.xray -m aaa@bbb.com -n my_name -o https://zhile.io -s xxxx-xxxx-xxxx-xxxx
8.常用命令行
systemctl restart atlbitbucket
systemctl stop atlbitbucket
systemctl start atlbitbucket