猫言猫语

严以律己·宽以待人·自强不息·知行合一

Portainer 快速上手

| Portainer 快速上手已关闭评论

docker volume create portainer_data
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer 

Dubbo Admin 安装

| Dubbo Admin 安装已关闭评论

wget https://github.com/apache/dubbo-admin/archive/0.2.0.tar.gz
tar zxvf 0.2.0.tar.gz
cd dubbo-admin-0.2.0
./mvnw clean package
java -jar dubbo-admin-distribution/target/dubbo-admin-0.2.0.jar --server.port=8081

CentOS 7 安装 nginx

| CentOS 7 安装 nginx已关闭评论

yum install -y epel-release
yum install -y nginx

Debian 9 安装 ZooKeeper

| Debian 9 安装 ZooKeeper已关闭评论

sudo apt install zookeeperd
sudo systemctl enable zookeeper
sudo systemctl restart zookeeper
[email protected]:/var/lib/zookeeper# /usr/share/zookeeper/bin/zkCli.sh
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /
[zookeeper]
[zk: localhost:2181(CONNECTED) 1]
[zk: localhost:2181(CONNECTED) 0] create /config.json {}
Created /config.json
[zk: localhost:2181(CONNECTED) 1]
[zk: localhost:2181(CONNECTED) 0] get /config.json
{}
cZxid = 0xb
ctime = Fri Apr 03 17:27:50 GMT+00:00 2020
mZxid = 0xb
mtime = Fri Apr 03 17:27:50 GMT+00:00 2020
pZxid = 0xb
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 2
numChildren = 0
[zk: localhost:2181(CONNECTED) 1]
[zk: localhost:2181(CONNECTED) 0] delete /config.json
[zk: localhost:2181(CONNECTED) 1]

解决 macOS zsh ssh 乱码

| 解决 macOS zsh ssh 乱码已关闭评论

最近使用 macOS zsh ssh 登录远程服务器时候,终端会出现如下提示内容:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

显示中文字符时会不规则的乱码,有些字符乱,有些字符不乱

解决办法是编辑 ~/.zshrc 文件,手动设置一下终端环境的语言编码:

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Laravel 的 3 种运行环境

| Laravel 的 3 种运行环境已关闭评论

Laravel 可以在通过 APP_ENV 环境变量修改运行时环境,默认的 APP_ENV 是 local,其实他还可以设置其他值,分别是:

local 对应的 development 环境
testing 对应的 test 环境
production 对应的 production 环境

CentOS 7 安装 Tomcat 8

| CentOS 7 安装 Tomcat 8已关闭评论

网上有很多 CentOS 7 安装 Tomcat 8 教程,都是从 Apache 官网下载二进制包后解压启动,随意性太强。没有通过系统包管理来维护是不完美的。

yum install https://harbottle.gitlab.io/harbottle-main/7/x86_64/harbottle-main-release.rpm
yum install tomcat8
systemctl enable tomcat8
systemctl restart tomcat8

部署的时候把 war 文件放到 /var/lib/tomcat8/webapps 目录下即可。