2023年3月27日 星期一

nginx 代理nacos cluster 2.X , 無法註冊服務

透過 nginx 代理nacos cluster 2.X , 無法註冊服務, 但指定單機的nacos(即不透過nginx代理) 是可以的. 直接透過nginx 代理其中一台單機版也不行, 所以跟集群無關, 而且nginx 的問題. 容器真的是好用, 我在無法再新增服務器的情況下, 使用docker nginx image 作, 是OK的, 原來, nacos 在起動時預設為8848, 同時增加2個port, 主port +1000 port for , 客戶端gRPC請求服務端端口,用於客戶端向服務端發起連接和請求 主port +1001 port for , 服務端gRPC請求服務端端口,用於服務間同步等 所以nginx 代理除了8848 port 外, 還需要代理 9848 port.

2023年3月8日 星期三

參考IT名人的BLOG

Joel Spolsky - https://www.joelonsoftware.com/ Jeff Atwood - https://blog.codinghorror.com/ Scott Hanselman - https://www.hanselman.com/blog/

2022年8月29日 星期一

SSH Client 無法連線至SSH Server 設定

因為工作用的SERVER 是比較老舊的, 所以在使用Linux Clinet SSH 連線至SERVER時會有一些錯誤。
目前的解決方式是修改Client SSH Config.
/etc/ssh 是Client 的設定資料夾
/etc/sshd 是Server 的設定資料夾

這次遇到的問題是無法連線至遠端的Server, 所以是修改 /etc/ssh 資料夾。
問題1: 
Unable to negotiate with 10.198.***.*** port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 

問題2:
Unable to negotiate with 10.198.***.** port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

因為我的環境中, SSH 會include /etc/ssh/ssh_config.d/*.conf,所以我在該路徑加了一個melin.conf 

內容如下: 


KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

Host *
    HostKeyAlgorithms=+ssh-dss



2022年2月25日 星期五

透過 Gmail 發信二段驗證設定

Google 啟用二段式驗證後, 會無法登入,
其他需要調整
  1. 加密 SSL/TLS ->STARTTLS
  2. PORT 587, 原本可能就設定錯誤
  3. 密碼: 至Google 帳戶設定





這封郵件來自 Evernote。Evernote 是您專屬的工作空間,免費下載 Evernote

2021年11月27日 星期六

get current mathod name

image

java static get Class Name

for log4j static object initialize class name.

 

static String CLASS_NAME = java.lang.invoke.MethodHandles.lookup().lookupClass().getName(); 
static Logger log = Logger.getLogger(CLASS_NAME); 

2021年10月6日 星期三

Add Maven dependencies to Eclipse Deployment Assembly

image

在Eclipes Project 中,加入<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>

image

 

手動使用這個方法在執行Maven-update project 之後,該項設定會消失。可以透過Eclipse 的設定來處理:

 

image

image

image

image

 

在Java Build Path->Order and Export 勾選 Maven Dependencies

image

如此再執行Maven Update Project,Deployment Assembly關於Maven Dependency設定還是會不見。但另外新增一個專案,將.classpath、.project copy 至此專案,則看似正常,所以還在確認解決方法。

2021年7月29日 星期四

Maven install a jar to private repository

pom 需要有一個效果就是引用本機的JAR檔.

 

可以這麼作

<dependency>

<groupId>com.sample</groupId>
<artifactId>sample</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Name_Your_JAR.jar</systemPath>
</dependency>

 

也可以這麼作

mvn install:install-file
-Dfile=D:/tmp/myTest.jar
-DgroupId=com.test
-DartifactId=myTest
-Dversion=1.0
-Dpackaging=jar

<dependency>
    <groupId>com.test</groupId>
    <artifactId>myTest</artifactId>
    <version>1.0</version>
    <scope>provided</scope>
</dependency>

2021年5月26日 星期三

技巧的設定JAVA main 測試環境

在Eclipse 執行測試程式,有時需要判定是否為測試環境。

可在執行設定中加入一個系統參數。

 

image

在VM arguments 輸入-DIS_DEV_ENV=true

image

 

main Method 中可以用System.getProperty 來取得系統的設定。

image

2021年4月5日 星期一

上市公司季報下載

 所有上市公司的每季財報可在此處作一次下載, https://mops.twse.com.tw/mops/web/t203sb02




2020年12月17日 星期四

時間是最珍貴的資源

時間是最珍貴的資源,不能管理時間,便什麼也無法管理。
Time is the scarcest resource and unless it is managed nothing else can be managed.
—— 彼得.杜拉克 - 管理學之父

2020年12月10日 星期四

Java system properties and environment variables

  • System properties are set on the Java command line using the -Dpropertyname=value syntax. They can also be added at runtime using System.setProperty(String key, String value) or via the various System.getProperties().load() methods.
    To get a specific system property you can use System.getProperty(String key) or System.getProperty(String key, String def).
  • Environment variables are set in the OS, e.g. in Linux export HOME=/Users/myusername or on Windows SET WINDIR=C:\Windows etc, and, unlike properties, may not be set at runtime.
    To get a specific environment variable you can use System.getenv(String name).

2020年12月3日 星期四

2020年11月8日 星期日

Windows 10 Clipboard 功能

Oreilly 程式設計師提升生產力秘笈一書有有提到CLICLI 剪貼簿可以看到歷史紀錄。Windows 10 也支援這個功能了.

 

image

可以按快捷鍵 Windows+V 開啟剪貼簿

image

2020年11月2日 星期一

MySQL relay-bin log error

MySQL Replication Server , 因空間滿了, 導致MySQL 無法登入.

這應該持續一段時間了, 檢查之後發現是 relay-bin log 滿了。

應該是年中時, 有大量的刪除及UPDATE 資料關係。

所以Replication 要重建。因為空間滿了無法啟動MYSQL, 所以只能刪掉一些檔案, 重啟slave 時發現下列錯誤.

ERROR 29 (HY000): File './#####-relay-bin.001416' not found (Errcode: 2 - No such file or directory)

 

處理方法

1. stop slave

2. reset slave

3. rm *.relay-bin*

4. restart mysql

5. CHANGE MASTER TO MASTER_HOST….略

6. start slave

 

完成收工.

2020年11月1日 星期日

Export SQL Server Agent Jobs

You can do all your Agent jobs in one go fairly easy:

1. Click on the "Jobs" section in the SQL Agent in SSMS

2. Hit the F7 key on your keyboard (opens the Object Explorer Details)

3. Highlight the jobs you want to export in the Object Explorer Details

4. Right-click the highlighted jobs and "Script Job As..." like you would for a single job

2020年10月25日 星期日

Eclipse Library Folder ClasspathContainer

Eclipse 設定資料夾下的jar files 為CLASSPATH

image

 

Name:Library Folder ClasspathContainer

Location:http://libcontainer.sourceforge.net/updates/

image

image

image

imageimageimageimageimage

image

 

 

 

 

image

 

image

 

 

image

2020年10月21日 星期三

Centos 7+ 停用網卡自動命名

已經很習慣使用ifcfg-eth0 來定義預設網卡,

自Centos 7 之後, 會自動命名網卡名稱, 非常不習慣.

 

解決這個方法可以在安裝Centos 7或8時, 多輸入下列的命令

net.ifnames=0 biosdevname=0

image

image

如此即可。

Ads

Seo Services